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 232524 Details for
Bug 405934
[1.8][dom ast] thrown Exceptions with Type Annotations should have malformed nodes for AST level less than 8
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]
Fix with test
Fix-for-Bug-405934.patch (text/plain), 2.73 KB, created by
Jay Arthanareeswaran
on 2013-06-19 03:43:04 EDT
(
hide
)
Description:
Fix with test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2013-06-19 03:43:04 EDT
Size:
2.73 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >diff --git src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java >index fdd9dbd..8f9b890 100644 >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java >@@ -48,4 +48,6 @@ > import org.eclipse.jdt.core.dom.NullLiteral; > import org.eclipse.jdt.core.dom.NumberLiteral; >+import org.eclipse.jdt.core.dom.QualifiedName; >+import org.eclipse.jdt.core.dom.SimpleName; > import org.eclipse.jdt.core.dom.SingleVariableDeclaration; > import org.eclipse.jdt.core.dom.SwitchStatement; >@@ -964,3 +966,26 @@ > assertEquals("Method should be malformed", ASTNode.MALFORMED, (method.getFlags() & ASTNode.MALFORMED)); > } >+ /** >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=405934 >+ * >+ * @deprecated as it uses deprecated methods >+ */ >+ public void test0022() throws JavaModelException { >+ String contents = >+ "public class X {\n" + >+ " void foo() throws @NonNull EOFException, java.io.@NonNull FileNotFoundException {}\n" + >+ "}\n"; >+ this.workingCopy = getWorkingCopy("/Converter17/src/X.java", false); >+ ASTNode node = buildAST(contents, this.workingCopy, false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ TypeDeclaration type = (TypeDeclaration) unit.types().get(0); >+ node = (ASTNode) type.bodyDeclarations().get(0); >+ assertEquals("Not a method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration method = (MethodDeclaration) node; >+ SimpleName exception1 = (SimpleName) method.thrownExceptions().get(0); >+ assertEquals("QualifiedName should be malformed", ASTNode.MALFORMED, (exception1.getFlags() & ASTNode.MALFORMED)); >+ QualifiedName exception2 = (QualifiedName) method.thrownExceptions().get(1); >+ assertEquals("QualifiedName should be malformed", ASTNode.MALFORMED, (exception2.getFlags() & ASTNode.MALFORMED)); >+ } > } >#P org.eclipse.jdt.core >diff --git dom/org/eclipse/jdt/core/dom/ASTConverter.java dom/org/eclipse/jdt/core/dom/ASTConverter.java >index 4177a79..79f9331 100644 >--- dom/org/eclipse/jdt/core/dom/ASTConverter.java >+++ dom/org/eclipse/jdt/core/dom/ASTConverter.java >@@ -501,5 +501,9 @@ > int i = 0; > do { >- thrownException = convert(thrownExceptions[i++]); >+ TypeReference typeRef = thrownExceptions[i++]; >+ thrownException = convert(typeRef); >+ if (typeRef.annotations != null && typeRef.annotations.length > 0) { >+ thrownException.setFlags(thrownException.getFlags() | ASTNode.MALFORMED); >+ } > internalThownExceptions(methodDecl).add(thrownException); > } while (i < thrownExceptionsLength);
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 405934
:
229840
| 232524