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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java (+1 lines)
Lines 34-39 Link Here
34
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
34
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
35
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
35
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
36
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
36
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
37
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37
		return options;
38
		return options;
38
	}
39
	}
39
40
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (+1 lines)
Lines 72-77 Link Here
72
		options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
72
		options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
73
		options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation);
73
		options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation);
74
		options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
74
		options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
75
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
75
		return options;
76
		return options;
76
	}
77
	}
77
	/* (non-Javadoc)
78
	/* (non-Javadoc)
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-37 / +72 lines)
Lines 1032-1038 Link Here
1032
        "      over-ann             missing @Override annotation\n" + 
1032
        "      over-ann             missing @Override annotation\n" + 
1033
        "      paramAssign          assignment to a parameter\n" + 
1033
        "      paramAssign          assignment to a parameter\n" + 
1034
        "      pkgDefaultMethod   + attempt to override package-default method\n" + 
1034
        "      pkgDefaultMethod   + attempt to override package-default method\n" + 
1035
        "      raw                  usage of raw type\n" + 
1035
        "      raw                + usage of raw type\n" + 
1036
        "      semicolon            unnecessary semicolon, empty statement\n" + 
1036
        "      semicolon            unnecessary semicolon, empty statement\n" + 
1037
        "      serial             + missing serialVersionUID\n" + 
1037
        "      serial             + missing serialVersionUID\n" + 
1038
        "      specialParamHiding   constructor or setter parameter hiding another field\n" + 
1038
        "      specialParamHiding   constructor or setter parameter hiding another field\n" + 
Lines 1171-1177 Link Here
1171
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + 
1171
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + 
1172
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + 
1172
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + 
1173
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + 
1173
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + 
1174
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"ignore\"/>\n" + 
1174
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" + 
1175
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1175
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1176
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1176
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1177
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
1177
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
Lines 2025-2056 Link Here
2025
	        + " -d \"" + OUTPUT_DIR + "\"",
2025
	        + " -d \"" + OUTPUT_DIR + "\"",
2026
	        "",
2026
	        "",
2027
	        "----------\n" + 
2027
	        "----------\n" + 
2028
	        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + 
2028
	        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 8)\n" + 
2029
	        "	private final Map<Class<? extends X>, \n" + 
2030
	        "	                                  ^\n" + 
2031
	        "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + 
2032
	        "----------\n" + 
2033
	        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 10)\n" + 
2034
	        "	m1 = new HashMap<Class<? extends X>, \n" + 
2035
	        "	                                 ^\n" + 
2036
	        "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + 
2037
	        "----------\n" + 
2038
	        "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 22)\n" + 
2039
	        "	Y l1 = m1.get(p1);\n" + 
2040
	        "	^\n" + 
2041
	        "Y is a raw type. References to generic type Y<T,U,V> should be parameterized\n" + 
2042
	        "----------\n" + 
2043
	        "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + 
2029
	        "	m1.put(p1, l1);\n" + 
2044
	        "	m1.put(p1, l1);\n" + 
2030
	        "	           ^^\n" + 
2045
	        "	           ^^\n" + 
2031
	        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + 
2046
	        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + 
2032
	        "----------\n" + 
2047
	        "----------\n" + 
2033
	        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + 
2048
	        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + 
2034
	        "	return l1;\n" + 
2049
	        "	return l1;\n" + 
2035
	        "	       ^^\n" + 
2050
	        "	       ^^\n" + 
2036
	        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + 
2051
	        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + 
2037
	        "----------\n" + 
2052
	        "----------\n" + 
2038
	        "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + 
2053
	        "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + 
2039
	        "	m2.put((XX<?, XY>) p1, p2);\n" + 
2054
	        "	m2.put((XX<?, XY>) p1, p2);\n" + 
2040
	        "	       ^^^^^^^^^^^^^^\n" + 
2055
	        "	       ^^^^^^^^^^^^^^\n" + 
2041
	        "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2056
	        "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2042
	        "----------\n" + 
2057
	        "----------\n" + 
2043
	        "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2058
	        "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2044
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2059
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2045
	        "	                ^^\n" + 
2060
	        "	                ^^\n" + 
2046
	        "The local variable l1 is never read\n" + 
2061
	        "The local variable l1 is never read\n" + 
2047
	        "----------\n" + 
2062
	        "----------\n" + 
2048
	        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2063
	        "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2049
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2064
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2050
	        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2065
	        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2051
	        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" +
2066
	        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2052
	        "----------\n" + 
2067
	        "----------\n" + 
2053
	        "5 problems (5 warnings)",
2068
	        "8 problems (8 warnings)",
2054
	        true);
2069
	        true);
2055
	// second series shows that a staged build - that simulates the auto build context - is OK as well
2070
	// second series shows that a staged build - that simulates the auto build context - is OK as well
2056
	this.runConformTest(
2071
	this.runConformTest(
Lines 2190-2221 Link Here
2190
        + " -d \"" + OUTPUT_DIR + "\"",
2205
        + " -d \"" + OUTPUT_DIR + "\"",
2191
        "",
2206
        "",
2192
        "----------\n" + 
2207
        "----------\n" + 
2193
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + 
2208
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 8)\n" + 
2209
        "	private final Map<Class<? extends X>, \n" + 
2210
        "	                                  ^\n" + 
2211
        "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + 
2212
        "----------\n" + 
2213
        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 10)\n" + 
2214
        "	m1 = new HashMap<Class<? extends X>, \n" + 
2215
        "	                                 ^\n" + 
2216
        "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + 
2217
        "----------\n" + 
2218
        "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 22)\n" + 
2219
        "	Y l1 = m1.get(p1);\n" + 
2220
        "	^\n" + 
2221
        "Y is a raw type. References to generic type Y<T,U,V> should be parameterized\n" + 
2222
        "----------\n" + 
2223
        "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + 
2194
        "	m1.put(p1, l1);\n" + 
2224
        "	m1.put(p1, l1);\n" + 
2195
        "	           ^^\n" + 
2225
        "	           ^^\n" + 
2196
        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + 
2226
        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + 
2197
        "----------\n" + 
2227
        "----------\n" + 
2198
        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + 
2228
        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + 
2199
        "	return l1;\n" + 
2229
        "	return l1;\n" + 
2200
        "	       ^^\n" + 
2230
        "	       ^^\n" + 
2201
        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + 
2231
        "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + 
2202
        "----------\n" + 
2232
        "----------\n" + 
2203
        "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + 
2233
        "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + 
2204
        "	m2.put((XX<?, XY>) p1, p2);\n" + 
2234
        "	m2.put((XX<?, XY>) p1, p2);\n" + 
2205
        "	       ^^^^^^^^^^^^^^\n" + 
2235
        "	       ^^^^^^^^^^^^^^\n" + 
2206
        "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2236
        "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2207
        "----------\n" + 
2237
        "----------\n" + 
2208
        "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2238
        "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2209
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2239
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2210
        "	                ^^\n" + 
2240
        "	                ^^\n" + 
2211
        "The local variable l1 is never read\n" + 
2241
        "The local variable l1 is never read\n" + 
2212
        "----------\n" + 
2242
        "----------\n" + 
2213
        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2243
        "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2214
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2244
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2215
        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2245
        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2216
        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2246
        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2217
        "----------\n" + 
2247
        "----------\n" + 
2218
        "5 problems (5 warnings)",
2248
        "8 problems (8 warnings)",
2219
        false);
2249
        false);
2220
}
2250
}
2221
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=104664
2251
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=104664
Lines 2411-2438 Link Here
2411
        + " -proceedOnError -referenceInfo"
2441
        + " -proceedOnError -referenceInfo"
2412
        + " -d \"" + OUTPUT_DIR + File.separator + "bin2/\"",
2442
        + " -d \"" + OUTPUT_DIR + File.separator + "bin2/\"",
2413
        "",
2443
        "",
2414
		"----------\n" + 
2444
        "----------\n" + 
2415
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + 
2445
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + 
2416
		"	X x1;\n" + 
2446
        "	X x1;\n" + 
2417
		"	^\n" + 
2447
        "	^\n" + 
2418
		"Discouraged access: The type X<T> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2448
        "Discouraged access: The type X<T> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2419
		"----------\n" + 
2449
        "----------\n" + 
2420
		"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2450
        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + 
2421
		"	X<String> x2 = new X<String>();\n" + 
2451
        "	X x1;\n" + 
2422
		"	^\n" + 
2452
        "	^\n" + 
2423
		"Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2453
        "X is a raw type. References to generic type X<T> should be parameterized\n" + 
2424
		"----------\n" + 
2454
        "----------\n" + 
2425
		"3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2455
        "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2426
		"	X<String> x2 = new X<String>();\n" + 
2456
        "	X<String> x2 = new X<String>();\n" + 
2427
		"	               ^^^^^^^^^^^^^^^\n" + 
2457
        "	^\n" + 
2428
		"Discouraged access: The constructor X<String>() is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2458
        "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2429
		"----------\n" + 
2459
        "----------\n" + 
2430
		"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2460
        "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2431
		"	X<String> x2 = new X<String>();\n" + 
2461
        "	X<String> x2 = new X<String>();\n" + 
2432
		"	                   ^\n" + 
2462
        "	               ^^^^^^^^^^^^^^^\n" + 
2433
		"Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2463
        "Discouraged access: The constructor X<String>() is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2434
		"----------\n" + 
2464
        "----------\n" + 
2435
		"4 problems (4 warnings)",
2465
        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + 
2466
        "	X<String> x2 = new X<String>();\n" + 
2467
        "	                   ^\n" + 
2468
        "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + 
2469
        "----------\n" + 
2470
        "5 problems (5 warnings)",
2436
        false);
2471
        false);
2437
}
2472
}
2438
2473
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java (+1 lines)
Lines 59-64 Link Here
59
		options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
59
		options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
60
		options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
60
		options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
61
		options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
61
		options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
62
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
62
		return options;
63
		return options;
63
	}
64
	}
64
	/* (non-Javadoc)
65
	/* (non-Javadoc)
(-)src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java (+1 lines)
Lines 30-35 Link Here
30
protected Map getCompilerOptions() {
30
protected Map getCompilerOptions() {
31
	Map defaultOptions = super.getCompilerOptions();
31
	Map defaultOptions = super.getCompilerOptions();
32
	defaultOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING);
32
	defaultOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING);
33
	defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
33
	return defaultOptions;
34
	return defaultOptions;
34
}
35
}
35
public static Test suite() {
36
public static Test suite() {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java (+1 lines)
Lines 36-41 Link Here
36
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
36
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
38
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
38
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
39
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
39
		return options;
40
		return options;
40
	}
41
	}
41
42
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java (+1 lines)
Lines 35-40 Link Here
35
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
35
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
36
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
36
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
38
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38
		return options;
39
		return options;
39
	}
40
	}
40
41
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java (+1 lines)
Lines 36-41 Link Here
36
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
36
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
37
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
38
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
38
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
39
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
39
		return options;
40
		return options;
40
	}
41
	}
41
42
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (+1 lines)
Lines 49-54 Link Here
49
    Map defaultOptions = super.getCompilerOptions();
49
    Map defaultOptions = super.getCompilerOptions();
50
//    defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
50
//    defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
51
    defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
51
    defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
52
	defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
52
//    defaultOptions.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.WARNING);
53
//    defaultOptions.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.WARNING);
53
    return defaultOptions;
54
    return defaultOptions;
54
}
55
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java (+1 lines)
Lines 46-51 Link Here
46
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
46
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
47
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
47
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
48
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
48
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
49
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
49
		return options;
50
		return options;
50
	}
51
	}
51
52
(-)src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java (+1 lines)
Lines 145-150 Link Here
145
		options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
145
		options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
146
		options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
146
		options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
147
		options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
147
		options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
148
		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
148
		return options;
149
		return options;
149
	}
150
	}
150
	public void initialize(CompilerTestSetup setUp) {
151
	public void initialize(CompilerTestSetup setUp) {
(-)src/org/eclipse/jdt/core/tests/util/Util.java (+1 lines)
Lines 238-243 Link Here
238
	options.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE);
238
	options.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE);
239
	options.put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.IGNORE);
239
	options.put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.IGNORE);
240
	options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
240
	options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
241
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
241
	createJar(pathsAndContents, options, jarPath);
242
	createJar(pathsAndContents, options, jarPath);
242
}
243
}
243
public static void createSourceZip(String[] pathsAndContents, String zipPath) throws IOException {
244
public static void createSourceZip(String[] pathsAndContents, String zipPath) throws IOException {
(-)src/org/eclipse/jdt/core/tests/builder/DependencyTests.java (-2 / +3 lines)
Lines 1019-1025 Link Here
1019
		fullBuild(projectPath);
1019
		fullBuild(projectPath);
1020
		expectingNoProblems();
1020
		expectingNoProblems();
1021
1021
1022
		env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$
1022
		IPath aPath = env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$
1023
			"package p1;\n"+ //$NON-NLS-1$
1023
			"package p1;\n"+ //$NON-NLS-1$
1024
			"public class A {}\n" //$NON-NLS-1$
1024
			"public class A {}\n" //$NON-NLS-1$
1025
		);
1025
		);
Lines 1034-1041 Link Here
1034
		);
1034
		);
1035
1035
1036
		incrementalBuild(projectPath);
1036
		incrementalBuild(projectPath);
1037
		expectingOnlyProblemsFor(new IPath[] {bPath});
1037
		expectingOnlyProblemsFor(new IPath[] {aPath, bPath});
1038
		expectingSpecificProblemFor(bPath, new Problem("B", "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T extends Comparable> of the type A<T>", bPath, 43, 44, CategorizedProblem.CAT_TYPE)); //$NON-NLS-1$ //$NON-NLS-2$
1038
		expectingSpecificProblemFor(bPath, new Problem("B", "Bound mismatch: The type T is not a valid substitute for the bounded parameter <T extends Comparable> of the type A<T>", bPath, 43, 44, CategorizedProblem.CAT_TYPE)); //$NON-NLS-1$ //$NON-NLS-2$
1039
		expectingSpecificProblemFor(aPath, new Problem("A", "Comparable is a raw type. References to generic type Comparable<T> should be parameterized", aPath, 37, 47, CategorizedProblem.CAT_UNCHECKED_RAW)); //$NON-NLS-1$ //$NON-NLS-2$
1039
1040
1040
		env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$
1041
		env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$
1041
			"package p1;\n"+ //$NON-NLS-1$
1042
			"package p1;\n"+ //$NON-NLS-1$
(-)model/org/eclipse/jdt/core/JavaCore.java (-1 / +1 lines)
Lines 2042-2048 Link Here
2042
	 *    reject raw references to generic types.
2042
	 *    reject raw references to generic types.
2043
	 *     - option id:         "org.eclipse.jdt.core.compiler.problem.rawTypeReference"
2043
	 *     - option id:         "org.eclipse.jdt.core.compiler.problem.rawTypeReference"
2044
	 *     - possible values:   { "error", "warning", "ignore" }
2044
	 *     - possible values:   { "error", "warning", "ignore" }
2045
	 *     - default:           "ignore"
2045
	 *     - default:           "warning"
2046
	 * 
2046
	 * 
2047
	 * COMPILER / Reporting final Bound for Type Parameter
2047
	 * COMPILER / Reporting final Bound for Type Parameter
2048
	 *    When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a 
2048
	 *    When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a 
(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (-1 / +1 lines)
Lines 232-238 Link Here
232
\      over-ann             missing @Override annotation\n\
232
\      over-ann             missing @Override annotation\n\
233
\      paramAssign          assignment to a parameter\n\
233
\      paramAssign          assignment to a parameter\n\
234
\      pkgDefaultMethod   + attempt to override package-default method\n\
234
\      pkgDefaultMethod   + attempt to override package-default method\n\
235
\      raw                  usage of raw type\n\
235
\      raw                + usage of raw type\n\
236
\      semicolon            unnecessary semicolon, empty statement\n\
236
\      semicolon            unnecessary semicolon, empty statement\n\
237
\      serial             + missing serialVersionUID\n\
237
\      serial             + missing serialVersionUID\n\
238
\      specialParamHiding   constructor or setter parameter hiding another field\n\
238
\      specialParamHiding   constructor or setter parameter hiding another field\n\
(-)buildnotes_jdt-core.html (+4 lines)
Lines 51-56 Link Here
51
<br>Project org.eclipse.jdt.core v_715
51
<br>Project org.eclipse.jdt.core v_715
52
(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_715">cvs</a>).
52
(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_715">cvs</a>).
53
<h2>What's new in this drop</h2>
53
<h2>What's new in this drop</h2>
54
<ul>
55
<li>The raw type warnings are now enabled by default. See bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=159456">159456</a> for details.
56
</li>
57
</ul>
54
58
55
<h3>Problem Reports Fixed</h3>
59
<h3>Problem Reports Fixed</h3>
56
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=155824">155824</a>
60
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=155824">155824</a>
(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (+1 lines)
Lines 205-210 Link Here
205
		| AssertUsedAsAnIdentifier
205
		| AssertUsedAsAnIdentifier
206
		| EnumUsedAsAnIdentifier
206
		| EnumUsedAsAnIdentifier
207
		| UncheckedTypeOperation
207
		| UncheckedTypeOperation
208
		| RawTypeReference
208
		| MissingSerialVersion
209
		| MissingSerialVersion
209
		| VarargsArgumentNeedCast
210
		| VarargsArgumentNeedCast
210
		| ForbiddenReference
211
		| ForbiddenReference
(-)workspace/Converter15/src/test0063/X.java (-1 / +1 lines)
Lines 8-13 Link Here
8
		return new X<String>();
8
		return new X<String>();
9
	}
9
	}
10
	
10
	
11
	public void bar(List<? extends X> c) {
11
	public void bar(List<? extends X<?>> c) {
12
	}
12
	}
13
}
13
}
(-)workspace/Converter15/src/test0065/X.java (-3 / +3 lines)
Lines 2-13 Link Here
2
2
3
import java.util.List;
3
import java.util.List;
4
4
5
public class X<T, U extends List> {
5
public class X<T, U extends List<?>> {
6
	
6
	
7
	Object foo() {
7
	Object foo() {
8
		return new X<String, List>();
8
		return new X<String, List<?>>();
9
	}
9
	}
10
	
10
	
11
	public void bar(List<? extends X> c) {
11
	public void bar(List<? extends X<?, ?>> c) {
12
	}
12
	}
13
}
13
}
(-)workspace/Converter15/src/test0007/X.java (-1 / +1 lines)
Lines 4-10 Link Here
4
import static java.io.File.*;
4
import static java.io.File.*;
5
5
6
public class X {
6
public class X {
7
	Map foo() {
7
	Map<String, String> foo() {
8
		return null;
8
		return null;
9
	}
9
	}
10
	
10
	
(-)src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java (+8 lines)
Lines 556-561 Link Here
556
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
556
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
557
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
557
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
558
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
558
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
559
		p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
559
		this.problemRequestor = new ProblemRequestor();
560
		this.problemRequestor = new ProblemRequestor();
560
		x = getWorkingCopy(
561
		x = getWorkingCopy(
561
			"/P1/src/p/X.java",
562
			"/P1/src/p/X.java",
Lines 578-583 Link Here
578
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
579
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
579
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
580
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
580
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
581
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
582
		p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
581
		IClasspathEntry[] classpath = p2.getRawClasspath();
583
		IClasspathEntry[] classpath = p2.getRawClasspath();
582
		int length = classpath.length;
584
		int length = classpath.length;
583
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
585
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
Lines 646-651 Link Here
646
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
648
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
647
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
649
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
648
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
650
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
651
		p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
649
		this.problemRequestor = new ProblemRequestor();
652
		this.problemRequestor = new ProblemRequestor();
650
		x = getWorkingCopy(
653
		x = getWorkingCopy(
651
			"/P1/src/p/X.java",
654
			"/P1/src/p/X.java",
Lines 671-676 Link Here
671
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
674
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
672
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
675
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
673
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
676
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");
677
		p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
674
		IClasspathEntry[] classpath = p2.getRawClasspath();
678
		IClasspathEntry[] classpath = p2.getRawClasspath();
675
		int length = classpath.length;
679
		int length = classpath.length;
676
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
680
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
Lines 739-744 Link Here
739
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
743
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
740
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
744
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
741
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
745
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
746
		p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
742
		this.problemRequestor = new ProblemRequestor();
747
		this.problemRequestor = new ProblemRequestor();
743
		x1 = getWorkingCopy(
748
		x1 = getWorkingCopy(
744
			"/P1/src/p/X1.java",
749
			"/P1/src/p/X1.java",
Lines 828-833 Link Here
828
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
833
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
829
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
834
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
830
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
835
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
836
		p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
831
		this.problemRequestor = new ProblemRequestor();
837
		this.problemRequestor = new ProblemRequestor();
832
		x1 = getWorkingCopy(
838
		x1 = getWorkingCopy(
833
			"/P1/src/p/X1.java",
839
			"/P1/src/p/X1.java",
Lines 916-921 Link Here
916
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
922
		p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
917
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
923
		p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
918
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
924
		p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
925
		p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
919
		this.problemRequestor = new ProblemRequestor();
926
		this.problemRequestor = new ProblemRequestor();
920
		x1 = getWorkingCopy(
927
		x1 = getWorkingCopy(
921
			"/P1/src/p/X1.java",
928
			"/P1/src/p/X1.java",
Lines 953-958 Link Here
953
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
960
		p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5");
954
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
961
		p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5");
955
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
962
		p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5");		
963
		p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
956
		IClasspathEntry[] classpath = p2.getRawClasspath();
964
		IClasspathEntry[] classpath = p2.getRawClasspath();
957
		int length = classpath.length;
965
		int length = classpath.length;
958
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
966
		System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length);
(-)src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java (+1 lines)
Lines 213-218 Link Here
213
		JavaCore.VERSION_1_5
213
		JavaCore.VERSION_1_5
214
	);
214
	);
215
	project15.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
215
	project15.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
216
	project15.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE);
216
}
217
}
217
private void setUp15WorkingCopy() throws JavaModelException {
218
private void setUp15WorkingCopy() throws JavaModelException {
218
	setUp15WorkingCopy("Reconciler15/src/p1/X.java", new WorkingCopyOwner() {});
219
	setUp15WorkingCopy("Reconciler15/src/p1/X.java", new WorkingCopyOwner() {});
(-)workspace/Converter15/src/test0064/X.java (-1 / +1 lines)
Lines 8-13 Link Here
8
		return new X<String, Integer>();
8
		return new X<String, Integer>();
9
	}
9
	}
10
	
10
	
11
	public void bar(List<? extends X> c) {
11
	public void bar(List<? extends X<?,?>> c) {
12
	}
12
	}
13
}
13
}
(-)workspace/Converter15/src/test0008/X.java (-1 / +1 lines)
Lines 4-10 Link Here
4
import static java.io.File.*;
4
import static java.io.File.*;
5
5
6
public class X {
6
public class X {
7
	Map foo() {
7
	Map<String, String> foo() {
8
		return null;
8
		return null;
9
	}
9
	}
10
	
10
	
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-29 / +60 lines)
Lines 523-529 Link Here
523
		assertEquals("Wrong size", 1, typeParameters.size());
523
		assertEquals("Wrong size", 1, typeParameters.size());
524
		TypeParameter typeParameter = (TypeParameter) typeParameters.get(0);
524
		TypeParameter typeParameter = (TypeParameter) typeParameters.get(0);
525
		checkSourceRange(typeParameter.getName(), "A", source);
525
		checkSourceRange(typeParameter.getName(), "A", source);
526
		checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable", source);
526
		checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable<?>", source);
527
		List typeBounds = typeParameter.typeBounds();
527
		List typeBounds = typeParameter.typeBounds();
528
		assertEquals("Wrong size", 3, typeBounds.size());
528
		assertEquals("Wrong size", 3, typeBounds.size());
529
		Type typeBound = (Type) typeBounds.get(0);
529
		Type typeBound = (Type) typeBounds.get(0);
Lines 531-537 Link Here
531
		typeBound = (Type) typeBounds.get(1);
531
		typeBound = (Type) typeBounds.get(1);
532
		checkSourceRange(typeBound, "java.io.Serializable", source);
532
		checkSourceRange(typeBound, "java.io.Serializable", source);
533
		typeBound = (Type) typeBounds.get(2);
533
		typeBound = (Type) typeBounds.get(2);
534
		checkSourceRange(typeBound, "Comparable", source);		
534
		checkSourceRange(typeBound, "Comparable<?>", source);		
535
	}
535
	}
536
536
537
	public void test0016() throws JavaModelException {
537
	public void test0016() throws JavaModelException {
Lines 1746-1752 Link Here
1746
			"  <T extends Exception & Runnable> void foo(T t) {\n" +
1746
			"  <T extends Exception & Runnable> void foo(T t) {\n" +
1747
			"  }\n" +
1747
			"  }\n" +
1748
			"}/*end*/",
