POTD: ExceptionInInitializerError logger

It’s been a while I’ve done a project of the day, but here it is, the fruit of my yak-shaving today. The problem I was trying to solve today was java.lang.NoClassDefFoundError: Could not initialize class Xyz. When a Java class fails to initialize, the first attempt to do that causes ExceptionInInitializerError, but subsequent attempts to…

POTD: random but meaningful name generator

I’m working on the automated blackbox acceptance tests for Jenkins, where I often need to generate random unique names. The code has been using random number generator to generate such names, but as I was debugging test failures, it became painful to remember those random names. For example, a test might create two new jenkins…

POTD: Application configuration via Guice binding + Groovy

Often I write my applications with Guice. I also often want to make those applications configurable externally. For example I might inject username and password for that app to talk to another app, I might configure some timeout value, and so on. I make these configuration values available in Guice, so that I can access…

POTD: cucumber annotation indexer

Cucumber for Java requires that you specify the packages in which your step definitions exist. At runtime, cucumber uses some hack to try to list all the classes in this package (it’s a hack because class loaders never really support the listing operation), loads them one by one, and finds those that have step definition…

POTD: no more tears

In a modular Java program or in a large Java project that has lots of dependencies, you often end up a version of library that’s different from the version used to compile the code. This often results in LinkageError, where a method/field that was present when the code was compiled do not exist any more…

POTD: StopForumSpam API for Java

There’s an on-going spam problem in Jenkins wiki. We have capture, but either that was broken, or more likely, spamming is done manually. One of the suggestions was to integrate StopForumSpam service. To that end, I wrote a simple Java client library for their API. The usage would be something like this: for (Answer a…

POTD: submit a patch to Jenkins, and let him test it for you

Here’s my 2nd after-JavaOne “project of the day” Jenkins plugin. This has been in the back of my mind for quite some time, but it took this gentleman to grill me on this feature during JavaOne for me to finally put it together — so thank YOU for doing that. although I didn’t catch your…

POTD: iOS device connector plugin (cont’d)

Today, I wrapped up the project I started Friday and released iOS device connector plugin. In addition to listing all iOS devices, this plugin lets you deploy IPA files from anywhere (in Jenkins build via a build step or outside via CLI) to any of the connected iOS devices. There are still some loose-ends that…

POTD: iOS device detection in Jenkins

I was talking to my colleague Mark Prichard about mobile development with Jenkins, and I came up with this idea. If you are doing iOS app testing with real devices, you need to tether the device with a computer so that you can push the app-to-be-tested to the device. In a local development environment, you’d…

POTD: Confluence static cache generator plugin

I’m not sure about your Confluence, but my Confluence was dog slow. Page rendering regularly took a second or two, or even worse. That’s why I wrote this plugin. This Confluence plugin generates static HTML files out of your Wiki pages. It happens every time when someone updates a page, post a comment, add a…

POTD: Groovy Sandbox

I posted the other day about Groovy’s SecureASTCustomizer and how it is harmful. In the end of that post, I suggested that doing the check dynamically would work better. So in this installaition of “Project Of The Day”, I went ahead and implemented it. The result is Groovy sandbox. My main idea is to confine…

POTD: Package renamed ASM

Today’s project of the day is a package renamed ASM library. I previously wrote about a problem in otherwise quite useful ObjectWeb ASM library. Namely, it breaks backward compatibility in such a way that badly breaks apps/libraries that use them. In that post, I wrote about two proposals to fix the pain point. One is…