« first day (637 days earlier)      last day (256 days later) » 

8:07 AM
0
Q: JMockit: Singleton class, Order of test

borrasI have a Singleton class to test: public class Singleton { private static Singleton instance; private List<String> list; private Singleton() { } public static Singleton getInstance() { if (instance == null) { synchronized (Singleton.class) { ...

 
 
11 hours later…
7:19 PM
0
Q: Is this singleton pattern thread safe?

Olavi MustanojaI have a singleton server instance and I'm curious whether my code is thread safe. I've read about different singleton patterns, and I think the way to go generally is the double-checked locking pattern, which goes as follows: public static Singleton getInstance() { if(singleton == null) { ...

 

« first day (637 days earlier)      last day (256 days later) »