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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-1 / +10 lines)
Lines 13-18 Link Here
13
import java.io.CharConversionException;
13
import java.io.CharConversionException;
14
import java.io.PrintWriter;
14
import java.io.PrintWriter;
15
import java.io.StringWriter;
15
import java.io.StringWriter;
16
import java.util.Iterator;
16
import java.util.List;
17
import java.util.List;
17
18
18
import org.eclipse.jdt.core.compiler.CategorizedProblem;
19
import org.eclipse.jdt.core.compiler.CategorizedProblem;
Lines 3478-3484 Link Here
3478
			if (isRecoveredName(((ReferenceBinding)leafType).compoundName)) return;
3479
			if (isRecoveredName(((ReferenceBinding)leafType).compoundName)) return;
3479
		}
3480
		}
3480
	}
3481
	}
3481
	
3482
	if (type.isParameterizedType()) {
3483
		List missingTypes = type.collectMissingTypes(null);
3484
		if (missingTypes != null) {
3485
			for (Iterator iterator = missingTypes.iterator(); iterator.hasNext(); ) {
3486
				invalidType(location, (TypeBinding) iterator.next());
3487
			}
3488
			return;
3489
		}
3490
	}
3482
	int id = IProblem.UndefinedType; // default
3491
	int id = IProblem.UndefinedType; // default
3483
	switch (type.problemId()) {
3492
	switch (type.problemId()) {
3484
		case ProblemReasons.NotFound :
3493
		case ProblemReasons.NotFound :
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-2 / +57 lines)
Lines 31-37 Link Here
31
	// All specified tests which does not belong to the class are skipped...
31
	// All specified tests which does not belong to the class are skipped...
32
	static {
32
	static {
33
//		TESTS_NAMES = new String[] { "test0788" };
33
//		TESTS_NAMES = new String[] { "test0788" };
34
//		TESTS_NUMBERS = new int[] { 1054 };
34
//		TESTS_NUMBERS = new int[] { 1367 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
36
	}
36
	}
37
	public static Test suite() {
37
	public static Test suite() {
Lines 45885-45891 Link Here
45885
			"2. ERROR in X.java (at line 4)\n" + 
45885
			"2. ERROR in X.java (at line 4)\n" + 
45886
			"	var= new HashMap<String, String>();\n" + 
45886
			"	var= new HashMap<String, String>();\n" + 
45887
			"	^^^\n" + 
45887
			"	^^^\n" + 
45888
			"Map<String,String> cannot be resolved to a type\n" + 
45888
			"Map cannot be resolved to a type\n" + 
45889
			"----------\n" + 
45889
			"----------\n" + 
45890
			"3. ERROR in X.java (at line 4)\n" + 
45890
			"3. ERROR in X.java (at line 4)\n" + 
45891
			"	var= new HashMap<String, String>();\n" + 
45891
			"	var= new HashMap<String, String>();\n" + 
Lines 46379-46382 Link Here
46379
			"Zork cannot be resolved to a type\n" + 
46379
			"Zork cannot be resolved to a type\n" + 
46380
			"----------\n");
46380
			"----------\n");
46381
}
46381
}
46382
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
46383
public void test1425() {
46384
	this.runNegativeTest(
46385
			new String[] {
46386
				"X.java", //-----------------------------------------------------------------------
46387
				"import java.util.HashMap;\n" + 
46388
				"import java.util.Map;\n" + 
46389
				"public class X {\n" + 
46390
				"	private static Map<String, Zork> map = new HashMap<String, X>();\n" + 
46391
				"	public static X foo(String s) {\n" + 
46392
				"		return map.get(s);\n" + 
46393
				"	}\n" + 
46394
				"}",//-----------------------------------------------------------------------
46395
			},
46396
			"----------\n" + 
46397
			"1. ERROR in X.java (at line 4)\n" + 
46398
			"	private static Map<String, Zork> map = new HashMap<String, X>();\n" + 
46399
			"	                           ^^^^\n" + 
46400
			"Zork cannot be resolved to a type\n" + 
46401
			"----------\n" + 
46402
			"2. ERROR in X.java (at line 6)\n" + 
46403
			"	return map.get(s);\n" + 
46404
			"	       ^^^\n" + 
46405
			"Zork cannot be resolved to a type\n" + 
46406
			"----------\n");
46407
}
46408
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
46409
public void test1426() {
46410
	this.runNegativeTest(
46411
			new String[] {
46412
				"X.java", //-----------------------------------------------------------------------
46413
				"class X {\n" + 
46414
				"	A<E> a; // E is undefined on purpose\n" + 
46415
				"	X() { a = new A<E>(); } // causes Missing code implementation\n" + 
46416
				"}",
46417
				"A.java",
46418
				"class A<E> {}",//-----------------------------------------------------------------------
46419
			},
46420
			"----------\n" + 
46421
			"1. ERROR in X.java (at line 2)\n" + 
46422
			"	A<E> a; // E is undefined on purpose\n" + 
46423
			"	  ^\n" + 
46424
			"E cannot be resolved to a type\n" + 
46425
			"----------\n" + 
46426
			"2. ERROR in X.java (at line 3)\n" + 
46427
			"	X() { a = new A<E>(); } // causes Missing code implementation\n" + 
46428
			"	      ^\n" + 
46429
			"E cannot be resolved to a type\n" + 
46430
			"----------\n" + 
46431
			"3. ERROR in X.java (at line 3)\n" + 
46432
			"	X() { a = new A<E>(); } // causes Missing code implementation\n" + 
46433
			"	                ^\n" + 
46434
			"E cannot be resolved to a type\n" + 
46435
			"----------\n");
46436
}
46382
}
46437
}

Return to bug 244164