1748
			"}/*end*/",
1749
			this.workingCopy);
1749
			this.workingCopy,
1750
			false);
1750
		MethodDeclaration[] methods = ((TypeDeclaration) node).getMethods();
1751
		MethodDeclaration[] methods = ((TypeDeclaration) node).getMethods();
1751
		int length = methods.length;
1752
		int length = methods.length;
1752
		String[] keys = new String[length];
1753
		String[] keys = new String[length];
Lines 1787-1793 Link Here
1787
			"public class X<T> {\n" +
1788
			"public class X<T> {\n" +
1788
			"  /*start*/X<Class>/*end*/ f;\n" +
1789
			"  /*start*/X<Class>/*end*/ f;\n" +
1789
			"}",
1790
			"}",
1790
			this.workingCopy);
1791
			this.workingCopy,
1792
			false);
1791
		IBinding binding = ((Type) node).resolveBinding();
1793
		IBinding binding = ((Type) node).resolveBinding();
1792
		assertBindingKeyEquals(
1794
		assertBindingKeyEquals(
1793
			"Lp/X<Ljava/lang/Class<>;>;",
1795
			"Lp/X<Ljava/lang/Class<>;>;",
Lines 1824-1830 Link Here
1824
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1826
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1825
		Type type = declaration.getType();
1827
		Type type = declaration.getType();
1826
		typeBinding = type.resolveBinding();
1828
		typeBinding = type.resolveBinding();
1827
		assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X>", typeBinding.getQualifiedName());				
1829
		assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X<?>>", typeBinding.getQualifiedName());				
1828
	}
1830
	}
