The Open-Closed Principle is Often Not What You Think it Is

jOOQ is a library that loves making everything internal final and package private. We have tons of classes like these: final class Concat extends AbstractFunction<String> { // ... } The class implements the semantics of SQL string concatenation. Clearly, you shouldn't need to tamper with it (or even know about it), because it is "protected" … Continue reading The Open-Closed Principle is Often Not What You Think it Is

This is the Final Discussion!

Pun intended... Let's discuss Java final. Recently, our popular blog post "10 Subtle Best Practices when Coding Java" had a significant revival and a new set of comments as it was summarised and linked from JavaWorld. In particular, the JavaWorld editors challenged our opinion about the Java keyword "final": More controversially, Eder takes on the … Continue reading This is the Final Discussion!

A dirt-ugly hack to modify private final fields in Java

We all use reflection from time to time. We may even tamper with visibility through Java's Field.setAccessible() and similar methods. But this post here takes things to the extreme and shows how to modify private (static) final fields in Java. Think twice, when choosing this tool ;-) http://zarnekow.blogspot.ch/2013/01/java-hacks-changing-final-fields.html

Wikileaks To Leak 5000 Open Source Java Projects With All That Private/Final Bullshit Removed

Hilarious. Not even written on April 1! Taken from here: http://steve-yegge.blogspot.ch/2010/07/wikileaks-to-leak-5000-open-source-java.html EYJAFJÖLL, ICELAND — Java programmers around the globe are in a panic today over a Wikileaks press release issued at 8:15am GMT. Wikileaks announced that they will re-release the source code for thousands of Open Source Java projects, making all access modifiers 'public' and … Continue reading Wikileaks To Leak 5000 Open Source Java Projects With All That Private/Final Bullshit Removed