Java Best Practice Checker is a skill that performs automated static analysis of Java source code across versions SE 8 through SE 24. It is designed for developers and PR reviewers who need structured, context-rich feedback rather than bare lint warnings.
The skill audits code across several domains. For modern syntax, it identifies opportunities to adopt pattern matching (SE 21), unnamed variables (SE 22), and Stream Gatherers (SE 24). For performance, it flags String handling mistakes, wrapper class caching misuse, and JIT-unfriendly patterns. It performs deep analysis of the Collections Framework including the SequencedCollection API introduced in recent Java releases. On the architectural side, it checks dependency injection correctness, OOP encapsulation violations, and Design Pattern implementations. At the JVM level, it looks for garbage collection anti-patterns, memory leaks, and improper resource management. Concurrency hazards covered include thread-safety bugs in Singletons and String Pool bypasses.
Output is a structured report with severity-coded findings using three levels (critical, warning, informational), root-cause analysis for each issue, and side-by-side before/after code blocks. Reports conclude with a Summary Table intended for quick triage by lead developers or PR reviewers. The skill is particularly useful when modernizing legacy codebases toward Java 21+ idioms such as Record Patterns and Virtual Threads.