1829
	
1831
	
1830
	/**
1832
	/**
Lines 1858-1864 Link Here
1858
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1860
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1859
		Type type = declaration.getType();
1861
		Type type = declaration.getType();
1860
		typeBinding = type.resolveBinding();
1862
		typeBinding = type.resolveBinding();
1861
		assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X>", typeBinding.getQualifiedName());				
1863
		assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X<?,?>>", typeBinding.getQualifiedName());				
1862
	}
1864
	}
1863
	
1865
	
1864
	/**
1866
	/**
Lines 1885-1891 Link Here
1885
		Expression expression = returnStatement.getExpression();
1887
		Expression expression = returnStatement.getExpression();
1886
		typeBinding = expression.resolveTypeBinding();
1888
		typeBinding = expression.resolveTypeBinding();
1887
		assertTrue("Not parameterized", typeBinding.isParameterizedType());
1889
		assertTrue("Not parameterized", typeBinding.isParameterizedType());
1888
		assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List>", typeBinding.getQualifiedName());		
1890
		assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List<?>>", typeBinding.getQualifiedName());		
1889
		node = getASTNode(compilationUnit, 0, 1);
1891
		node = getASTNode(compilationUnit, 0, 1);
1890
		assertEquals("Wrong node", ASTNode.METHOD_DECLARATION, node.getNodeType());
1892
		assertEquals("Wrong node", ASTNode.METHOD_DECLARATION, node.getNodeType());
1891
		MethodDeclaration methodDeclaration = (MethodDeclaration) node;
1893
		MethodDeclaration methodDeclaration = (MethodDeclaration) node;
Lines 1894-1900 Link Here
1894
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1896
		SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0);
1895
		Type type = declaration.getType();
1897
		Type type = declaration.getType();
1896
		typeBinding = type.resolveBinding();
1898
		typeBinding = type.resolveBinding();
1897
		assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X>", typeBinding.getQualifiedName());				
1899
		assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X<?,?>>", typeBinding.getQualifiedName());				
1898
	}
1900
	}
1899
	
1901
	
1900
	/*
1902
	/*
Lines 1908-1914 Link Here
1908
			"public class X<T> {\n" +
1910
			"public class X<T> {\n" +
1909
			"  /*start*/X/*end*/ field;" +
