### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: buildnotes_jdt-core.html
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v
retrieving revision 1.5933.2.96
diff -u -r1.5933.2.96 buildnotes_jdt-core.html
--- buildnotes_jdt-core.html 5 Jun 2008 13:37:40 -0000 1.5933.2.96
+++ buildnotes_jdt-core.html 10 Jun 2008 09:09:21 -0000
@@ -55,7 +55,9 @@
What's new in this drop
Problem Reports Fixed
-235778
+235882
+[compiler] constructor-scoped inner classes unable to recognize final member variable initialization
+
235778
Potential race condition computing resolved classpath
227941
org.eclipse.jdt.internal.compiler.batch.Main writes bad characters to an xml log file
Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java,v
retrieving revision 1.106.2.1
diff -u -r1.106.2.1 BlockScope.java
--- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 10 Oct 2007 08:20:15 -0000 1.106.2.1
+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 10 Jun 2008 09:09:21 -0000
@@ -839,9 +839,13 @@
&& !((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod()) { // inside constructor or clinit
return false; // found some non-initializer context
}
- if (fieldDeclaringClass == methodScope.enclosingReceiverType()) {
+ ReferenceBinding enclosingType = methodScope.enclosingReceiverType();
+ if (enclosingType == fieldDeclaringClass) {
return true; // found the field context, no need to check any further
}
+ if (!enclosingType.erasure().isAnonymousType()) {
+ return false; // only check inside anonymous type
+ }
methodScope = methodScope.enclosingMethodScope();
}
return false;
#P org.eclipse.jdt.core.tests
Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java
===================================================================
RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java,v
retrieving revision 1.106.2.1
diff -u -r1.106.2.1 InitializationTest.java
--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 10 Oct 2007 08:20:02 -0000 1.106.2.1
+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 10 Jun 2008 09:09:27 -0000
@@ -5621,7 +5621,25 @@
"The final field X.mObj cannot be assigned\n" +
"----------\n");
}
-
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=235882
+public void test194() {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " final Object o;\n" +
+ " X() {\n" +
+ " class C {\n" +
+ " C() {\n" +
+ " o.toString();\n" +
+ " }\n" +
+ " }\n" +
+ " o = \"\";\n" +
+ " }\n" +
+ "}\n"
+ },
+ "");
+}
public static Class testClass() {
return InitializationTest.class;
}