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 51300 Details for
Bug 159456
[1.5][compiler] Enable compiler warning for raw type reference by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Complete patch (jdt.core + updated tests)
patch_159456.txt (text/plain), 48.72 KB, created by
Olivier Thomann
on 2006-10-02 23:27:32 EDT
(
hide
)
Description:
Complete patch (jdt.core + updated tests)
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-10-02 23:27:32 EDT
Size:
48.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java,v >retrieving revision 1.17 >diff -u -r1.17 JavadocTestForClass.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java 2 Jul 2006 12:36:29 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java 3 Oct 2006 03:30:19 -0000 >@@ -34,6 +34,7 @@ > options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java,v >retrieving revision 1.25 >diff -u -r1.25 JavadocBugsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 4 Jul 2006 10:03:46 -0000 1.25 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 3 Oct 2006 03:30:18 -0000 >@@ -72,6 +72,7 @@ > options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation); > options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > /* (non-Javadoc) >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.74 >diff -u -r1.74 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 28 Sep 2006 14:15:10 -0000 1.74 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 3 Oct 2006 03:30:16 -0000 >@@ -1032,7 +1032,7 @@ > " over-ann missing @Override annotation\n" + > " paramAssign assignment to a parameter\n" + > " pkgDefaultMethod + attempt to override package-default method\n" + >- " raw usage of raw type\n" + >+ " raw + usage of raw type\n" + > " semicolon unnecessary semicolon, empty statement\n" + > " serial + missing serialVersionUID\n" + > " specialParamHiding constructor or setter parameter hiding another field\n" + >@@ -1171,7 +1171,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"ignore\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + >@@ -2025,32 +2025,47 @@ > + " -d \"" + OUTPUT_DIR + "\"", > "", > "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + >+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 8)\n" + >+ " private final Map<Class<? extends X>, \n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 10)\n" + >+ " m1 = new HashMap<Class<? extends X>, \n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 22)\n" + >+ " Y l1 = m1.get(p1);\n" + >+ " ^\n" + >+ "Y is a raw type. References to generic type Y<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + > " m1.put(p1, l1);\n" + > " ^^\n" + > "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + > "----------\n" + >- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + >+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + > " return l1;\n" + > " ^^\n" + > "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + > "----------\n" + >- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + >+ "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + > " m2.put((XX<?, XY>) p1, p2);\n" + > " ^^^^^^^^^^^^^^\n" + > "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + > "----------\n" + >- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + >+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + > " final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + > " ^^\n" + > "The local variable l1 is never read\n" + > "----------\n" + >- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + >+ "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + > " final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + > " ^^^^^^^^^^^^^^^^^^^^^^\n" + >- "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" + >+ "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" + > "----------\n" + >- "5 problems (5 warnings)", >+ "8 problems (8 warnings)", > true); > // second series shows that a staged build - that simulates the auto build context - is OK as well > this.runConformTest( >@@ -2190,32 +2205,47 @@ > + " -d \"" + OUTPUT_DIR + "\"", > "", > "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + >+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 8)\n" + >+ " private final Map<Class<? extends X>, \n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 10)\n" + >+ " m1 = new HashMap<Class<? extends X>, \n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 22)\n" + >+ " Y l1 = m1.get(p1);\n" + >+ " ^\n" + >+ "Y is a raw type. References to generic type Y<T,U,V> should be parameterized\n" + >+ "----------\n" + >+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 25)\n" + > " m1.put(p1, l1);\n" + > " ^^\n" + > "Type safety: The expression of type Y needs unchecked conversion to conform to Y<?,? extends X.XX<?,?>,? extends X.XY>\n" + > "----------\n" + >- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + >+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 27)\n" + > " return l1;\n" + > " ^^\n" + > "Type safety: The expression of type Y needs unchecked conversion to conform to Y<T,U,V>\n" + > "----------\n" + >- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + >+ "6. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 33)\n" + > " m2.put((XX<?, XY>) p1, p2);\n" + > " ^^^^^^^^^^^^^^\n" + > "Type safety: The cast from TT to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + > "----------\n" + >- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + >+ "7. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + > " final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + > " ^^\n" + > "The local variable l1 is never read\n" + > "----------\n" + >- "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + >+ "8. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + > " final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + > " ^^^^^^^^^^^^^^^^^^^^^^\n" + > "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" + > "----------\n" + >- "5 problems (5 warnings)", >+ "8 problems (8 warnings)", > false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104664 >@@ -2411,28 +2441,33 @@ > + " -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + File.separator + "bin2/\"", > "", >- "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + >- " X x1;\n" + >- " ^\n" + >- "Discouraged access: The type X<T> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >- "----------\n" + >- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >- " X<String> x2 = new X<String>();\n" + >- " ^\n" + >- "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >- "----------\n" + >- "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >- " X<String> x2 = new X<String>();\n" + >- " ^^^^^^^^^^^^^^^\n" + >- "Discouraged access: The constructor X<String>() is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >- "----------\n" + >- "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >- " X<String> x2 = new X<String>();\n" + >- " ^\n" + >- "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >- "----------\n" + >- "4 problems (4 warnings)", >+ "----------\n" + >+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + >+ " X x1;\n" + >+ " ^\n" + >+ "Discouraged access: The type X<T> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >+ "----------\n" + >+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 3)\n" + >+ " X x1;\n" + >+ " ^\n" + >+ "X is a raw type. References to generic type X<T> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >+ " X<String> x2 = new X<String>();\n" + >+ " ^\n" + >+ "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >+ "----------\n" + >+ "4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >+ " X<String> x2 = new X<String>();\n" + >+ " ^^^^^^^^^^^^^^^\n" + >+ "Discouraged access: The constructor X<String>() is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >+ "----------\n" + >+ "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" + >+ " X<String> x2 = new X<String>();\n" + >+ " ^\n" + >+ "Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + >+ "----------\n" + >+ "5 problems (5 warnings)", > false); > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java,v >retrieving revision 1.46 >diff -u -r1.46 JavadocTestMixed.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java 29 Mar 2006 03:50:23 -0000 1.46 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java 3 Oct 2006 03:30:24 -0000 >@@ -59,6 +59,7 @@ > options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > /* (non-Javadoc) >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java,v >retrieving revision 1.36 >diff -u -r1.36 CastTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java 27 Sep 2006 08:40:13 -0000 1.36 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java 3 Oct 2006 03:30:16 -0000 >@@ -30,6 +30,7 @@ > protected Map getCompilerOptions() { > Map defaultOptions = super.getCompilerOptions(); > defaultOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING); >+ defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return defaultOptions; > } > public static Test suite() { >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java,v >retrieving revision 1.18 >diff -u -r1.18 JavadocTestForConstructor.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java 2 Jul 2006 12:36:29 -0000 1.18 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java 3 Oct 2006 03:30:19 -0000 >@@ -36,6 +36,7 @@ > options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java,v >retrieving revision 1.16 >diff -u -r1.16 JavadocTestForField.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java 2 Jul 2006 12:36:29 -0000 1.16 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java 3 Oct 2006 03:30:20 -0000 >@@ -35,6 +35,7 @@ > options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java,v >retrieving revision 1.21 >diff -u -r1.21 JavadocTestForInterface.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java 2 Jul 2006 12:36:29 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java 3 Oct 2006 03:30:21 -0000 >@@ -36,6 +36,7 @@ > options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > >Index: src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java,v >retrieving revision 1.47 >diff -u -r1.47 NullReferenceTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 26 Sep 2006 13:00:45 -0000 1.47 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 3 Oct 2006 03:30:27 -0000 >@@ -49,6 +49,7 @@ > Map defaultOptions = super.getCompilerOptions(); > // defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING); > defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR); >+ defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > // defaultOptions.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.WARNING); > return defaultOptions; > } >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java,v >retrieving revision 1.23 >diff -u -r1.23 JavadocTestForMethod.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 2 Jul 2006 12:36:29 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 3 Oct 2006 03:30:24 -0000 >@@ -46,6 +46,7 @@ > options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); > options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > >Index: src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java,v >retrieving revision 1.30 >diff -u -r1.30 DebugEvaluationTest.java >--- src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java 29 Mar 2006 03:52:03 -0000 1.30 >+++ src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java 3 Oct 2006 03:30:29 -0000 >@@ -145,6 +145,7 @@ > options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); > options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE); > options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > return options; > } > public void initialize(CompilerTestSetup setUp) { >Index: src/org/eclipse/jdt/core/tests/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java,v >retrieving revision 1.49 >diff -u -r1.49 Util.java >--- src/org/eclipse/jdt/core/tests/util/Util.java 14 Sep 2006 13:18:04 -0000 1.49 >+++ src/org/eclipse/jdt/core/tests/util/Util.java 3 Oct 2006 03:30:29 -0000 >@@ -238,6 +238,7 @@ > options.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); >+ options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); > createJar(pathsAndContents, options, jarPath); > } > public static void createSourceZip(String[] pathsAndContents, String zipPath) throws IOException { >#P org.eclipse.jdt.core.tests.builder >Index: src/org/eclipse/jdt/core/tests/builder/DependencyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java,v >retrieving revision 1.18 >diff -u -r1.18 DependencyTests.java >--- src/org/eclipse/jdt/core/tests/builder/DependencyTests.java 29 Mar 2006 03:16:23 -0000 1.18 >+++ src/org/eclipse/jdt/core/tests/builder/DependencyTests.java 3 Oct 2006 03:30:30 -0000 >@@ -1019,7 +1019,7 @@ > fullBuild(projectPath); > expectingNoProblems(); > >- env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$ >+ IPath aPath = env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$ > "package p1;\n"+ //$NON-NLS-1$ > "public class A {}\n" //$NON-NLS-1$ > ); >@@ -1034,8 +1034,9 @@ > ); > > incrementalBuild(projectPath); >- expectingOnlyProblemsFor(new IPath[] {bPath}); >+ expectingOnlyProblemsFor(new IPath[] {aPath, bPath}); > 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$ >+ 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$ > > env.addClass(root, "p1", "A", //$NON-NLS-1$ //$NON-NLS-2$ > "package p1;\n"+ //$NON-NLS-1$ >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/JavaCore.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v >retrieving revision 1.551 >diff -u -r1.551 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 29 Sep 2006 17:13:57 -0000 1.551 >+++ model/org/eclipse/jdt/core/JavaCore.java 3 Oct 2006 03:30:35 -0000 >@@ -2042,7 +2042,7 @@ > * reject raw references to generic types. > * - option id: "org.eclipse.jdt.core.compiler.problem.rawTypeReference" > * - possible values: { "error", "warning", "ignore" } >- * - default: "ignore" >+ * - default: "warning" > * > * COMPILER / Reporting final Bound for Type Parameter > * When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a >Index: batch/org/eclipse/jdt/internal/compiler/batch/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties,v >retrieving revision 1.566 >diff -u -r1.566 messages.properties >--- batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 28 Sep 2006 14:14:29 -0000 1.566 >+++ batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 3 Oct 2006 03:30:32 -0000 >@@ -232,7 +232,7 @@ > \ over-ann missing @Override annotation\n\ > \ paramAssign assignment to a parameter\n\ > \ pkgDefaultMethod + attempt to override package-default method\n\ >-\ raw usage of raw type\n\ >+\ raw + usage of raw type\n\ > \ semicolon unnecessary semicolon, empty statement\n\ > \ serial + missing serialVersionUID\n\ > \ specialParamHiding constructor or setter parameter hiding another field\n\ >Index: buildnotes_jdt-core.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v >retrieving revision 1.5431 >diff -u -r1.5431 buildnotes_jdt-core.html >--- buildnotes_jdt-core.html 2 Oct 2006 16:28:40 -0000 1.5431 >+++ buildnotes_jdt-core.html 3 Oct 2006 03:30:32 -0000 >@@ -51,6 +51,10 @@ > <br>Project org.eclipse.jdt.core v_715 > (<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_715">cvs</a>). > <h2>What's new in this drop</h2> >+<ul> >+<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. >+</li> >+</ul> > > <h3>Problem Reports Fixed</h3> > <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=155824">155824</a> >Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.169 >diff -u -r1.169 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 17 Jul 2006 11:40:10 -0000 1.169 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 3 Oct 2006 03:30:32 -0000 >@@ -205,6 +205,7 @@ > | AssertUsedAsAnIdentifier > | EnumUsedAsAnIdentifier > | UncheckedTypeOperation >+ | RawTypeReference > | MissingSerialVersion > | VarargsArgumentNeedCast > | ForbiddenReference >#P org.eclipse.jdt.core.tests.model >Index: workspace/Converter15/src/test0063/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0063/X.java,v >retrieving revision 1.1 >diff -u -r1.1 X.java >--- workspace/Converter15/src/test0063/X.java 9 Nov 2004 21:36:53 -0000 1.1 >+++ workspace/Converter15/src/test0063/X.java 3 Oct 2006 03:30:42 -0000 >@@ -8,6 +8,6 @@ > return new X<String>(); > } > >- public void bar(List<? extends X> c) { >+ public void bar(List<? extends X<?>> c) { > } > } >\ No newline at end of file >Index: workspace/Converter15/src/test0065/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0065/X.java,v >retrieving revision 1.1 >diff -u -r1.1 X.java >--- workspace/Converter15/src/test0065/X.java 9 Nov 2004 23:19:00 -0000 1.1 >+++ workspace/Converter15/src/test0065/X.java 3 Oct 2006 03:30:42 -0000 >@@ -2,12 +2,12 @@ > > import java.util.List; > >-public class X<T, U extends List> { >+public class X<T, U extends List<?>> { > > Object foo() { >- return new X<String, List>(); >+ return new X<String, List<?>>(); > } > >- public void bar(List<? extends X> c) { >+ public void bar(List<? extends X<?, ?>> c) { > } > } >\ No newline at end of file >Index: workspace/Converter15/src/test0007/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0007/X.java,v >retrieving revision 1.3 >diff -u -r1.3 X.java >--- workspace/Converter15/src/test0007/X.java 10 Nov 2004 19:13:16 -0000 1.3 >+++ workspace/Converter15/src/test0007/X.java 3 Oct 2006 03:30:42 -0000 >@@ -4,7 +4,7 @@ > import static java.io.File.*; > > public class X { >- Map foo() { >+ Map<String, String> foo() { > return null; > } > >Index: src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java,v >retrieving revision 1.6 >diff -u -r1.6 AccessRestrictionsTests.java >--- src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java 29 Mar 2006 04:03:07 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java 3 Oct 2006 03:30:41 -0000 >@@ -556,6 +556,7 @@ > p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > this.problemRequestor = new ProblemRequestor(); > x = getWorkingCopy( > "/P1/src/p/X.java", >@@ -578,6 +579,7 @@ > p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > IClasspathEntry[] classpath = p2.getRawClasspath(); > int length = classpath.length; > System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length); >@@ -646,6 +648,7 @@ > p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > this.problemRequestor = new ProblemRequestor(); > x = getWorkingCopy( > "/P1/src/p/X.java", >@@ -671,6 +674,7 @@ > p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > IClasspathEntry[] classpath = p2.getRawClasspath(); > int length = classpath.length; > System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length); >@@ -739,6 +743,7 @@ > p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > this.problemRequestor = new ProblemRequestor(); > x1 = getWorkingCopy( > "/P1/src/p/X1.java", >@@ -828,6 +833,7 @@ > p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > this.problemRequestor = new ProblemRequestor(); > x1 = getWorkingCopy( > "/P1/src/p/X1.java", >@@ -916,6 +922,7 @@ > p1.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p1.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p1.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > this.problemRequestor = new ProblemRequestor(); > x1 = getWorkingCopy( > "/P1/src/p/X1.java", >@@ -953,6 +960,7 @@ > p2.setOption("org.eclipse.jdt.core.compiler.compliance", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.source", "1.5"); > p2.setOption("org.eclipse.jdt.core.compiler.targetPlatform", "1.5"); >+ p2.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > IClasspathEntry[] classpath = p2.getRawClasspath(); > int length = classpath.length; > System.arraycopy(classpath, 0, classpath = new IClasspathEntry[length+1], 0, length); >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.103 >diff -u -r1.103 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 1 Sep 2006 08:41:14 -0000 1.103 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 3 Oct 2006 03:30:42 -0000 >@@ -213,6 +213,7 @@ > JavaCore.VERSION_1_5 > ); > project15.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE); >+ project15.setOption(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaCore.IGNORE); > } > private void setUp15WorkingCopy() throws JavaModelException { > setUp15WorkingCopy("Reconciler15/src/p1/X.java", new WorkingCopyOwner() {}); >Index: workspace/Converter15/src/test0064/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0064/X.java,v >retrieving revision 1.1 >diff -u -r1.1 X.java >--- workspace/Converter15/src/test0064/X.java 9 Nov 2004 23:17:05 -0000 1.1 >+++ workspace/Converter15/src/test0064/X.java 3 Oct 2006 03:30:42 -0000 >@@ -8,6 +8,6 @@ > return new X<String, Integer>(); > } > >- public void bar(List<? extends X> c) { >+ public void bar(List<? extends X<?,?>> c) { > } > } >\ No newline at end of file >Index: workspace/Converter15/src/test0008/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0008/X.java,v >retrieving revision 1.3 >diff -u -r1.3 X.java >--- workspace/Converter15/src/test0008/X.java 10 Nov 2004 19:13:16 -0000 1.3 >+++ workspace/Converter15/src/test0008/X.java 3 Oct 2006 03:30:42 -0000 >@@ -4,7 +4,7 @@ > import static java.io.File.*; > > public class X { >- Map foo() { >+ Map<String, String> foo() { > return null; > } > >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.212 >diff -u -r1.212 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 25 Sep 2006 08:48:11 -0000 1.212 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 3 Oct 2006 03:30:41 -0000 >@@ -523,7 +523,7 @@ > assertEquals("Wrong size", 1, typeParameters.size()); > TypeParameter typeParameter = (TypeParameter) typeParameters.get(0); > checkSourceRange(typeParameter.getName(), "A", source); >- checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable", source); >+ checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable<?>", source); > List typeBounds = typeParameter.typeBounds(); > assertEquals("Wrong size", 3, typeBounds.size()); > Type typeBound = (Type) typeBounds.get(0); >@@ -531,7 +531,7 @@ > typeBound = (Type) typeBounds.get(1); > checkSourceRange(typeBound, "java.io.Serializable", source); > typeBound = (Type) typeBounds.get(2); >- checkSourceRange(typeBound, "Comparable", source); >+ checkSourceRange(typeBound, "Comparable<?>", source); > } > > public void test0016() throws JavaModelException { >@@ -1746,7 +1746,8 @@ > " <T extends Exception & Runnable> void foo(T t) {\n" + > " }\n" + > "}/*end*/", >- this.workingCopy); >+ this.workingCopy, >+ false); > MethodDeclaration[] methods = ((TypeDeclaration) node).getMethods(); > int length = methods.length; > String[] keys = new String[length]; >@@ -1787,7 +1788,8 @@ > "public class X<T> {\n" + > " /*start*/X<Class>/*end*/ f;\n" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > IBinding binding = ((Type) node).resolveBinding(); > assertBindingKeyEquals( > "Lp/X<Ljava/lang/Class<>;>;", >@@ -1824,7 +1826,7 @@ > SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); > Type type = declaration.getType(); > typeBinding = type.resolveBinding(); >- assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X>", typeBinding.getQualifiedName()); >+ assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X<?>>", typeBinding.getQualifiedName()); > } > > /** >@@ -1858,7 +1860,7 @@ > SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); > Type type = declaration.getType(); > typeBinding = type.resolveBinding(); >- assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X>", typeBinding.getQualifiedName()); >+ assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X<?,?>>", typeBinding.getQualifiedName()); > } > > /** >@@ -1885,7 +1887,7 @@ > Expression expression = returnStatement.getExpression(); > typeBinding = expression.resolveTypeBinding(); > assertTrue("Not parameterized", typeBinding.isParameterizedType()); >- assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List>", typeBinding.getQualifiedName()); >+ assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List<?>>", typeBinding.getQualifiedName()); > node = getASTNode(compilationUnit, 0, 1); > assertEquals("Wrong node", ASTNode.METHOD_DECLARATION, node.getNodeType()); > MethodDeclaration methodDeclaration = (MethodDeclaration) node; >@@ -1894,7 +1896,7 @@ > SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); > Type type = declaration.getType(); > typeBinding = type.resolveBinding(); >- assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X>", typeBinding.getQualifiedName()); >+ assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X<?,?>>", typeBinding.getQualifiedName()); > } > > /* >@@ -1908,7 +1910,8 @@ > "public class X<T> {\n" + > " /*start*/X/*end*/ field;" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > IBinding binding = ((Type) node).resolveBinding(); > assertBindingKeyEquals( > "Lp/X<>;", >@@ -2412,8 +2415,12 @@ > assertNotNull(result); > assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); > CompilationUnit compilationUnit = (CompilationUnit) result; >- String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized"; >- assertProblemsSize(compilationUnit, 1, expectedOutput); >+ String expectedOutput = >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + >+ "Y is a raw type. References to generic type Y<T> should be parameterized"; >+ assertProblemsSize(compilationUnit, 4, expectedOutput); > ASTNode node = getASTNode(compilationUnit, 1, 0, 0); > assertEquals("Not a method declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -2440,7 +2447,10 @@ > assertNotNull(result); > assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); > CompilationUnit compilationUnit = (CompilationUnit) result; >- assertProblemsSize(compilationUnit, 0); >+ String expectedOutput = >+ "Gen is a raw type. References to generic type Gen<X> should be parameterized\n" + >+ "Gen.Inn is a raw type. References to generic type Gen<X>.Inn should be parameterized"; >+ assertProblemsSize(compilationUnit, 2, expectedOutput); > ASTNode node = getASTNode(compilationUnit, 0); > assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); > TypeDeclaration typeDeclaration = (TypeDeclaration) node; >@@ -3472,7 +3482,8 @@ > "public class X<E> {\n" + > " /*start*/X<String>/*end*/ field;\n" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); > assertBindingEquals( > "LX<TE;>;", >@@ -3488,7 +3499,8 @@ > "public class X<E> {\n" + > " /*start*/X/*end*/ field;\n" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); > assertBindingEquals( > "LX<TE;>;", >@@ -3581,7 +3593,8 @@ > "public class X<E> {\n" + > " /*start*/X/*end*/ field;\n" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > ITypeBinding binding = type.resolveBinding().getErasure(); > assertBindingEquals( > "LX<TE;>;", >@@ -4430,11 +4443,12 @@ > "}"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > assertNotNull("No node", node); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit compilationUnit = (CompilationUnit) node; >- assertProblemsSize(compilationUnit, 0); >+ assertProblemsSize(compilationUnit, 1, "Iterator is a raw type. References to generic type Iterator<E> should be parameterized"); > node = getASTNode(compilationUnit, 0, 0, 0); > assertEquals("not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -5317,7 +5331,8 @@ > "}\n"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > ITypeBinding type = ((Expression)node).resolveTypeBinding(); > assertTrue("Should be one bound", type.getTypeBounds().length == 1); > assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); >@@ -5360,7 +5375,8 @@ > "}\n"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > ITypeBinding type = ((Expression)node).resolveTypeBinding(); > assertTrue("Should be one bound", type.getTypeBounds().length == 1); > assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); >@@ -5603,7 +5619,8 @@ > final ASTNode result = runJLS3Conversion(sourceUnit, true, true); > assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); > final CompilationUnit compilationUnit = (CompilationUnit) result; >- assertProblemsSize(compilationUnit, 1, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>"); >+ assertProblemsSize(compilationUnit, 2, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>\n" + >+ "ArrayList is a raw type. References to generic type ArrayList<T> should be parameterized"); > } > > /* >@@ -5645,7 +5662,8 @@ > "}"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > assertEquals("Not a type parameter", ASTNode.TYPE_PARAMETER, node.getNodeType()); > ITypeBinding typeBinding = ((TypeParameter) node).resolveBinding(); > assertNotNull("No binding", typeBinding); >@@ -5690,7 +5708,8 @@ > " return null;\n" + > " }\n" + > "}", >- this.workingCopy); >+ this.workingCopy, >+ false); > MethodInvocation method = (MethodInvocation) node; > IMethodBinding methodBinding = method.resolveMethodBinding(); > assertBindingEquals( >@@ -5747,7 +5766,8 @@ > "}"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; > List modifiers = statement.modifiers(); >@@ -5821,7 +5841,8 @@ > "}"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; > node = getASTNode(unit, 0, 0, 2); >@@ -5848,7 +5869,8 @@ > "}"; > ASTNode node = buildAST( > contents, >- this.workingCopy); >+ this.workingCopy, >+ false); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; > node = getASTNode(unit, 0, 0, 2); >@@ -6759,9 +6781,15 @@ > false); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + >- "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized"; >- assertProblemsSize(unit, 2, expectedOutput); >+ String expectedOutput = >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + >+ "Y is a raw type. References to generic type Y<T> should be parameterized\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + >+ "Y is a raw type. References to generic type Y<T> should be parameterized"; >+ assertProblemsSize(unit, 7, expectedOutput); > node = getASTNode(unit, 1, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -6807,7 +6835,10 @@ > false); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- assertProblemsSize(unit, 0); >+ String expectedOutput = >+ "Generic is a raw type. References to generic type Generic<E> should be parameterized\n" + >+ "Collection is a raw type. References to generic type Collection<T> should be parameterized"; >+ assertProblemsSize(unit, 2, expectedOutput); > node = getASTNode(unit, 1, 0); > assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType()); > FieldDeclaration fieldDeclaration = (FieldDeclaration) node; >Index: workspace/Converter15/src/test0015/X.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0015/X.java,v >retrieving revision 1.2 >diff -u -r1.2 X.java >--- workspace/Converter15/src/test0015/X.java 1 Jul 2004 09:32:03 -0000 1.2 >+++ workspace/Converter15/src/test0015/X.java 3 Oct 2006 03:30:42 -0000 >@@ -1,4 +1,4 @@ > package test0015; > >-public class X<A extends Object & java.io.Serializable & Comparable> { >+public class X<A extends Object & java.io.Serializable & Comparable<?>> { > } >\ No newline at end of file
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 159456
:
51251
| 51300 |
51301