1911
			"  /*start*/X/*end*/ field;" +
1910
			"}",
1912
			"}",
1911
			this.workingCopy);
1913
			this.workingCopy,
1914
			false);
1912
		IBinding binding = ((Type) node).resolveBinding();
1915
		IBinding binding = ((Type) node).resolveBinding();
1913
		assertBindingKeyEquals(
1916
		assertBindingKeyEquals(
1914
			"Lp/X<>;",
1917
			"Lp/X<>;",
Lines 2412-2419 Link Here
2412
		assertNotNull(result);
2415
		assertNotNull(result);
2413
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
2416
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
2414
		CompilationUnit compilationUnit = (CompilationUnit) result;
2417
		CompilationUnit compilationUnit = (CompilationUnit) result;
2415
		String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized";
2418
		String expectedOutput =
2416
		assertProblemsSize(compilationUnit, 1, expectedOutput);
2419
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
2420
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
2421
			"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + 
2422
			"Y is a raw type. References to generic type Y<T> should be parameterized";
2423
		assertProblemsSize(compilationUnit, 4, expectedOutput);
2417
		ASTNode node = getASTNode(compilationUnit, 1, 0, 0);
2424
		ASTNode node = getASTNode(compilationUnit, 1, 0, 0);
2418
		assertEquals("Not a method declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
2425
		assertEquals("Not a method declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
2419
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
2426
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
Lines 2440-2446 Link Here
2440
		assertNotNull(result);
2447
		assertNotNull(result);
2441
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
2448
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
2442
		CompilationUnit compilationUnit = (CompilationUnit) result;
2449
		CompilationUnit compilationUnit = (CompilationUnit) result;
2443
		assertProblemsSize(compilationUnit, 0);
2450
		String expectedOutput =
2451
			"Gen is a raw type. References to generic type Gen<X> should be parameterized\n" + 
2452
			"Gen.Inn is a raw type. References to generic type Gen<X>.Inn should be parameterized";
2453
		assertProblemsSize(compilationUnit, 2, expectedOutput);
2444
		ASTNode node = getASTNode(compilationUnit, 0);
2454
		ASTNode node = getASTNode(compilationUnit, 0);
2445
		assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType());
2455
		assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType());
2446
		TypeDeclaration typeDeclaration = (TypeDeclaration) node;
2456
		TypeDeclaration typeDeclaration = (TypeDeclaration) node;
Lines 3472-3478 Link Here
3472
			"public class X<E> {\n" +
3482
			"public class X<E> {\n" +
3473
			"  /*start*/X<String>/*end*/ field;\n" +
3483
			"  /*start*/X<String>/*end*/ field;\n" +
3474
			"}",
3484
			"}",
3475
			this.workingCopy);
3485
			this.workingCopy,
3486
			false);
