← ClaudeAtlas

java-reviewlisted

Reviews Java code for bugs, naming issues, code smells, and version-appropriate idioms. Use when user asks to "review this code", "check my Java", "look at this class", "find issues in", "code review", "what's wrong with this", or "review this file".
limited-grisaille833/claude-java-plugins · ★ 0 · Code & Development · score 59
Install: claude install-skill limited-grisaille833/claude-java-plugins
Review the Java code I've selected or provided. Follow these steps: ## Step 1 — Detect Java version Check the project for `pom.xml` (look for `<java.version>` or `<maven.compiler.source>`) or `build.gradle` (look for `sourceCompatibility`). If not found, ask: "What Java version are you targeting? (8, 11, 17, 21, or other)" ## Step 2 — Review for bugs and correctness - **Null safety:** flag unguarded dereferences; suggest `Optional<T>` (Java 8+) for values that may be absent - **Resource leaks:** flag unclosed `InputStream`, `Connection`, `PreparedStatement`; suggest try-with-resources - **equals/hashCode:** if one is overridden without the other, flag it - **Collection mutation:** flag modification of a collection while iterating over it - **Thread safety:** flag shared mutable fields accessed from multiple threads without synchronization - **Off-by-one:** review loop bounds and index access ## Step 3 — Review naming and style - Classes/interfaces: must be `PascalCase` - Methods/variables: must be `camelCase` - Constants (static final): must be `SCREAMING_SNAKE_CASE` - Flag single-letter variable names outside of loop counters (`i`, `j`, `k`) - Flag abbreviations that reduce clarity (e.g., `usr` → `user`, `mgr` → `manager`) ## Step 4 — Review Java idioms (version-aware) For each suggestion involving a version-gated feature, state: "Requires Java X+" - Java 8+: suggest streams/lambdas over verbose imperative loops where clarity improves - Java 8+: suggest try-with-resource