### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core 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 14 Oct 2008 19:47:23 -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/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 14 Oct 2008 19:47:27 -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" +