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 207043 Details for
Bug 363858
[dom] early throwing of AbortCompilation causes NPE in CompilationUnitResolver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
test
tmp.patch (text/plain), 3.16 KB, created by
Stephan Herrmann
on 2011-11-15 13:55:31 EST
(
hide
)
Description:
test
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-11-15 13:55:31 EST
Size:
3.16 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java >index 87812d2..ee592e5 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java >@@ -22,8 +22,13 @@ import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.FileLocator; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.jdt.core.ICompilationUnit; > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.JavaCore; >+import org.eclipse.jdt.core.compiler.IProblem; >+import org.eclipse.jdt.core.dom.AST; >+import org.eclipse.jdt.core.dom.ASTParser; >+import org.eclipse.jdt.core.dom.CompilationUnit; > > public class NullAnnotationModelTests extends ReconcilerTests { > >@@ -222,4 +227,58 @@ public class NullAnnotationModelTests extends ReconcilerTests { > // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=302850#c25 > } > } >+ >+ public void testMissingAnnotation3() throws CoreException { >+ try { >+ // Resources creation >+ IJavaProject p = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB", this.ANNOTATION_LIB}, "bin", "1.5"); >+ p.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED); >+ p.setOption(JavaCore.COMPILER_NONNULL_ANNOTATION_NAME, "invalid"); >+ >+ this.createFolder("/P/p1"); >+ String c1SourceString = >+ "package p1;\n" + >+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" + >+ "public class C1 {\n" + >+ " public String foo(Object arg) {\n" + >+ " return arg == null ? \"\" : arg.toString();\n" + >+ " }\n" + >+ "}\n"; >+ this.createFile( >+ "/P/p1/C1.java", >+ c1SourceString); >+ >+ this.problemRequestor.initialize(c1SourceString.toCharArray()); >+ >+ final ICompilationUnit unit = getCompilationUnit("/P/p1/C1.java").getWorkingCopy(this.wcOwner, null); >+ assertProblems("Unexpected problems", >+ "----------\n" + >+ "1. ERROR in /P/p1/C1.java (at line 0)\n" + >+ " package p1;\n" + >+ " ^\n" + >+ "Cannot use the unqualified name \'invalid\' as an annotation name for null specification\n" + >+ "----------\n"); >+ >+ ASTParser parser = ASTParser.newParser(AST.JLS4); >+ parser.setProject(p); >+ parser.setResolveBindings(true); >+ parser.setSource(unit); >+ CompilationUnit ast = (CompilationUnit) parser.createAST(null); >+ assertNotNull("ast should not be null", ast); >+ this.problemRequestor.reset(); >+ this.problemRequestor.beginReporting(); >+ IProblem[] problems = ast.getProblems(); >+ for (int i=0; i<problems.length; i++) >+ this.problemRequestor.acceptProblem(problems[i]); >+ assertProblems("Unexpected problems (2)", >+ "----------\n" + >+ "1. ERROR (at line 0)\n" + >+ " package p1;\n" + >+ " ^\n" + >+ "Cannot use the unqualified name \'invalid\' as an annotation name for null specification\n" + >+ "----------\n"); >+ } 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 363858
: 207043 |
207044
|
207268