The LinkedBlockingDeque has an interesting feature in addAll(), where they first build up the linked nodes and then add them all to the tail. However, a bug allowed us to overflow the size, resulting in a negative count. In this newsletter we look at this bug, and also how it was fixed in Java 26.| www.javaspecialists.eu
Instead of shuffling our stream at the end in the collect() method, we can also shuffle it in stages using the new stream gatherers. This allows us to shuffle sections at a time and even support infinite streams.| www.javaspecialists.eu
ReentrantReadWriteLock has a limit of 65536 concurrent read locks. That is an unattainable number with platform threads, but definitely achievable with virtual threads. In this newsletter we explore some of the issues if we want to switch to the StampedLock.asReadWriteLock() instead.| www.javaspecialists.eu