Skip to main content

Java

2025


Handling ExecutionException - tips for Writing Robust Concurrent Code

2 mins
Handling an ExecutionException in Java requires understanding its root cause and applying the right strategy to ensure smooth execution in concurrent environments. Practical solutions include unwrapping the exception with getCause() and implementing structured error handling.

Speeding up JAXB with caching and pooling - with benchmarks

8 mins
Caching JAXB instances can significantly improve performance in Java applications. It reduces the overhead of creating new instances and allows for better resource management. See benchmarks comparing caching vs. non-caching approaches.

2024


Understanding Java Enum Constructors: Beyond Basic Constants

4 mins
Java enums are more than just simple constants. By using constructors in enums, they can eliminate the need for cumbersome if-then statements, and attach meaningful attributes to each constant, making the code more maintainable and expressive.

Use Java Optionals For Safer, Cleaner and Functional Code

6 mins
In Java, handling null values can lead to messy code and potential NullPointerExceptions. With the introduction of Optionals in Java 8, you can write safer, cleaner, and more functional code by effectively managing the absence of values.

Java TLS versions

3 mins
In Java, the default (highest) TLS version negotiated by the JDK depends on the version of Java you are using. To ensure that security in your connections is up to date, it is recommended to use the latest version of TLS whenever possible.

Groupby in Java Streams

5 mins
The Collectors.groupingBy method in Java Streams allows you to group elements in a stream by a specific property. This is similar to the `GROUP BY` clause in SQL.