Java Coding Practices
Application skill for Java style learning (from the archived awesome-guidelines style capsules). For Spring/Jakarta/EE patterns, load stack capsules in skills/*-foundation.
Core Principle
Follow the project formatter and API conventions. Google formatting is one source-specific choice, not a reason to reformat an unrelated change. Review exception handling for lost failures and intentional recovery.
When to Use / NOT
- Java source, library public API, Checkstyle/google-java-format CI.
- Reviewing naming, imports, exception handling, Javadoc.
NOT when:
- Non-Java code.
- Generated sources, validate generator config instead.
Workflow
- Format & imports, use project settings. Google's 2-space/100-column and
import rules apply when adopted (
java-style-formatting-imports.md). - Naming, camelCase algorithm, constants discipline (
java-style-naming-types.md). - Practices,
@Override, catches, static qualify, null-safe equals (java-style-exceptions-practices.md). - Docs, Javadoc on public/protected API (
java-style-javadoc-public-api.md). - Verify, formatter + Checkstyle (project rules) on changed paths.
Red Flags
import foo.*- Empty catch without comment
mField/ Hungarian prefixes- Missing
@Overrideon interface impl instance.staticMethod()- Public API without Javadoc summary
Verification
- google-java-format / project formatter check
- Checkstyle or equivalent on changed modules
- Capsule checklist on public API review
References
awesome-guidelines/references/java-style-learning-note.mdawesome-guidelines/references/java-style-formatting-imports.mdawesome-guidelines/references/java-style-naming-types.mdawesome-guidelines/references/java-style-exceptions-practices.mdawesome-guidelines/references/java-style-javadoc-public-api.md