Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 104191 Details for
Bug 235882
[compiler] constructor-scoped inner classes unable to recognize final member variable initialization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
235882.txt (text/plain), 2.49 KB, created by
Philipe Mulet
on 2008-06-09 13:02:57 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2008-06-09 13:02:57 EDT
Size:
2.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >#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.114 >diff -u -r1.114 InitializationTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 5 Jun 2008 09:53:26 -0000 1.114 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 9 Jun 2008 17:02:35 -0000 >@@ -5516,6 +5516,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; > } >#P org.eclipse.jdt.core >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.112 >diff -u -r1.112 BlockScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 27 May 2008 22:21:12 -0000 1.112 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 9 Jun 2008 17:02:33 -0000 >@@ -841,9 +841,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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235882
: 104191 |
104293