Author: doogie
Date: Fri Jun 24 18:16:55 2011
New Revision: 1139396
URL:
http://svn.apache.org/viewvc?rev=1139396&view=revLog:
Fix broken 1078215, the object instance variable was removed, because
dumb smart code editors thought it was unused. Please understand the
code you change.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java?rev=1139396&r1=1139395&r2=1139396&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java Fri Jun 24 18:16:55 2011
@@ -82,6 +82,8 @@ public abstract class TTLObject<T> imple
}
public enum State { INVALID, REGEN, REGENERATING, GENERATE, GENERATING, GENERATING_INITIAL, VALID, ERROR, ERROR_INITIAL, SET }
+ // DO NOT REMOVE THIS VARIABLE: to dumb smart editors it looks unused; it's actually only referenced thru the field updater.
+ private volatile ValueAndState<T> object = new StandardValueAndState<T>(this, null, null, State.INVALID, 0, null, null);
@SuppressWarnings("unchecked")
private static final AtomicReferenceFieldUpdater<TTLObject<?>, ValueAndState> objectAccessor = UtilGenerics.cast(AtomicReferenceFieldUpdater.newUpdater(TTLObject.class, ValueAndState.class, "object"));
private static final AtomicIntegerFieldUpdater<TTLObject<?>> serialAccessor = UtilGenerics.cast(AtomicIntegerFieldUpdater.newUpdater(TTLObject.class, "serial"));