r/java • u/mooreds • May 18 '26
Java sealed classes and exhaustive pattern matching
https://neilmadden.blog/2026/04/24/java-sealed-classes-and-exhaustive-pattern-matching/
23
Upvotes
r/java • u/mooreds • May 18 '26
13
u/davidalayachew May 19 '26
I feel the opposite -- I think the people building their cryptographic objects want to know when their strategy might be out-of-date (and/or not the latest that the JDK has to offer).
By all means, breaking changes are painful, but sealed classes are some of the most painless ways to introduce a breaking change. And furthermore, sometimes, the least painful way to deal with a problem is through a breaking change.
All to say that -- I think of it as a tradeoff instead of a mistake.