Community
Participate
Working Groups
Build ID: I20080330-1350 In the following code snip I am often getting an error that WakesListenersWhenReady's final runnables field may be left uninitialized. Clearly the runnables field is initialized with a hashmap. If I modify anything(space etc.)and save the file the error goes away. However it shows up again - usually after a synchronize update. public static ObjectRunnableObject A = new ObjectRunnableObject() { public Object run(final Object name) { return new B() { private boolean isReady; private final HashSet generalListeners = new HashSet(); private final HashSet runnables = new HashSet(); .... }; } };
Could you please attach a complete test case ? Thanks. Also provide your compiler settings: compliance, source, target values.
I am using compliance 1.3 with default source etc. values. I am unable to create a test case, as I cannot reproduce it reliable.
Cannot reproduce on following with ECJ 3.2.2, 3.3.2 or 3.4M7: Need better steps to reproduce. ------------ import java.util.HashSet; public class X { public static ObjectRunnableObject A = new ObjectRunnableObject() { public Object run(final Object name) { return new B() { private boolean isReady; private final HashSet generalListeners = new HashSet(); private final HashSet runnables = new HashSet(); }; } }; } interface ObjectRunnableObject { Object run(Object o); } class B { }
Got this again in same file in two different branches after a team sync update. Is there a way I can dump internal status? I can properly leave one of them until someone find a clever way of debugging it. I also had the following in the tree which was my attempt to reproduce it, but no luck. package octotest.MiscTest; import java.util.HashSet; public interface EclipseFinalError extends I2 { public boolean getA(); public void addCs(Object arg); public static ObjectRunnableObject C1 = new ObjectRunnableObject() { public Object run(final Object o) { return new EclipseFinalError() { private boolean a; private final HashSet b = new HashSet(); private final HashSet c = new HashSet(); public final boolean getA() { return a; } public final Object getArg() { return o; } public void addCs(Object arg) { b.add(arg); c.add(arg); } }; } }; } interface ObjectRunnableObject { Object run(Object o); } interface I2 { public Object getArg(); }
It just hit another coworker after a cvs update with eclipse version Version: 3.2.1 Build id: M20060921-0945 Same file, place and error message. Strange it only complains about runnables, and not also generalListeners.
Cannot reproduce on testcase from comment 4, even with ECJ 3.2.0
Closing as WORKSFORME. See bug 251539 comment 25.