3476
		ITypeBinding binding = type.resolveBinding().getTypeDeclaration();
3487
		ITypeBinding binding = type.resolveBinding().getTypeDeclaration();
3477
		assertBindingEquals(
3488
		assertBindingEquals(
3478
			"LX<TE;>;",
3489
			"LX<TE;>;",
Lines 3488-3494 Link Here
3488
			"public class X<E> {\n" +
3499
			"public class X<E> {\n" +
3489
			"  /*start*/X/*end*/ field;\n" +
3500
			"  /*start*/X/*end*/ field;\n" +
3490
			"}",
3501
			"}",
3491
			this.workingCopy);
3502
			this.workingCopy,
3503
			false);
3492
		ITypeBinding binding = type.resolveBinding().getTypeDeclaration();
3504
		ITypeBinding binding = type.resolveBinding().getTypeDeclaration();
3493
		assertBindingEquals(
3505
		assertBindingEquals(
3494
			"LX<TE;>;",
3506
			"LX<TE;>;",
Lines 3581-3587 Link Here
3581
			"public class X<E> {\n" +
3593
			"public class X<E> {\n" +
3582
			"  /*start*/X/*end*/ field;\n" +
3594
			"  /*start*/X/*end*/ field;\n" +
3583
			"}",
3595
			"}",
3584
			this.workingCopy);
3596
			this.workingCopy,
3597
			false);
