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 226437 Details for
Bug 399600
ASTConverter#retrieveEndOfRightParenthesisPosition fails for certain cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch with test
Fix-for-bug-399600.patch (text/plain), 2.49 KB, created by
Jay Arthanareeswaran
on 2013-02-01 01:19:45 EST
(
hide
)
Description:
Patch with test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2013-02-01 01:19:45 EST
Size:
2.49 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java >index 5ff7205..addb847 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java >@@ -1070,4 +1070,26 @@ > method = methods[2]; > assertExtraDimensionsEqual("Incorrect dimension info", method.getExtraDimensionInfos(), "@Annot1 @Annot2 [] []"); > } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=399600 >+ public void test0010() throws JavaModelException { >+ String contents = >+ "import java.lang.annotation.ElementType;\n" + >+ "public class X {\n" + >+ " @Marker int foo(@Marker(\"Blah\") int z) @Marker [] @Marker [] {\n" + >+ " return null;\n" + >+ " }\n" + >+ "}\n" + >+ "@java.lang.annotation.Target (ElementType.TYPE_USE)\n" + >+ "@interface Marker {\n" + >+ " String value() default \"Blah\";\n" + >+ "}"; >+ this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true); >+ ASTNode node = buildAST(contents, this.workingCopy); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration method = (MethodDeclaration) node; >+ assertExtraDimensionsEqual("Incorrect dimension info", method.getExtraDimensionInfos(), "@Marker [] @Marker []"); >+ } > } >diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java >index 8a1ac31..790aec7 100644 >--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java >+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java >@@ -4398,10 +4398,18 @@ > this.scanner.resetTo(start, end); > try { > int token; >+ int count = 0; > while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { > switch(token) { > case TerminalTokens.TokenNameRPAREN: >- return this.scanner.currentPosition; >+ count--; >+ if (count <= 0) return this.scanner.currentPosition; >+ break; >+ case TerminalTokens.TokenNameLPAREN: >+ count++; >+ //$FALL-THROUGH$ >+ default: >+ break; > } > } > } catch(InvalidInputException e) {
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 399600
: 226437