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 175341 Details for
Bug 320802
ASTParser.createASTs(..) fails silently on multiple missing parameter types.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_320802.txt (text/plain), 5.30 KB, created by
Olivier Thomann
on 2010-07-27 13:41:33 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-07-27 13:41:33 EDT
Size:
5.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.415 >diff -u -r1.415 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 20 Jul 2010 02:25:58 -0000 1.415 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 27 Jul 2010 17:38:44 -0000 >@@ -3667,8 +3667,13 @@ > if (type.isParameterizedType()) { > List missingTypes = type.collectMissingTypes(null); > if (missingTypes != null) { >+ ReferenceContext savedContext = this.referenceContext; > for (Iterator iterator = missingTypes.iterator(); iterator.hasNext(); ) { >- invalidType(location, (TypeBinding) iterator.next()); >+ try { >+ invalidType(location, (TypeBinding) iterator.next()); >+ } finally { >+ this.referenceContext = savedContext; >+ } > } > return; > } >@@ -3692,10 +3697,10 @@ > break; > case ProblemReasons.NonStaticReferenceInStaticContext : > id = IProblem.NonStaticTypeFromStaticInvocation; >- break; >+ break; > case ProblemReasons.IllegalSuperTypeVariable : >- id = IProblem.IllegalTypeVariableSuperReference; >- break; >+ id = IProblem.IllegalTypeVariableSuperReference; >+ break; > case ProblemReasons.NoError : // 0 > default : > needImplementation(location); // want to fail to see why we were here... >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java,v >retrieving revision 1.64 >diff -u -r1.64 ASTModelBridgeTests.java >--- src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 11 May 2010 05:22:54 -0000 1.64 >+++ src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 27 Jul 2010 17:38:44 -0000 >@@ -44,7 +44,7 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_PREFIX = "testBug86380"; >-// TESTS_NAMES = new String[] { "testCreateBindings23" }; >+// TESTS_NAMES = new String[] { "test320802" }; > // TESTS_NUMBERS = new int[] { 83230 }; > // TESTS_RANGE = new int[] { 83304, -1 }; > } >@@ -2222,5 +2222,79 @@ > deleteFile(filePath); > } > } >+ public void test320802() throws CoreException { >+ String filePath = "/P/src/X.java"; >+ String filePathY = "/P/src/p/Y.java"; >+ try { >+ String contents = >+ "import p.Y;\n" + >+ "public class X {\n" + >+ " Y<MissingType1, MissingType2> y;\n" + >+ " public X() {\n" + >+ " this.y = new Y<MissingType1, MissingType2>();\n" + >+ " }\n" + >+ "}"; >+ createFile(filePath, contents); >+ ICompilationUnit compilationUnit = getCompilationUnit("P", "src", "", "X.java"); >+ assertTrue(compilationUnit.exists()); > >+ String contents2 = >+ "package p;\n" + >+ "public class Y<T, U> {}"; >+ createFolder("/P/src/p"); >+ createFile(filePathY, contents2); >+ ICompilationUnit compilationUnit2 = getCompilationUnit("P", "src", "p", "Y.java"); >+ assertTrue(compilationUnit2.exists()); >+ >+ final CompilationUnit[] asts = new CompilationUnit[1]; >+ BindingRequestor requestor = new BindingRequestor() { >+ public void acceptAST(ICompilationUnit source, CompilationUnit ast) { >+ asts[0] = ast; >+ } >+ }; >+ resolveASTs( >+ new ICompilationUnit[] {compilationUnit}, >+ new String[0], >+ requestor, >+ getJavaProject("P"), >+ this.workingCopy.getOwner() >+ ); >+ assertNotNull("No ast", asts[0]); >+ final IProblem[] problems = asts[0].getProblems(); >+ String expectedProblems = >+ "1. ERROR in /P/src/X.java (at line 3)\n" + >+ " Y<MissingType1, MissingType2> y;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "MissingType1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in /P/src/X.java (at line 3)\n" + >+ " Y<MissingType1, MissingType2> y;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "MissingType2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in /P/src/X.java (at line 5)\n" + >+ " this.y = new Y<MissingType1, MissingType2>();\n" + >+ " ^^^^^^\n" + >+ "MissingType1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in /P/src/X.java (at line 5)\n" + >+ " this.y = new Y<MissingType1, MissingType2>();\n" + >+ " ^^^^^^\n" + >+ "MissingType2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in /P/src/X.java (at line 5)\n" + >+ " this.y = new Y<MissingType1, MissingType2>();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "MissingType1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in /P/src/X.java (at line 5)\n" + >+ " this.y = new Y<MissingType1, MissingType2>();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "MissingType2 cannot be resolved to a type\n" + >+ "----------\n"; >+ assertProblems("Wrong problems", expectedProblems, problems, contents.toCharArray()); >+ } finally { >+ deleteFile(filePath); >+ } >+ } > }
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 320802
:
175141
|
175142
| 175341