3585
		ITypeBinding binding = type.resolveBinding().getErasure();
3598
		ITypeBinding binding = type.resolveBinding().getErasure();
3586
		assertBindingEquals(
3599
		assertBindingEquals(
3587
			"LX<TE;>;",
3600
			"LX<TE;>;",
Lines 4430-4440 Link Here
4430
    		"}";
4443
    		"}";
4431
    	ASTNode node = buildAST(
4444
    	ASTNode node = buildAST(
4432
				contents,
4445
				contents,
4433
    			this.workingCopy);
4446
    			this.workingCopy,
4447
    			false);
4434
    	assertNotNull("No node", node);
4448
    	assertNotNull("No node", node);
4435
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
4449
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
4436
    	CompilationUnit compilationUnit = (CompilationUnit) node;
4450
    	CompilationUnit compilationUnit = (CompilationUnit) node;
4437
    	assertProblemsSize(compilationUnit, 0);
4451
    	assertProblemsSize(compilationUnit, 1, "Iterator is a raw type. References to generic type Iterator<E> should be parameterized");
4438
		node = getASTNode(compilationUnit, 0, 0, 0);
4452
		node = getASTNode(compilationUnit, 0, 0, 0);
4439
		assertEquals("not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
4453
		assertEquals("not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
4440
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
4454
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
Lines 5317-5323 Link Here
5317
				"}\n";
5331
				"}\n";
5318
	   	ASTNode node = buildAST(
5332
	   	ASTNode node = buildAST(
5319
				contents,
5333
				contents,
5320
    			this.workingCopy);
5334
    			this.workingCopy,
5335
    			false);
5321
		ITypeBinding type = ((Expression)node).resolveTypeBinding();
5336
		ITypeBinding type = ((Expression)node).resolveTypeBinding();
5322
		assertTrue("Should be one bound", type.getTypeBounds().length == 1);
5337
		assertTrue("Should be one bound", type.getTypeBounds().length == 1);
5323
		assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName());
5338
		assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName());
Lines 5360-5366 Link Here
5360
				"}\n";
5375
				"}\n";
5361
	   	ASTNode node = buildAST(
5376
	   	ASTNode node = buildAST(
5362
				contents,
5377
				contents,
5363
    			this.workingCopy);
5378
    			this.workingCopy,
5379
    			false);
5364
		ITypeBinding type = ((Expression)node).resolveTypeBinding();
5380
		ITypeBinding type = ((Expression)node).resolveTypeBinding();
5365
		assertTrue("Should be one bound", type.getTypeBounds().length == 1);
5381
		assertTrue("Should be one bound", type.getTypeBounds().length == 1);
5366
		assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName());
5382
		assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName());
