Install
openclaw skills install javaWrite robust Java avoiding null traps, equality bugs, and concurrency pitfalls.
openclaw skills install java| Topic | File |
|---|---|
| Nulls, Optional, autoboxing | nulls.md |
| Collections and iteration traps | collections.md |
| Generics and type erasure | generics.md |
| Concurrency and synchronization | concurrency.md |
| Classes, inheritance, memory | classes.md |
| Streams and CompletableFuture | streams.md |
| Testing (JUnit, Mockito) | testing.md |
| JVM, GC, modules | jvm.md |
== compares references, not content — always use .equals() for stringsequals() must also override hashCode() — HashMap/HashSet break otherwiseOptional.get() throws if empty — use orElse(), orElseGet(), or ifPresent()ConcurrentModificationException — use Iterator.remove()new T() or instanceof List<String>volatile ensures visibility, not atomicity — count++ still needs synchronizationInteger i = null; int x = i; crashesInteger == Integer uses reference for values outside -128 to 127 — use .equals()AutoCloseable, Java 7+thenApply vs thenCompose — compose for chaining CompletableFuturesserialVersionUID mismatch breaks deserialization — always declare explicitly