I have come across some code, where the developer is constantly checking if the singleton is null twice with a nested if - like in the code below:

private static processManager singleton = null;

...

public synchronized static processManager getInsatnce() throws Exception {

    if(singleton == null) {
      if(singleton == null){
             singleton = new processManager();
       }
     }
     return singleton
}

I cannot see any reason why this might be, but there are numerous instances in the code, so thought there might be a reason?

Edit
Report