Thursday, August 19, 2010


Few things fixed in this release :

  • login with complicated characters in password

  • html email was not correctly indexed

This should fix opush problems as opush & minig IMAP lib are shared.

Thursday, August 12, 2010

Singleton for dummies

While searching for some coding practices, I realized some people are wondering how to do a singleton in Java (I know, this is considered an anti-pattern when badly used) :

public class Controller {

private static final Controller ctrl;

static {
ctrl = new Controller();

private Controller() {


public static Controller get() {
return ctrl;


That's the _only_ way to do it correctly in Java. Your static block is protected by the classloader lock, so everything is fine. This implementation _can_ bug, but that supposes you know how to subclass/implement a ClassLoader. In a webapp it's fine if you're wondering (well tomcat will leak your singleton memory if you abuse hot deploy).

I made this post as I'm reviewing some opush contributed code. What you can find on the net about java & singleton is quite fun. Nice article by someone who didn't know what are static blocks. Static blocks are "Java approved" since 2000.

Wednesday, August 04, 2010

Leaving my current job

I'll switch to another job in october. My work on MiniG & OPush will continue. I created those projects and I'm proud of them. is a working email to reach me.

I'll have some time to fix flawed things in MiniG with my next assignment ;-)