Running on Java 26-ea+20-2057 (Preview)
Home of The JavaSpecialists' Newsletter

330Looking Back on 25 Years

Author: Dr Heinz M. KabutzDate: 2025-11-30Java Version: 25Sources on GitHubCategory: Inspirational
 

Abstract: Today marks our 25th newsletter anniversary, when I sent out an email to 80 colleagues and friends. To celebrate, we are looking at some of the most popular newsletters over the years. Thanks for being part of this adventure.

 

A hearty welcome to our 330th edition of The Java(tm) Specialists' Newsletter. As I was preparing to write this newsletter, a whole bunch of topics were going through my head. I could write about the cool new imports with import module java.base or the latest JDK bug that I discovered whilst teaching our Extreme Java - Concurrency Performance Course this month. I have a bunch of other topics ready for publication. And then I realized. Today is the exact day when I began my newsletter writing spree, 25 years ago. To my knowlege, The Java(tm) Specialists' Newsletter is the longest Java newsletter on planet Earth (but not sure about the entire galaxy). The second longest is from Jack Shirazi, who started three weeks after me. Both of our newsletters are about writing good, fast, performant, professional Java code. And this sticks.

Thus I cannot just write a normal Java newsletter, about the latest Java syntax gimmic or performance improvement. Instead, we are going to do a fun retrospective of what the most popular newsletters were, and a few stories of how it all began.

Black Friday 2025: We are running our promotion until my birthday on the 4th of December. Be sure to check it out, especially our live concurrency courses in two weeks time and our Java Specialists Superpack.

javaspecialists.teachable.com: Please visit our new self-study course catalog to see how you can upskill your Java knowledge.

Looking Back on 25 Years

Our son was born in June 1998 and usually our brain only remembers things from about three years of age. This means that for his entire living memory, his dad was sending out The Java(tm) Specialists' Newsletter. It started with about 80 friends and colleagues, some of which are still on the list. The first newsletter I sent filled me with trepidation and fear. "What if my colleagues laughed at me?" And this they did. It did not take long for them to be mocking me behind my back, and sending out emails to each other in my tone. And yet I continued, for 25 years... It was always a hobby, and I've enjoyed the thrill of sending them out.

I still remember after the first newsletter, I did not even want to open my email to read the responses. Most of the comments were positive. But one almost stopped me from continuing. It read: "Unfortunately, I'm not interested in your newsletter, because Java is not the world I live in." This message should not have affected me at all, but it did. It was a perfectly neutral response that didn't judge my newsletter as being worthless. It just wasn't for her. I find sending out newsletters terrifying, far more so than public speaking.

Thus I want to thank you for your support over the last 25 years and holding me up. I could not have done it without you.

As a celebration, I went through several years of logs to see which newsletters the most popular were. Here they are by category - enjoy:

GUI

At the beginning of my Java career, we coded a fair amount of Swing code. One of the tricks was to create an applet that provided remote access to an ERP system. Even though we never quite got that project working to our satisfaction, it allowed my client to negotiate better conditions for a remote access client. We had to figure out a lot of workarounds for Swing, and hence the newsletters:

  • java.awt.EventQueue - this was a really fun newsletter, where we added our own EventQueue instance, in order to be able to intercept and manage all GUI events.
  • Writing Own GUI Layout Manager - each time we had to create a dialog, it involved mental gymnastics to convert the design into a mesh of AWT Layout Managers. One of my colleagues was battling like crazy to do something that seemed quite simple. I wrote a layout manager for him and that was surprisingly easy to do.
  • Placing Components on Each Other - the ERP system that we were trying to mock had multi-line buttons. At the time, Java did not allow HTML content on Swing components. And so we came up with the genius idea of creating a JButton that has several JLabels in a GridLayout.
  • TristateCheckBox Revisited - at some point, I needed a checkbox with an indeterminate state, neither selected nor unselected. We often see such checkboxes in GUIs. However, I also wanted it to work for the variety of Swing Look and Feels. I noticed that when we pressed the checkbox, it would change into what looked like an in-between state, before actually changing state. I then used that to create the TristateCheckBox. I wish it were not so, but this is one of my most widely used newsletter, and it went through some revisions even.
  • Remote Screenshots - a way to view screens remotely and also control them, all done with Java. I wrote it when I was in Regina in Saskatchewan, Canada. It was a real experience going there and a very long trip from Crete. I remember getting in the rental car and promptly going through a red traffic light, that's how tired I was. Who knows if I will ever get back to Regina, or Canada for that matter? A "Remote Screenshot" newsletter is appropriate for Canada, where it takes 4 days to fly across the country in a helicopter.

Performance

