/** * Set the singleton instance of the class which will be stored statically * @param instance the instance to use as the singleton instance */ public static ConstructorUtils setInstance(ConstructorUtils newInstance) { ConstructorUtils instance = newInstance; if (instance == null) { instance = new ConstructorUtils(); instance.singleton = true; } ConstructorUtils.timesCreated++; instanceStorage = new SoftReference<ConstructorUtils>(instance); return instance; }
/** * Set the singleton instance of the class which will be stored statically * @param instance the instance to use as the singleton instance */ public static ConstructorUtils setInstance(ConstructorUtils newInstance) { ConstructorUtils instance = newInstance; if (instance == null) { instance = new ConstructorUtils(); instance.singleton = true; } ConstructorUtils.timesCreated++; instanceStorage = new SoftReference<ConstructorUtils>(instance); return instance; }