I found a javac bug

JDK-8178701: Compile error with switch statement on protected enum defined in parent inner class

I discovered this bug when I wrote some code that compiled in Eclipse, committed it, and then got an email a few minutes later from our Jenkins continuous integration server saying that the build failed. From the error message, I managed to track it down to a specific section of code that compiled in Eclipse but gave a compile error in javac.

This isn’t the first time I’ve ran into a Java compiler or standard library bug while developing CertSAFE, nor is it the first time that I’ve submitted a bug report via the Oracle web form. However, it is the first time that I’ve had a report accepted and published as a verified OpenJDK bug.

I’m always happy when I find a compiler bug, because it makes me feel better about bugs in my code to know that the platform developers screw up too.

Google Guava makes Java… usable

Hello World! I’m planning to use this blog to collect the various discoveries I make about software development in my day-to-day job as a software engineer at CERTON, Inc. The perhaps-vain hope is that I will help some other poor soul who stumbles across my posts and finds the solution to the exact problem they were encountering at that instant. I’ll also probably post mathematical curiosities and software engineering commentary. The ultimate goal is to keep the quality level high enough that I feel less guilty of time-wasting writing here than if I were participating in the standard social grooming networks.

But, of course, you’re not here for me, you’re here for you. So let’s talk about Google Guava. For the unfamiliar, Guava is a collection of utilities for performing common tasks in Java, similar in spirit to Apache Commons or C++’s Boost. I was introduced to Guava by a fellow CERTON developer for the purpose of performing some set operations more easily in the selection logic in CertSAFE Modeler. Since then, the use of Guava in our codebase has expanded greatly, making it far and away the library we get the most use out of.

Even if you’re already using Guava, there’s most likely parts of it that you’re not using currently only because you don’t know they exist. I know I find myself saying “Wow! I didn’t know Guava had that!” on a regular basis. Here’s a quick list of the most common uses of Guava in the code I write. Undoubtedly there’s things I haven’t listed here because I haven’t discovered them yet—and you might just find something in this list that you wish you had known about a year ago.
Continue reading Google Guava makes Java… usable