
How to Use Conditional Breakpoints and Logpoints in Java
Stop only where it matters with conditional breakpoints, hit counts and logpoints that print values without pausing, and avoid their performance traps.
Tag
223 posts

Stop only where it matters with conditional breakpoints, hit counts and logpoints that print values without pausing, and avoid their performance traps.

Use Hibernate statistics and slow query logging to find costly queries: enable generate_statistics, read counters, set a threshold and expose metrics.

Generate a Java client or server interfaces from an OpenAPI spec with OpenAPI Generator in Maven and Gradle, and keep generated code out of git.

Use the Spring Boot conditions evaluation report and the Actuator conditions endpoint to find out why an auto configuration did or did not apply.

Shut down a Java ExecutorService properly with shutdown, awaitTermination and shutdownNow, handle interrupts, and avoid thread leaks in web apps and tests.

Write property based tests with jqwik: generators, shrinking, custom arbitraries for domain objects, round trip properties and seeds.

Size the Java heap in a container from measured numbers: live set after GC, non heap memory, the container limit and MaxRAMPercentage.

Write Quarkus tests with @QuarkusTest: how the application boots once per run, REST Assured, injecting beans, test profiles, resources and continuous testing.

Secure a JSF app with Jakarta Security: form authentication, an identity store, role rules in web.xml and EL, CSRF protection and session cookie settings.

Feed multi parameter tests in JUnit with MethodSource, CsvSource, CsvFileSource and ArgumentsSource, and choose the one that keeps test data readable.

Use Arthas to diagnose a running JVM without restarting it: attach, find hot threads, trace slow methods, watch arguments and decompile loaded classes safely.

Handle dates and time zones in Spring REST APIs: use Instant and ISO 8601, set Jackson and database zones, bind query dates and test across time zones.