View | Details | Raw Unified | Return to bug 320802 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-4 / +9 lines)
Lines 3667-3674 Link Here
3667
	if (type.isParameterizedType()) {
3667
	if (type.isParameterizedType()) {
3668
		List missingTypes = type.collectMissingTypes(null);
3668
		List missingTypes = type.collectMissingTypes(null);
3669
		if (missingTypes != null) {
3669
		if (missingTypes != null) {
3670
			ReferenceContext savedContext = this.referenceContext;
3670
			for (Iterator iterator = missingTypes.iterator(); iterator.hasNext(); ) {
3671
			for (Iterator iterator = missingTypes.iterator(); iterator.hasNext(); ) {
3671
				invalidType(location, (TypeBinding) iterator.next());
3672
				try {
3673
					invalidType(location, (TypeBinding) iterator.next());
3674
				} finally {
3675
					this.referenceContext = savedContext;
3676
				}
3672
			}
3677
			}
3673
			return;
3678
			return;
3674
		}
3679
		}
Lines 3692-3701 Link Here
3692
			break;
3697
			break;
3693
		case ProblemReasons.NonStaticReferenceInStaticContext :
3698
		case ProblemReasons.NonStaticReferenceInStaticContext :
3694
			id = IProblem.NonStaticTypeFromStaticInvocation;
3699
			id = IProblem.NonStaticTypeFromStaticInvocation;
3695
		    break;
3700
			break;
3696
		case ProblemReasons.IllegalSuperTypeVariable :
3701
		case ProblemReasons.IllegalSuperTypeVariable :
3697
		    id = IProblem.IllegalTypeVariableSuperReference;
3702
			id = IProblem.IllegalTypeVariableSuperReference;
3698
		    break;
3703
			break;
3699
		case ProblemReasons.NoError : // 0
3704
		case ProblemReasons.NoError : // 0
3700
		default :
3705
		default :
3701
			needImplementation(location); // want to fail to see why we were here...
3706
			needImplementation(location); // want to fail to see why we were here...
(-)src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java (-1 / +75 lines)
Lines 44-50 Link Here
44
	// All specified tests which do not belong to the class are skipped...
44
	// All specified tests which do not belong to the class are skipped...
45
	static {
45
	static {
46
//		TESTS_PREFIX =  "testBug86380";
46
//		TESTS_PREFIX =  "testBug86380";
47
//		TESTS_NAMES = new String[] { "testCreateBindings23" };
47
//		TESTS_NAMES = new String[] { "test320802" };
48
//		TESTS_NUMBERS = new int[] { 83230 };
48
//		TESTS_NUMBERS = new int[] { 83230 };
49
//		TESTS_RANGE = new int[] { 83304, -1 };
49
//		TESTS_RANGE = new int[] { 83304, -1 };
50
		}
50
		}
Lines 2222-2226 Link Here
2222
			deleteFile(filePath);
2222
			deleteFile(filePath);
2223
		}
2223
		}
2224
	}
2224
	}
2225
	public void test320802() throws CoreException {
2226
		String filePath = "/P/src/X.java";
2227
		String filePathY = "/P/src/p/Y.java";
2228
		try {
2229
			String contents =
2230
				"import p.Y;\n" +
2231
				"public class X {\n" +
2232
				"	Y<MissingType1, MissingType2> y;\n" +
2233
				"	public X() {\n" +
2234
				"		this.y = new Y<MissingType1, MissingType2>();\n" +
2235
				"	}\n" + 
2236
				"}";
2237
			createFile(filePath, contents);
2238
			ICompilationUnit compilationUnit = getCompilationUnit("P", "src", "", "X.java");
2239
			assertTrue(compilationUnit.exists());
2225
2240
2241
			String contents2 =
2242
				"package p;\n" +
2243
				"public class Y<T, U> {}";
2244
			createFolder("/P/src/p");
2245
			createFile(filePathY, contents2);
2246
			ICompilationUnit compilationUnit2 = getCompilationUnit("P", "src", "p", "Y.java");
2247
			assertTrue(compilationUnit2.exists());
2248
2249
			final CompilationUnit[] asts = new CompilationUnit[1];
2250
			BindingRequestor requestor = new BindingRequestor() {
2251
				public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
2252
					asts[0] = ast;
2253
				}
2254
			};
2255
			resolveASTs(
2256
				new ICompilationUnit[] {compilationUnit},
2257
				new String[0],
2258
				requestor,
2259
				getJavaProject("P"),
2260
				this.workingCopy.getOwner()
2261
			);
2262
			assertNotNull("No ast", asts[0]);
2263
			final IProblem[] problems = asts[0].getProblems();
2264
			String expectedProblems = 
2265
				"1. ERROR in /P/src/X.java (at line 3)\n" + 
2266
				"	Y<MissingType1, MissingType2> y;\n" + 
2267
				"	  ^^^^^^^^^^^^\n" + 
2268
				"MissingType1 cannot be resolved to a type\n" + 
2269
				"----------\n" + 
2270
				"2. ERROR in /P/src/X.java (at line 3)\n" + 
2271
				"	Y<MissingType1, MissingType2> y;\n" + 
2272
				"	                ^^^^^^^^^^^^\n" + 
2273
				"MissingType2 cannot be resolved to a type\n" + 
2274
				"----------\n" + 
2275
				"3. ERROR in /P/src/X.java (at line 5)\n" + 
2276
				"	this.y = new Y<MissingType1, MissingType2>();\n" + 
2277
				"	^^^^^^\n" + 
2278
				"MissingType1 cannot be resolved to a type\n" + 
2279
				"----------\n" + 
2280
				"4. ERROR in /P/src/X.java (at line 5)\n" + 
2281
				"	this.y = new Y<MissingType1, MissingType2>();\n" + 
2282
				"	^^^^^^\n" + 
2283
				"MissingType2 cannot be resolved to a type\n" + 
2284
				"----------\n" + 
2285
				"5. ERROR in /P/src/X.java (at line 5)\n" + 
2286
				"	this.y = new Y<MissingType1, MissingType2>();\n" + 
2287
				"	               ^^^^^^^^^^^^\n" + 
2288
				"MissingType1 cannot be resolved to a type\n" + 
2289
				"----------\n" + 
2290
				"6. ERROR in /P/src/X.java (at line 5)\n" + 
2291
				"	this.y = new Y<MissingType1, MissingType2>();\n" + 
2292
				"	                             ^^^^^^^^^^^^\n" + 
2293
				"MissingType2 cannot be resolved to a type\n" + 
2294
				"----------\n";
2295
			assertProblems("Wrong problems", expectedProblems, problems, contents.toCharArray());
2296
		} finally {
2297
			deleteFile(filePath);
2298
		}
2299
	}
2226
}
2300
}

Return to bug 320802