Date / SimpleDateFormatare mutable and not thread-safe.List.of(...).contains(null)throws NPE.Collections.unmodifiableListis only a view - changes to the original list still show through.Integer.parseInt(null)throwsNumberFormatExceptioninstead ofNullPointerException.Arrays.sort(a, null)silently falls back to natural order.
25 September 2026
Fuzzy contracts are eating away your developer skills.
19 January 2026
Java Proposal: The Glue Classes - Explicit, Modular Type Extension
This post was rewritten to be usable as a prompt !
Objects.requireNonNull(some);
final A a = some.getA();
Objects.requireNonNull(a, "explanation");
validate(a);
final B b = a.getB();
Objects.requireNonNull(b, "explanation");
b.process(param1);
Same code written using glue:
some..ensureNotNull()//
.getA()..ensureNotNull("explanation")..ensureValid()//
.getB()..ensureNotNull("explanation")//
..process(param1..ensureNotNull());
20 February 2010
Forwarding exceptions as language potential
Each of Java programmer knows how exhausting a handing exception can be. So sooner on later he/she founds the situation when he/she exactly knows that he/she is handling the exception that will never occur. Some thoughts about this can be found here.
14 February 2010
The '!' logical-complement operator (fixed)
It's high time to clear doubts about: The '!' logical-complement operator. With little help of someone who can express himself more clearly, subject should be easier to follow.
Some time ago I used to know all operators priorities in C++, using a minimal number of braces resulted with a quite compact code in logical cases. It was really easy to read that again, but only for me, what I did not see as a problem. When I started to work on the same code with others there were no turn back and I had to make conditions more readable...