Java

Write robust Java avoiding null traps, equality bugs, and concurrency pitfalls.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Java" with this command: npx skills add ivangdavila/java

Quick Reference

TopicFile
Nulls, Optional, autoboxingnulls.md
Collections and iteration trapscollections.md
Generics and type erasuregenerics.md
Concurrency and synchronizationconcurrency.md
Classes, inheritance, memoryclasses.md
Streams and CompletableFuturestreams.md
Testing (JUnit, Mockito)testing.md
JVM, GC, modulesjvm.md

Critical Rules

  • == compares references, not content — always use .equals() for strings
  • Override equals() must also override hashCode() — HashMap/HashSet break otherwise
  • Optional.get() throws if empty — use orElse(), orElseGet(), or ifPresent()
  • Modifying while iterating throws ConcurrentModificationException — use Iterator.remove()
  • Type erasure: generic type info gone at runtime — can't do new T() or instanceof List<String>
  • volatile ensures visibility, not atomicity — count++ still needs synchronization
  • Unboxing null throws NPE — Integer i = null; int x = i; crashes
  • Integer == Integer uses reference for values outside -128 to 127 — use .equals()
  • Try-with-resources auto-closes — implement AutoCloseable, Java 7+
  • Inner classes hold reference to outer — use static nested class if not needed
  • Streams are single-use — can't reuse after terminal operation
  • thenApply vs thenCompose — compose for chaining CompletableFutures
  • Records are implicitly final — can't extend, components are final
  • serialVersionUID mismatch breaks deserialization — always declare explicitly

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Musicbrainz Importer

Look up and add music metadata on MusicBrainz. Use when asked to check if an artist, album, or release exists on MusicBrainz, find MusicBrainz entries linked...

Registry SourceRecently Updated
General

AI Product Manager

OpenClaw-first AI product manager for turning analytics, revenue, crash, store, and feedback signals into execution-ready proposals and backlog work.

Registry SourceRecently Updated
General

Startup Verifier

Проверяет стартапы по 14 критериям для адаптации на российский рынок и выдает вердикт: GREEN, YELLOW или RED.

Registry SourceRecently Updated
General

Air Asia

AirAsia is a Southeast Asian ultra-low-cost carrier carrying 60M+ passengers yearly with low fares, ancillary revenue, and a point-to-point Airbus A320 fleet.

Registry SourceRecently Updated