Articles
54 articles · page 6 of 6
2024
Pitfalls of Collectors#toMap
Explaining why Collectors#toMap throws on duplicate keys when converting a Stream to a Map, and how to avoid it with a merge function.
Bean Validation @Pattern Specification
Explaining why ^ and $ are unnecessary in the regexp of Bean Validation's @Pattern annotation, debunking a commonly copied wrong example.
The Trap of Stream#toList()
A detailed look at the difference between Stream#toList() and Collectors.toList() in Java 16, and the trap of its immutable result.
2023
Building a Blog with Astro
Trying Astro v3 for this blog and checking what changed since v1/v2, including relative-path image webp conversion and CJK line-break fixes.