Track
Java
Review null boundaries, immutability, value objects, exceptions, resources, generics, streams, concurrency, records, and service boundaries.
- 01
Null handling and Optional boundaries
Make absence explicit at method boundaries with Optional or exceptions, instead of returning null from finder code.
nulloptionalboundaries - 02
Immutable data and defensive copies
Protect domain snapshots from outside mutation by copying collections and exposing immutable views.
immutabilitycollectionsdefensive-copies - 03
equals, hashCode, and value objects
Use small value objects or records for identity values so equality, hashing, and validation stay together.
value-objectsequalshashcode - 04
Exception handling boundaries
Throw domain-specific exceptions inside the application and translate them at the outer boundary.
exceptionsboundarieserrors - 05
try-with-resources cleanup
Use try-with-resources for files, connections, statements, and result sets so cleanup happens on success and failure.
resourcescleanupjdbc - 06
Generics and collection types
Keep collection element types precise so casts, raw types, and runtime class errors do not leak through the codebase.
genericscollectionstypes - 07
Streams vs readable loops
Use streams for clear transformations and loops when branching, validation, or naming intermediate steps makes the review easier.
streamsloopsreadability - 08
Concurrency and shared state
Use concurrent primitives for shared state so check-then-act races do not appear under load.
concurrencyshared-statethread-safety - 09
Records and DTO boundaries
Use records or explicit DTOs for request and response shapes instead of untyped maps that push errors deeper into the application.
recordsdtoapi-boundaries - 10
Package and service boundaries
Keep controllers, services, repositories, and packages focused so each layer owns one kind of decision.
architecturepackagesservices