java-code-review

Reviews Java code for null safety, exceptions, concurrency, and performance issues.

Updated Apr 20, 2020
One-click install
npx skills add https://github.com/UnterrainerInformatik/java-rdb-utils --skill java-code-review-unterrainerinformatik
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: java-code-review
Source: https://github.com/UnterrainerInformatik/java-rdb-utils/tree/main/.agents/skills/java-code-review
Command: npx skills add https://github.com/UnterrainerInformatik/java-rdb-utils --skill java-code-review-unterrainerinformatik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manual Java code reviews are inconsistent and often miss subtle defects like swallowed exceptions, race conditions, or N+1 query patterns. This Skill applies a systematic checklist so every review covers the same critical categories and produces findings grouped by severity. ## Core Features & Use Cases - Nine-Category Checklist: Covers null safety, exception handling, collections and streams, concurrency, Java idioms, resource management, API design, performance, and testing hints. - Severity-Ranked Output: Returns findings grouped as Critical, Improvements, Minor/Style, plus a positive-feedback section, each with line references and concrete fix suggestions. - Use Case: Before merging a pull request, ask for a review of the changed files and receive a structured report flagging issues like empty catch blocks, check-then-act race conditions, or string concatenation in loops. ## Quick Start Ask the assistant to review the changes in a specific Java file or pull request using the java-code-review checklist.

Frequently Asked Questions about java-code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Java code for common bugs before merging a PR?▼

Run a structured checklist review covering null safety, exception handling, concurrency, and performance. The Skill scans the changed code and returns findings grouped by severity with line references and suggested fixes.

What should a Java code review checklist include?▼

A thorough checklist covers null safety and Optional usage, swallowed or overly broad exceptions, collection modification during iteration, thread safety and race conditions, equals/hashCode contracts, try-with-resources, API design, and performance pitfalls like N+1 queries.

How do I detect race conditions in Java code?▼

Look for shared mutable state without synchronization, check-then-act patterns like containsKey followed by put, and missing volatile on shared fields. Replace them with ConcurrentHashMap, computeIfAbsent, or java.util.concurrent utilities.

Can this review large Java codebases at once?▼

It works best on focused changes such as a single class or pull request diff rather than entire repositories. Narrowing scope keeps findings specific and avoids repeating obvious issues across files.

Why does string concatenation in loops hurt Java performance?▼

Each += creates a new String object, causing O(n²) copying in loops. Use StringBuilder for repeated appends, pre-compile regex patterns outside loops, and batch database queries to avoid N+1 patterns.