### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v retrieving revision 1.150 diff -u -r1.150 ASTConverterTestAST3_2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 29 Sep 2008 15:15:16 -0000 1.150 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 16 Oct 2008 19:28:43 -0000 @@ -1316,7 +1316,7 @@ ASTNode result = runConversion(AST.JLS3, sourceUnit, true); assertTrue("not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); //$NON-NLS-1$ CompilationUnit unit = (CompilationUnit) result; - assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$< + assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$< ASTNode node = getASTNode(unit, 0); assertEquals("Wrong type", ASTNode.TYPE_DECLARATION, node.getNodeType()); TypeDeclaration typeDeclaration = (TypeDeclaration) node; @@ -1326,7 +1326,6 @@ assertEquals("Wrong type", ASTNode.METHOD_DECLARATION, bodyDeclaration.getNodeType()); MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration; assertEquals("Wrong name", "foo", methodDeclaration.getName().getIdentifier()); - assertNull("Got a binding", methodDeclaration.resolveBinding()); bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(1); assertEquals("Wrong type", ASTNode.METHOD_DECLARATION, bodyDeclaration.getNodeType()); assertEquals("Wrong name", "foo", ((MethodDeclaration) bodyDeclaration).getName().getIdentifier()); Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v retrieving revision 1.188 diff -u -r1.188 ASTConverterTest2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 27 Jun 2008 16:02:37 -0000 1.188 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 16 Oct 2008 19:28:42 -0000 @@ -1233,7 +1233,7 @@ ASTNode result = runConversion(sourceUnit, true); assertTrue("not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); //$NON-NLS-1$ CompilationUnit unit = (CompilationUnit) result; - assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$< + assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$< ASTNode node = getASTNode(unit, 0); assertEquals("Wrong type", ASTNode.TYPE_DECLARATION, node.getNodeType()); TypeDeclaration typeDeclaration = (TypeDeclaration) node; @@ -1243,7 +1243,6 @@ assertEquals("Wrong type", ASTNode.METHOD_DECLARATION, bodyDeclaration.getNodeType()); MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration; assertEquals("Wrong name", "foo", methodDeclaration.getName().getIdentifier()); - assertNull("Got a binding", methodDeclaration.resolveBinding()); bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(1); assertEquals("Wrong type", ASTNode.METHOD_DECLARATION, bodyDeclaration.getNodeType()); assertEquals("Wrong name", "foo", ((MethodDeclaration) bodyDeclaration).getName().getIdentifier()); Index: src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java,v retrieving revision 1.16 diff -u -r1.16 CompletionContextTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java 9 Sep 2008 12:43:37 -0000 1.16 +++ src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java 16 Oct 2008 19:28:43 -0000 @@ -4859,6 +4859,7 @@ "completion token location={STATEMENT_START}\n" + "visibleElements={\n" + " source [in addDataDependencies(int)#2 [in Foo [in [Working copy] X.java [in test [in src3 [in Completion]]]]]],\n" + + " addDataDependencies(int) {key=Ltest/X~Foo;.addDataDependencies(I)I} [in Foo [in [Working copy] X.java [in test [in src3 [in Completion]]]]],\n" + " hashCode() {key=Ljava/lang/Object;.hashCode()I} [in Object [in Object.class [in java.lang [in "+jclPath+"]]]],\n" + "}", result.context); #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v retrieving revision 1.165 diff -u -r1.165 SourceTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 3 Oct 2008 08:45:44 -0000 1.165 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 16 Oct 2008 19:28:44 -0000 @@ -1165,23 +1165,6 @@ } boolean isEnumSpecialMethod = isEnum() && (CharOperation.equals(selector,TypeConstants.VALUEOF) || CharOperation.equals(selector,TypeConstants.VALUES)); // report duplicate - if (methodDecl == null) { - methodDecl = method.sourceMethod(); // cannot be retrieved after binding is lost & may still be null if method is special - if (methodDecl != null && methodDecl.binding != null) { // ensure its a valid user defined method - if (isEnumSpecialMethod) { - this.scope.problemReporter().duplicateEnumSpecialMethod(this, methodDecl); - } else { - this.scope.problemReporter().duplicateMethodInType(this, methodDecl, method.areParametersEqual(method2)); - } - methodDecl.binding = null; - // do not alter original method array until resolution is over, due to reentrance (143259) - if (resolvedMethods == this.methods) { - System.arraycopy(this.methods, 0, resolvedMethods = new MethodBinding[length], 0, length); - } - resolvedMethods[i] = null; - failed++; - } - } AbstractMethodDeclaration method2Decl = method2.sourceMethod(); if (method2Decl != null && method2Decl.binding != null) { // ensure its a valid user defined method if (isEnumSpecialMethod) { @@ -1191,22 +1174,19 @@ } method2Decl.binding = null; // do not alter original method array until resolution is over, due to reentrance (143259) - if (resolvedMethods == this.methods) { + if (resolvedMethods == this.methods) System.arraycopy(this.methods, 0, resolvedMethods = new MethodBinding[length], 0, length); - } resolvedMethods[j] = null; failed++; } } if (method.returnType == null && methodDecl == null) { // forget method with invalid return type... was kept to detect possible collisions methodDecl = method.sourceMethod(); - if (methodDecl != null) { + if (methodDecl != null) methodDecl.binding = null; - } // do not alter original method array until resolution is over, due to reentrance (143259) - if (resolvedMethods == this.methods) { + if (resolvedMethods == this.methods) System.arraycopy(this.methods, 0, resolvedMethods = new MethodBinding[length], 0, length); - } resolvedMethods[i] = null; failed++; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v retrieving revision 1.162 diff -u -r1.162 ClassScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 3 Oct 2008 16:20:02 -0000 1.162 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 16 Oct 2008 19:28:44 -0000 @@ -91,7 +91,6 @@ // iterate the field declarations to create the bindings, lose all duplicates FieldBinding[] fieldBindings = new FieldBinding[count]; HashtableOfObject knownFieldNames = new HashtableOfObject(count); - boolean duplicate = false; count = 0; for (int i = 0; i < size; i++) { FieldDeclaration field = fields[i]; @@ -105,19 +104,6 @@ checkAndSetModifiersForField(fieldBinding, field); if (knownFieldNames.containsKey(field.name)) { - duplicate = true; - FieldBinding previousBinding = (FieldBinding) knownFieldNames.get(field.name); - if (previousBinding != null) { - for (int f = 0; f < i; f++) { - FieldDeclaration previousField = fields[f]; - if (previousField.binding == previousBinding) { - problemReporter().duplicateFieldInType(sourceType, previousField); - previousField.binding = null; - break; - } - } - } - knownFieldNames.put(field.name, null); // ensure that the duplicate field is found & removed problemReporter().duplicateFieldInType(sourceType, field); field.binding = null; } else { @@ -128,20 +114,6 @@ } } // remove duplicate fields - if (duplicate) { - FieldBinding[] newFieldBindings = new FieldBinding[fieldBindings.length]; - // we know we'll be removing at least 1 duplicate name - size = count; - count = 0; - for (int i = 0; i < size; i++) { - FieldBinding fieldBinding = fieldBindings[i]; - if (knownFieldNames.get(fieldBinding.name) != null) { - fieldBinding.id = count; - newFieldBindings[count++] = fieldBinding; - } - } - fieldBindings = newFieldBindings; - } if (count != fieldBindings.length) System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count); sourceType.tagBits &= ~(TagBits.AreFieldsSorted|TagBits.AreFieldsComplete); // in case some static imports reached already into this type #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v retrieving revision 1.162 diff -u -r1.162 MethodVerifyTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 10 Oct 2008 17:24:24 -0000 1.162 +++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 16 Oct 2008 19:28:50 -0000 @@ -3379,17 +3379,12 @@ "class A {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 5)\n" + - " class Y extends X {\n" + - " ^\n" + - "Duplicate methods named id with the parameters (A) and (T) are defined by the type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 6)\n" + + "1. ERROR in X.java (at line 6)\n" + " @Override T id(T x) { return x; }\n" + " ^^^^^^^\n" + - "Method id(T) has the same erasure id(A) as another method in type Y\n" + + "Name clash: The method id(T) of type Y has the same erasure as id(A) of type X but does not override it\n" + "----------\n" + - "3. ERROR in X.java (at line 7)\n" + + "2. ERROR in X.java (at line 7)\n" + " @Override A id(A x) { return x; }\n" + " ^^^^^^^\n" + "Method id(A) has the same erasure id(A) as another method in type Y\n" + @@ -3500,32 +3495,17 @@ "class Z {}" }, "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " Y foo(Object o) { return null; } // duplicate\n" + - " ^^^^^^^^^^^^^\n" + - "Duplicate method foo(Object) in type X.C1\n" + - "----------\n" + - "2. ERROR in X.java (at line 4)\n" + + "1. ERROR in X.java (at line 4)\n" + " Z foo(Object o) { return null; } // duplicate\n" + " ^^^^^^^^^^^^^\n" + "Duplicate method foo(Object) in type X.C1\n" + "----------\n" + - "3. ERROR in X.java (at line 11)\n" + - " A foo(Object o) { return null; } // duplicate\n" + - " ^^^^^^^^^^^^^\n" + - "Duplicate method foo(Object) in type X.C3\n" + - "----------\n" + - "4. ERROR in X.java (at line 12)\n" + + "2. ERROR in X.java (at line 12)\n" + " A foo(Object o) { return null; } // duplicate\n" + " ^^^^^^^^^^^^^\n" + "Duplicate method foo(Object) in type X.C3\n" + "----------\n" + - "5. ERROR in X.java (at line 15)\n" + - " Y foo(Object o) { return null; } // duplicate\n" + - " ^^^^^^^^^^^^^\n" + - "Duplicate method foo(Object) in type X.C4\n" + - "----------\n" + - "6. ERROR in X.java (at line 16)\n" + + "3. ERROR in X.java (at line 16)\n" + " T foo(Object o) { return null; } // duplicate\n" + " ^^^^^^^^^^^^^\n" + "Duplicate method foo(Object) in type X.C4\n" + @@ -3555,12 +3535,7 @@ "class Z {}" }, "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " A foo(A o) { return null; } // duplicate\n" + - " ^^^^^^^^^^^\n" + - "Method foo(A) has the same erasure foo(A) as another method in type X.C5\n" + - "----------\n" + - "2. ERROR in X.java (at line 4)\n" + + "1. ERROR in X.java (at line 4)\n" + " A foo(A o) { return null; } // duplicate\n" + " ^^^^^^^^^^^\n" + "Method foo(A) has the same erasure foo(A) as another method in type X.C5\n" + @@ -3619,12 +3594,7 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " N a(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Method a(A) has the same erasure a(A) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " B a(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Method a(A) has the same erasure a(A) as another method in type X\n" + @@ -3645,12 +3615,7 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " N b(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Method b(A) has the same erasure b(A) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " B b(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Method b(A) has the same erasure b(A) as another method in type X\n" + @@ -3671,12 +3636,7 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " B c(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Method c(A) has the same erasure c(A) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " B c(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Method c(A) has the same erasure c(A) as another method in type X\n" + @@ -3717,22 +3677,12 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " N a(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Duplicate method a(A) in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " B a(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Duplicate method a(A) in type X\n" + "----------\n" + - "3. ERROR in X.java (at line 4)\n" + - " N b(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Method b(A) has the same erasure b(A) as another method in type X\n" + - "----------\n" + - "4. ERROR in X.java (at line 5)\n" + + "2. ERROR in X.java (at line 5)\n" + " B b(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Method b(A) has the same erasure b(A) as another method in type X\n" + @@ -3756,22 +3706,12 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void a(A s) {}\n" + - " ^^^^^^^^^^^^^^\n" + - "Duplicate method a(A) in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " B a(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Duplicate method a(A) in type X\n" + "----------\n" + - "3. ERROR in X.java (at line 4)\n" + - " Object b(A s) { return null; }\n" + - " ^^^^^^^^^^^^^^\n" + - "Duplicate method b(A) in type X\n" + - "----------\n" + - "4. ERROR in X.java (at line 5)\n" + + "2. ERROR in X.java (at line 5)\n" + " B b(A n) { return null; }\n" + " ^^^^^^^^^^^^^^\n" + "Duplicate method b(A) in type X\n" + @@ -3795,22 +3735,12 @@ "class B {}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\r\n" + - " void a(A s) {}\r\n" + - " ^^^^^^^^^^^^^^\n" + - "Duplicate method a(A) in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\r\n" + + "1. ERROR in X.java (at line 3)\r\n" + " B a(A n) { return null; }\r\n" + " ^^^^^^^^^^^^^^\n" + "Duplicate method a(A) in type X\n" + "----------\n" + - "3. ERROR in X.java (at line 4)\r\n" + - " Object b(A s) {}\r\n" + - " ^^^^^^^^^^^^^^\n" + - "Duplicate method b(A) in type X\n" + - "----------\n" + - "4. ERROR in X.java (at line 5)\r\n" + + "2. ERROR in X.java (at line 5)\r\n" + " B b(A n) { return null; }\r\n" + " ^^^^^^^^^^^^^^\n" + "Duplicate method b(A) in type X\n" + @@ -3853,12 +3783,7 @@ "class A {}\n", }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(A a) {}\n" + - " ^^^^^^^^^^^^^^^^\n" + - "Method foo(A) has the same erasure foo(A) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " void foo(A a) {}\n" + " ^^^^^^^^^^^^^^^^^\n" + "Method foo(A) has the same erasure foo(A) as another method in type X\n" + @@ -4003,12 +3928,7 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void a(Object x) {}\n" + - " ^^^^^^^^^^^\n" + - "Method a(Object) has the same erasure a(Object) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " T a(T x) { return null; }\n" + " ^^^^^^\n" + "Method a(T) has the same erasure a(Object) as another method in type X\n" + @@ -4034,12 +3954,7 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 6)\n" + - " String a(X x) { return null; }\n" + - " ^^^^^^\n" + - "Method a(X) has the same erasure a(X) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 7)\n" + + "1. ERROR in X.java (at line 7)\n" + " T a(T x) { return null; }\n" + " ^^^^^^\n" + "Method a(T) has the same erasure a(X) as another method in type X\n" + @@ -4071,12 +3986,7 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\r\n" + - " > void dupT() {}\r\n" + - " ^^^^^^\n" + - "Duplicate method dupT() in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\r\n" + + "1. ERROR in X.java (at line 3)\r\n" + " > Object dupT() {return null;}\r\n" + " ^^^^^^\n" + "Duplicate method dupT() in type X\n" + @@ -5026,12 +4936,7 @@ "interface J {}\n" }, "----------\n" + - "1. ERROR in A.java (at line 2)\r\n" + - " > void foo() { }\r\n" + - " ^^^^^\n" + - "Duplicate method foo() in type A\n" + - "----------\n" + - "2. ERROR in A.java (at line 3)\r\n" + + "1. ERROR in A.java (at line 3)\r\n" + " & J> void foo() { }\r\n" + " ^^^^^\n" + "Duplicate method foo() in type A\n" + @@ -5052,12 +4957,7 @@ "interface K extends J {}" }, "----------\n" + - "1. ERROR in A.java (at line 2)\r\n" + - " > void foo() { }\r\n" + - " ^^^^^\n" + - "Duplicate method foo() in type A\n" + - "----------\n" + - "2. ERROR in A.java (at line 3)\r\n" + + "1. ERROR in A.java (at line 3)\r\n" + " & K> void foo() { }\r\n" + " ^^^^^\n" + "Duplicate method foo() in type A\n" + @@ -5978,54 +5878,59 @@ "5. ERROR in DataSet.java (at line 6)\n" + " public S[] toArray(S[] s) {\n" + " ^^^^^^^^^^^^^^\n" + - "Method toArray(S[]) has the same erasure toArray(Object[]) as another method in type DataSet\n" + + "Name clash: The method toArray(S[]) of type DataSet has the same erasure as toArray(Object[]) of type List but does not override it\n" + + "----------\n" + + "6. ERROR in DataSet.java (at line 6)\n" + + " public S[] toArray(S[] s) {\n" + + " ^^^^^^^^^^^^^^\n" + + "Name clash: The method toArray(S[]) of type DataSet has the same erasure as toArray(Object[]) of type Collection but does not override it\n" + "----------\n" + - "6. ERROR in DataSet.java (at line 9)\n" + + "7. ERROR in DataSet.java (at line 9)\n" + " public Object[] toArray(Object[] o) {\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Method toArray(Object[]) has the same erasure toArray(Object[]) as another method in type DataSet\n" + "----------\n" + - "7. WARNING in DataSet.java (at line 14)\n" + + "8. WARNING in DataSet.java (at line 14)\n" + " public boolean addAll(Collection c) { return false; }\n" + " ^^^^^^^^^^\n" + "Collection is a raw type. References to generic type Collection should be parameterized\n" + "----------\n" + - "8. WARNING in DataSet.java (at line 15)\n" + + "9. WARNING in DataSet.java (at line 15)\n" + " public boolean addAll(int index, Collection c) { return false; }\n" + " ^^^^^^^^^^\n" + "Collection is a raw type. References to generic type Collection should be parameterized\n" + "----------\n" + - "9. WARNING in DataSet.java (at line 18)\n" + + "10. WARNING in DataSet.java (at line 18)\n" + " public boolean containsAll(Collection c) { return false; }\n" + " ^^^^^^^^^^\n" + "Collection is a raw type. References to generic type Collection should be parameterized\n" + "----------\n" + - "10. WARNING in DataSet.java (at line 22)\n" + + "11. WARNING in DataSet.java (at line 22)\n" + " public Iterator iterator() { return null; }\n" + " ^^^^^^^^\n" + "Iterator is a raw type. References to generic type Iterator should be parameterized\n" + "----------\n" + - "11. WARNING in DataSet.java (at line 24)\n" + + "12. WARNING in DataSet.java (at line 24)\n" + " public ListIterator listIterator() { return null; }\n" + " ^^^^^^^^^^^^\n" + "ListIterator is a raw type. References to generic type ListIterator should be parameterized\n" + "----------\n" + - "12. WARNING in DataSet.java (at line 25)\n" + + "13. WARNING in DataSet.java (at line 25)\n" + " public ListIterator listIterator(int index) { return null; }\n" + " ^^^^^^^^^^^^\n" + "ListIterator is a raw type. References to generic type ListIterator should be parameterized\n" + "----------\n" + - "13. WARNING in DataSet.java (at line 28)\n" + + "14. WARNING in DataSet.java (at line 28)\n" + " public boolean removeAll(Collection c) { return false; }\n" + " ^^^^^^^^^^\n" + "Collection is a raw type. References to generic type Collection should be parameterized\n" + "----------\n" + - "14. WARNING in DataSet.java (at line 29)\n" + + "15. WARNING in DataSet.java (at line 29)\n" + " public boolean retainAll(Collection c) { return false; }\n" + " ^^^^^^^^^^\n" + "Collection is a raw type. References to generic type Collection should be parameterized\n" + "----------\n" + - "15. WARNING in DataSet.java (at line 32)\n" + + "16. WARNING in DataSet.java (at line 32)\n" + " public List subList(int fromIndex, int toIndex) { return null; }\n" + " ^^^^\n" + "List is a raw type. References to generic type List should be parameterized\n" + @@ -6219,12 +6124,7 @@ "}" }, "----------\n" + - "1. ERROR in X.java (at line 11)\n" + - " Integer getX(List l) {\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Duplicate method getX(List) in type Y\n" + - "----------\n" + - "2. ERROR in X.java (at line 14)\n" + + "1. ERROR in X.java (at line 14)\n" + " String getX(List l) {\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Duplicate method getX(List) in type Y\n" + @@ -8176,26 +8076,22 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " public MyT method3(D1 harg, D1 oarg, D1 date){\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Method method3(X.D1, X.D1, X.D1) has the same erasure method3(X.D1, X.D1, X.D1) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 7)\n" + + "1. ERROR in X.java (at line 7)\n" + " public MyT method3(D1 harg, D1 oarg, D1 date){\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Method method3(X.D1, X.D1, X.D1) has the same erasure method3(X.D1, X.D1, X.D1) as another method in type X\n" + "----------\n" + - "3. WARNING in X.java (at line 11)\n" + + "2. WARNING in X.java (at line 11)\n" + " public MyT method3(D1 harg, D1 oarg, D1 date, D1 ... notUsed){\n" + " ^^\n" + "X.D1 is a raw type. References to generic type X.D1 should be parameterized\n" + "----------\n" + - "4. WARNING in X.java (at line 15)\n" + + "3. WARNING in X.java (at line 15)\n" + " public MyT method3(D1 harg, D1 oarg, D1 date, D2 ... notUsed){\n" + " ^^\n" + "X.D2 is a raw type. References to generic type X.D2 should be parameterized\n" + - "----------\n"); + "----------\n" + ); } public void test151() { this.runConformTest( Index: src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java,v retrieving revision 1.130 diff -u -r1.130 EnumTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 3 Oct 2008 16:20:03 -0000 1.130 +++ src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 16 Oct 2008 19:28:46 -0000 @@ -176,12 +176,7 @@ "}" }, "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " BLEU, \n" + - " ^^^^\n" + - "Duplicate field X.BLEU\n" + - "----------\n" + - "2. ERROR in X.java (at line 6)\n" + + "1. ERROR in X.java (at line 6)\n" + " BLEU;\n" + " ^^^^\n" + "Duplicate field X.BLEU\n" + @@ -328,32 +323,27 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 7)\n" + - " void dup() {} \n" + - " ^^^^^\n" + - "Duplicate method dup() in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 8)\n" + + "1. ERROR in X.java (at line 8)\n" + " void values() {} \n" + " ^^^^^^^^\n" + "The enum X already defines the method values() implicitly\n" + "----------\n" + - "3. ERROR in X.java (at line 9)\n" + + "2. ERROR in X.java (at line 9)\n" + " void dup() {} \n" + " ^^^^^\n" + "Duplicate method dup() in type X\n" + "----------\n" + - "4. ERROR in X.java (at line 10)\n" + + "3. ERROR in X.java (at line 10)\n" + " void values() {} \n" + " ^^^^^^^^\n" + "The enum X already defines the method values() implicitly\n" + "----------\n" + - "5. ERROR in X.java (at line 11)\n" + + "4. ERROR in X.java (at line 11)\n" + " Missing dup() {} \n" + " ^^^^^^^\n" + "Missing cannot be resolved to a type\n" + "----------\n" + - "6. ERROR in X.java (at line 11)\n" + + "5. ERROR in X.java (at line 11)\n" + " Missing dup() {} \n" + " ^^^^^\n" + "Duplicate method dup() in type X\n" + @@ -1957,16 +1947,27 @@ "}", }, "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " abstract int getSquare();\n" + - " ^^^^^^^^^^^\n" + - "Duplicate method getSquare() in type X\n" + + "1. ERROR in X.java (at line 2)\n" + + " ONE, TWO, THREE;\n" + + " ^^^\n" + + "The enum constant ONE must define the abstract method getSquare()\n" + "----------\n" + - "2. ERROR in X.java (at line 4)\n" + + "2. ERROR in X.java (at line 2)\n" + + " ONE, TWO, THREE;\n" + + " ^^^\n" + + "The enum constant TWO must define the abstract method getSquare()\n" + + "----------\n" + + "3. ERROR in X.java (at line 2)\n" + + " ONE, TWO, THREE;\n" + + " ^^^^^\n" + + "The enum constant THREE must define the abstract method getSquare()\n" + + "----------\n" + + "4. ERROR in X.java (at line 4)\n" + " abstract int getSquare();\n" + " ^^^^^^^^^^^\n" + "Duplicate method getSquare() in type X\n" + - "----------\n"); + "----------\n" + ); } /** Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.758 diff -u -r1.758 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 30 Sep 2008 15:31:35 -0000 1.758 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 16 Oct 2008 19:28:50 -0000 @@ -867,12 +867,7 @@ "}\n" , }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(E e){}\n" + - " ^^^^^^^^\n" + - "Method foo(E) has the same erasure foo(Object) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " void foo(T t){}\n" + " ^^^^^^^^\n" + "Method foo(T) has the same erasure foo(Object) as another method in type X\n" + @@ -889,12 +884,7 @@ "}\n" , }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(E e){}\n" + - " ^^^^^^^^\n" + - "Method foo(E) has the same erasure foo(Exception) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " void foo(T t){}\n" + " ^^^^^^^^\n" + "Method foo(T) has the same erasure foo(Exception) as another method in type X\n" + @@ -911,12 +901,7 @@ "}\n" , }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(E e, Thread t){}\n" + - " ^^^^^^^^^^^^^^^^^^\n" + - "Method foo(E, Thread) has the same erasure foo(Exception, Thread) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " void foo(Exception e, T t){}\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Method foo(Exception, T) has the same erasure foo(Exception, Thread) as another method in type X\n" + @@ -989,22 +974,17 @@ "}\n", }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(L l1){}\n" + - " ^^^^^^^^^^^^\n" + - "Method foo(L) has the same erasure foo(L) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " void foo(L l2){}\n" + " ^^^^^^^^^^^^\n" + "Method foo(L) has the same erasure foo(L) as another method in type X\n" + "----------\n" + - "3. ERROR in X.java (at line 4)\n" + + "2. ERROR in X.java (at line 4)\n" + " void foo(L l){}\n" + " ^^^^^^^^\n" + "Method foo(L) has the same erasure foo(L) as another method in type X\n" + "----------\n" + - "4. WARNING in X.java (at line 4)\n" + + "3. WARNING in X.java (at line 4)\n" + " void foo(L l){}\n" + " ^\n" + "L is a raw type. References to generic type L should be parameterized\n" + @@ -7313,17 +7293,12 @@ "}\n" }, "----------\n" + - "1. ERROR in SubTypes.java (at line 5)\n" + - " @Override public X foo() { return new X(); }\n" + - " ^^^^^\n" + - "Duplicate method foo() in type B\n" + - "----------\n" + - "2. ERROR in SubTypes.java (at line 6)\n" + + "1. ERROR in SubTypes.java (at line 6)\n" + " @Override public B foo() { return this; }\n" + " ^^^^^\n" + "Duplicate method foo() in type B\n" + "----------\n" + - "3. ERROR in SubTypes.java (at line 9)\n" + + "2. ERROR in SubTypes.java (at line 9)\n" + " @Override public X foo() { return new X(); }\n" + " ^\n" + "The return type is incompatible with A.foo()\n" + @@ -39784,32 +39759,27 @@ " ^\n" + "Cannot specify any additional bound T when first bound is a type parameter\n" + "----------\n" + - "2. ERROR in X.java (at line 2)\n" + - " public static , R extends S & T> R max(T arg1, S arg2) {\n" + - " ^^^^^^^^^^^^^^^^^^^\n" + - "Method max(T, S) has the same erasure max(Comparable, Object) as another method in type X\n" + - "----------\n" + - "3. WARNING in X.java (at line 3)\n" + + "2. WARNING in X.java (at line 3)\n" + " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Type safety: Unchecked cast from Object to R\n" + "----------\n" + - "4. ERROR in X.java (at line 6)\n" + + "3. ERROR in X.java (at line 6)\n" + " public static , S, R extends S & Comparable> R max(T arg1, S arg2) {\n" + " ^^^^^^^^^^\n" + "Cannot specify any additional bound Comparable when first bound is a type parameter\n" + "----------\n" + - "5. ERROR in X.java (at line 6)\n" + + "4. ERROR in X.java (at line 6)\n" + " public static , S, R extends S & Comparable> R max(T arg1, S arg2) {\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Method max(T, S) has the same erasure max(Comparable, Object) as another method in type X\n" + "----------\n" + - "6. WARNING in X.java (at line 7)\n" + + "5. WARNING in X.java (at line 7)\n" + " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Type safety: Unchecked cast from Object to R\n" + "----------\n" + - "7. WARNING in X.java (at line 11)\n" + + "6. WARNING in X.java (at line 11)\n" + " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Type safety: Unchecked cast from Object to R\n" + @@ -39903,27 +39873,17 @@ "}" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " void foo(Class c) {};\n" + - " ^^^^^^^^^^^^^^^\n" + - "Method foo(Class) has the same erasure foo(Class) as another method in type X\n" + - "----------\n" + - "2. WARNING in X.java (at line 2)\n" + + "1. WARNING in X.java (at line 2)\n" + " void foo(Class c) {};\n" + " ^\n" + "X is a raw type. References to generic type X should be parameterized\n" + "----------\n" + - "3. ERROR in X.java (at line 3)\n" + + "2. ERROR in X.java (at line 3)\n" + " void foo(Class> c) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Method foo(Class>) has the same erasure foo(Class) as another method in type X\n" + "----------\n" + - "4. ERROR in X.java (at line 4)\n" + - " void foo2(Class> c) {};\n" + - " ^^^^^^^^^^^^^^^^^^^^^^\n" + - "Duplicate method foo2(Class>) in type X\n" + - "----------\n" + - "5. ERROR in X.java (at line 5)\n" + + "3. ERROR in X.java (at line 5)\n" + " void foo2(Class> c) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Duplicate method foo2(Class>) in type X\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java,v retrieving revision 1.54 diff -u -r1.54 AmbiguousMethodTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 27 Jun 2008 16:04:45 -0000 1.54 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 16 Oct 2008 19:28:46 -0000 @@ -391,20 +391,10 @@ "}" }, "----------\n" + - "1. ERROR in X.java (at line 4)\r\n" + - " static Object createParser(L1 l) { return null; }\r\n" + - " ^^^^^^^^^^^^^^^^^^\n" + - "Method createParser(L1) has the same erasure createParser(X.Listener) as another method in type X\n" + - "----------\n" + - "2. ERROR in X.java (at line 5)\r\n" + + "1. ERROR in X.java (at line 5)\r\n" + " static Object createParser(L2 l) { return null; }\r\n" + " ^^^^^^^^^^^^^^^^^^\n" + "Method createParser(L2) has the same erasure createParser(X.ErrorListener) as another method in type X\n" + - "----------\n" + - "3. ERROR in X.java (at line 8)\r\n" + - " createParser(new A());\r\n" + - " ^^^^^^^^^^^^\n" + - "The method createParser(A) is undefined for the type X\n" + "----------\n" ); } @@ -1355,12 +1345,7 @@ "}", }, "----------\n" + - "1. ERROR in J.java (at line 2)\n" + - " T foo(final Number p);\n" + - " ^^^^^^^^^^^^^^^^^^^\n" + - "Duplicate method foo(Number) in type J\n" + - "----------\n" + - "2. ERROR in J.java (at line 3)\n" + + "1. ERROR in J.java (at line 3)\n" + " Float foo(final Number p);\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Duplicate method foo(Number) in type J\n" +