Lines 5603-5609 Link Here
5603
		final ASTNode result = runJLS3Conversion(sourceUnit, true, true);
5619
		final ASTNode result = runJLS3Conversion(sourceUnit, true, true);
5604
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
5620
		assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT);
5605
		final CompilationUnit compilationUnit = (CompilationUnit) result;
5621
		final CompilationUnit compilationUnit = (CompilationUnit) result;
5606
	   	assertProblemsSize(compilationUnit, 1, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>");
5622
	   	assertProblemsSize(compilationUnit, 2, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>\n" + 
5623
	   			"ArrayList is a raw type. References to generic type ArrayList<T> should be parameterized");
5607
	}
5624
	}
5608
	
5625
	
5609
	/*
5626
	/*
Lines 5645-5651 Link Here
5645
			"}";
5662
			"}";
5646
    	ASTNode node = buildAST(
5663
    	ASTNode node = buildAST(
5647
    			contents,
5664
    			contents,
5648
    			this.workingCopy);
5665
    			this.workingCopy,
5666
    			false);
5649
    	assertEquals("Not a type parameter", ASTNode.TYPE_PARAMETER, node.getNodeType());
5667
    	assertEquals("Not a type parameter", ASTNode.TYPE_PARAMETER, node.getNodeType());
5650
    	ITypeBinding typeBinding = ((TypeParameter) node).resolveBinding();
5668
    	ITypeBinding typeBinding = ((TypeParameter) node).resolveBinding();
5651
    	assertNotNull("No binding", typeBinding);
5669
    	assertNotNull("No binding", typeBinding);
Lines 5690-5696 Link Here
5690
				"		return null;\n" + 
5708
				"		return null;\n" + 
5691
				"	}\n" + 
5709
				"	}\n" + 
5692
				"}",
5710
				"}",
5693
				this.workingCopy);
5711
				this.workingCopy,
5712
				false);
5694
			MethodInvocation method = (MethodInvocation) node;
5713
			MethodInvocation method = (MethodInvocation) node;
5695
			IMethodBinding methodBinding = method.resolveMethodBinding();
5714
			IMethodBinding methodBinding = method.resolveMethodBinding();
5696
			assertBindingEquals(
5715
			assertBindingEquals(
Lines 5747-5753 Link Here
5747
			"}";
5766
			"}";
5748
    	ASTNode node = buildAST(
5767
    	ASTNode node = buildAST(
5749
    			contents,
5768
    			contents,
5750
    			this.workingCopy);
5769
    			this.workingCopy,
5770
    			false);
5751
    	assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
5771
    	assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
5752
    	VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
5772
    	VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
5753
    	List modifiers = statement.modifiers();
5773
    	List modifiers = statement.modifiers();
Lines 5821-5827 Link Here
5821
			"}";
5841
			"}";
5822
    	ASTNode node = buildAST(
5842
    	ASTNode node = buildAST(
5823
    			contents,
5843
    			contents,
5824
    			this.workingCopy);
5844
    			this.workingCopy,
5845
    			false);
5825
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5846
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5826
    	CompilationUnit unit = (CompilationUnit) node;
5847
    	CompilationUnit unit = (CompilationUnit) node;
5827
    	node = getASTNode(unit, 0, 0, 2);
5848
    	node = getASTNode(unit, 0, 0, 2);
Lines 5848-5854 Link Here
5848
			"}";
5869
			"}";
5849
    	ASTNode node = buildAST(
5870
    	ASTNode node = buildAST(
5850
    			contents,
5871
    			contents,
5851
    			this.workingCopy);
5872
    			this.workingCopy,
5873
    			false);
5852
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5874
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5853
    	CompilationUnit unit = (CompilationUnit) node;
5875
    	CompilationUnit unit = (CompilationUnit) node;
5854
    	node = getASTNode(unit, 0, 0, 2);
5876
    	node = getASTNode(unit, 0, 0, 2);
Lines 6759-6767 Link Here
6759
    			false);
6781
    			false);
6760
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6782
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6761
		CompilationUnit unit = (CompilationUnit) node;
6783
		CompilationUnit unit = (CompilationUnit) node;
6762
		String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + 
6784
		String expectedOutput =
6763
		"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized";
6785
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
6764
		assertProblemsSize(unit, 2, expectedOutput);
6786
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
6787
			"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + 
6788
			"Y is a raw type. References to generic type Y<T> should be parameterized\n" + 
6789
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
6790
			"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + 
6791
			"Y is a raw type. References to generic type Y<T> should be parameterized";
6792
		assertProblemsSize(unit, 7, expectedOutput);
6765
		node = getASTNode(unit, 1, 0, 0);
6793
		node = getASTNode(unit, 1, 0, 0);
6766
		assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
6794
		assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
6767
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
6795
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
Lines 6807-6813 Link Here
6807
    			false);
6835
    			false);
6808
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6836
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6809
		CompilationUnit unit = (CompilationUnit) node;
6837
		CompilationUnit unit = (CompilationUnit) node;
6810
		assertProblemsSize(unit, 0);
6838
		String expectedOutput =
6839
			"Generic is a raw type. References to generic type Generic<E> should be parameterized\n" + 
6840
			"Collection is a raw type. References to generic type Collection<T> should be parameterized";			
6841
		assertProblemsSize(unit, 2, expectedOutput);
6811
		node = getASTNode(unit, 1, 0);
6842
		node = getASTNode(unit, 1, 0);
6812
		assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
6843
		assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
6813
		FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
6844
		FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
(-)workspace/Converter15/src/test0015/X.java (-1 / +1 lines)
Lines 1-4 Link Here
1
package test0015;
1
package test0015;
2
2
3
public class X<A extends Object & java.io.Serializable & Comparable> {
3
public class X<A extends Object & java.io.Serializable & Comparable<?>> {
4
}
4
}

Return to bug 159456