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 65637 Details for
Bug 84886
[compiler] compiled code wrong with ambiguous inner classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 2.32 KB, created by
Kent Johnson
on 2007-05-02 12:59:28 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2007-05-02 12:59:28 EDT
Size:
2.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v >retrieving revision 1.146 >diff -u -r1.146 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 10 Apr 2007 19:03:10 -0000 1.146 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 2 May 2007 16:59:42 -0000 >@@ -307,6 +307,10 @@ > char[][] className = CharOperation.deepCopy(enclosingType.compoundName); > className[className.length - 1] = > CharOperation.concat(className[className.length - 1], referenceContext.name, '$'); >+ ReferenceBinding existingType = packageBinding.getType0(className[className.length - 1]); >+ if (existingType != null) >+ // report the error against the parent - its still safe to answer the member type >+ this.parent.problemReporter().duplicateNestedType(referenceContext); > referenceContext.binding = new MemberTypeBinding(className, this, enclosingType); > } > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java,v >retrieving revision 1.7 >diff -u -r1.7 CollisionCase.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java 29 Mar 2006 03:50:22 -0000 1.7 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java 2 May 2007 16:59:43 -0000 >@@ -66,4 +66,23 @@ > "foo.bar cannot be resolved to a type\n" + > "----------\n"); > } >+// http://bugs.eclipse.org/bugs/show_bug.cgi?id=84886 >+public void test003() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "class X {\n" + >+ " class MyFoo {\n" + >+ " class Bar {}\n" + >+ " }\n" + >+ " static class MyFoo$Bar {}\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " static class MyFoo$Bar {}\n" + >+ " ^^^^^^^^^\n" + >+ "Duplicate nested type MyFoo$Bar\n" + >+ "----------\n"); >+} > }
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 84886
: 65637