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 162515 Details for
Bug 306477
Indexer(?) fails to recognise enum as a type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 3.93 KB, created by
Frederic Fusier
on 2010-03-19 08:43:21 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-03-19 08:43:21 EDT
Size:
3.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.416 >diff -u -r1.416 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 23 Feb 2010 14:48:27 -0000 1.416 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 19 Mar 2010 12:42:18 -0000 >@@ -3272,13 +3272,6 @@ > enumConstant.modifiers = this.intStack[this.intPtr--]; > enumConstant.declarationSourceStart = enumConstant.modifiersSourceStart; > >- // Store secondary info >- if ((enumConstant.bits & ASTNode.IsMemberType) == 0 && (enumConstant.bits & ASTNode.IsLocalType) == 0) { >- if (this.compilationUnit != null && !CharOperation.equals(enumConstant.name, this.compilationUnit.getMainTypeName())) { >- enumConstant.bits |= ASTNode.IsSecondaryType; >- } >- } >- > // consume annotations > int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >@@ -3408,6 +3401,14 @@ > if (enumDeclaration.modifiersSourceStart >= 0) { > enumDeclaration.declarationSourceStart = enumDeclaration.modifiersSourceStart; > } >+ >+ // Store secondary info >+ if ((enumDeclaration.bits & ASTNode.IsMemberType) == 0 && (enumDeclaration.bits & ASTNode.IsLocalType) == 0) { >+ if (this.compilationUnit != null && !CharOperation.equals(enumDeclaration.name, this.compilationUnit.getMainTypeName())) { >+ enumDeclaration.bits |= ASTNode.IsSecondaryType; >+ } >+ } >+ > // consume annotations > int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >@@ -3487,6 +3488,14 @@ > if (enumDeclaration.modifiersSourceStart >= 0) { > enumDeclaration.declarationSourceStart = enumDeclaration.modifiersSourceStart; > } >+ >+ // Store secondary info >+ if ((enumDeclaration.bits & ASTNode.IsMemberType) == 0 && (enumDeclaration.bits & ASTNode.IsLocalType) == 0) { >+ if (this.compilationUnit != null && !CharOperation.equals(enumDeclaration.name, this.compilationUnit.getMainTypeName())) { >+ enumDeclaration.bits |= ASTNode.IsSecondaryType; >+ } >+ } >+ > // consume annotations > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { > System.arraycopy( >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClassNameTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassNameTests.java,v >retrieving revision 1.19 >diff -u -r1.19 ClassNameTests.java >--- src/org/eclipse/jdt/core/tests/model/ClassNameTests.java 15 Feb 2010 20:20:44 -0000 1.19 >+++ src/org/eclipse/jdt/core/tests/model/ClassNameTests.java 19 Mar 2010 12:42:21 -0000 >@@ -1289,4 +1289,40 @@ > deleteProject("P"); > } > } >+ >+/** >+ * @bug 306477: Indexer(?) fails to recognise enum as a type >+ * @test Ensure that enum secondary type are well indexed >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=306477" >+ */ >+public void testBug306477() throws Exception { >+ try { >+ // create test case >+ IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ createFolder("/P/p"); >+ createFile( >+ "/P/p/Alice.java", >+ "package p;\n" + >+ "class Alice {\n" + >+ " Object j = Bob.CHARLIE;\n" + >+ "}\n" >+ ); >+ createFile( >+ "/P/p/Misc.java", >+ "package p;\n" + >+ "enum Bob {\n" + >+ " CHARLIE;\n" + >+ "}\n" >+ ); >+ >+ // find secondary enum >+ IType type = project.findType("p.Bob", new NullProgressMonitor()); >+ assertElementEquals("We should have found the secondary enum 'Bob'!", >+ "Bob [in Misc.java [in p [in <project root> [in P]]]]", >+ type >+ ); >+ } finally { >+ deleteProject("P"); >+ } >+} > }
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 306477
:
162494
|
162495
| 162515