Skip to content
Back to skills

Robust Java Coding Guidance

ASecurity

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

  • 37 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsgojavatesting

Works with

  • terminal

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add rondoflow/rondoflow --skill robust-java-coding-guidance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Robust Java Coding Guidance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Robust Java Coding Guidance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rondoflow-robust-java-coding-guidance/badge)](https://www.skillsdirectory.com/skills/rondoflow-robust-java-coding-guidance)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: robust-java-coding-guidance
description: "Write robust Java avoiding null traps, equality bugs, and concurrency pitfalls."
category: "Content & Writing"
author: community
version: "1.0.1"
icon: pencil
---

## Quick Reference

| 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` |

## 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

Files in this skill

  • SKILL.md1.8 KB
  • manifest.json302 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.