In the early versions of Java, we were running on Pentium II 266 MHz machines, with a single core, and with 64MB of RAM. And those were the good PCs. At the time, Java was always running interpreted, which made things much much slower. We developed a whole swathe of techniques to make our code run fast enough. Over time, many of those tricks were incorporated into the JVM itself, making our hacking less necessary. Here are some performance oriented newsletters that have stood the test of time:

  • Determining Memory Usage in Java - when I started writing about memory usage in Java, there was very little public information available. We did not have amazing tools like Java Object Layout (JOL). I figured out the memory usage through experimentation and lots of calls to System.gc(). One of the strangest discoveries is how wasteful Java was prior to Java 1.4. Every field used at least 4 bytes, even a boolean. I had wasted brain waves on determining which fields could be shorts and which would even fit into a byte, and they had all cost exactly 4 bytes. This knowledge of how much memory is used by objects in Java has served me very well over the years. Things have of course changed since then, and now we even have compact object headers. But at the time of writing in 2001, not many Java programmers knew this.
  • Instrumentation Memory Counter - we refined our memory counter with agents in 2007 to get more accurate measurements.
  • ByteWatcher from JCrete - and then in 2015, some friends and I wrote the ByteWatcher, which used the getThreadAllocatedBytes method from the ThreadMXBean to accurately estimate the number of bytes allocated by a single thread. I have used this class over and over in hundreds of courses and demos.
  • Java Memory Puzzle - have a look at our puzzle from 2009. It still works, but be sure to set a max heap of 2GB with -Xmx2g. Can you figure out why the polite version works? We need to set the max heap, because the JVM will use 1/4 of our physical RAM as the maximum heap, and on modern machines, that would often exceed the maximum size for an array.
  • Checking HashMaps with MapClashInspector - ConcurrentHashMap changed substantially in Java 8, with the result that whenever we implement hashCode(), besides equals(), we should also make our compound keys implement Comparable. This way, if there are a lot of clashes, they can arrange our entries in a binary tree, instead of a linked list of nodes.

Language

Earlier versions of Java were clunky at best. We did not have generics, no autoboxing, old-fashioned switch statements with fall-through cases. It gave me endless fodder for The Java(tm) Specialists' Newsletter. A lot of these issues have been fixed in later versions of Java. Here are some newsletters to do with the Java Programming Language.

  • BASIC Java - this was a lighthearted newsletter, where we used a loop with labelled switch to emulate a bubble sort algorithm written in BASIC. It wasn't an April's Fool newsletter, but may well have been.
  • Strategy Pattern with Generics - we wanted to have strategy objects for very specific subclasses and used generics to enforce this. Quite a mind bender.
  • Annotation Processing Tool - one of my readers sent me the question: "How do we force all subclasses to contain a public no-args constructor?" There is no simple language trick, but we can add an annotation and check this at compile time.

Concurrency

Concurrency and parallelism have always felt natural to me, and so it is no surprise that my very first newsletter was about finding and solving Java deadlocks.

  • Deadlock Detection with New Locks - we can use the ThreadMXBean to check for deadlocks in unit tests.
  • The Secrets of Concurrency (Part 1) et al - we published 11 laws entitled "The Secrets of Concurrency" that have even made it into university curricular (not my intent!). They all have colourful names, such as "The Law of the Leaked Memo" and "The Law of the Corrupt Politician".
  • Throwing ConcurrentModificationException Early - the ConcurrentModificationException is notoriously hard to weed out of our code base. One thread merrily walks through a collection, whilst another thread changes it. The walker sees the exception, caused by a side effect of an external change. However, these exceptions might also manifest differently, for example as a NullPointerException. We thus have to get rid of them wherever they occur. Here we see a technique we can use to throw the exception on modification, rather than iteration.
  • Interlocker - Interleaving Threads - a newsletter with little to no practical application, we actually discovered a bug in the JVM that caused an "unbreakable hard spin" in Java 6.
  • Automatically Unlocking with Java 7 - why are ReentrantLock not AutoCloseable? They should be, but it is easy enough to write a wrapper ourselves. Maybe one day they will change it?
  • Fork Join with Fibonacci and Karatsuba - here I was playing around with the Fork Join Framework in Java 7, and using it to calculate Fibonacci(1 billion). Part of this work made it into a Java book on performance.
  • Striped Executor Service - I have several times met people who were using my striped executor service, or a derivate thereof, in production. The idea is that we allow certain workflows to be executed sequentially, even within a thread pool, but not necessarily on the same executor thread.
  • Contributing BigInteger.parallelMultiply() to OpenJDK - after speaking at several conferences about my adventure with Fibonacci, and parallelizing BitInteger#multipy(), I managed to add the parallelMultiply() method to the JDK.

Tips and Tricks

There are also lots of fun tips and tricks in my newsletter, here for example are to approaches with reflection that might help for testing systems.

  • Cleaning ThreadLocals - when a thread dies, all its ThreadLocal values are removed. But what if the thread lives in a thread pool for the duration of the program? In that case, it might accumulate a lot of ThreadLocals and thus cause a memory leak. We explored how to remove them once we are done with our task.
  • Hacking Enums Revisited - Java enums are supposed to be immutable, but then how can we write unit tests to check whether our code handles new enum values correctly? In this newsletter, we look at how we can create new enum values dynamically using reflection, even changing the switch statements.

Again, thank you for being part of this community and for also supporting my JavaSpecialists by purchasing courses and giving me truly fascinating consulting opportunities.

Kind regards

Heinz

P.S. Be sure to check out our Black Friday specials for 2025, which run until my birthday on the 4th of December.

 

Comments

We are always happy to receive comments from our readers. Feel free to send me a comment via email or discuss the newsletter in our JavaSpecialists Slack Channel (Get an invite here)

When you load these comments, you'll be connected to Disqus. Privacy Statement.

Related Articles

Browse the Newsletter Archive

About the Author

Heinz Kabutz Java Conference Speaker

Java Champion, author of the Javaspecialists Newsletter, conference speaking regular... About Heinz

Superpack

Java Specialists Superpack Our entire Java Specialists Training in one huge bundle more...

Free Java Book

Dynamic Proxies in Java Book
Java Training

We deliver relevant courses, by top Java developers to produce more resourceful and efficient programmers within their organisations.

Java Consulting

We can help make your Java application run faster and trouble-shoot concurrency and performance bugs...