### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java,v retrieving revision 1.16 diff -u -r1.16 ClassFileConstants.java --- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 20 Jan 2006 03:44:05 -0000 1.16 +++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 26 Jan 2006 22:24:28 -0000 @@ -45,7 +45,9 @@ * Extra flags for types and members attributes. */ int AccAnnotationDefault = ASTNode.Bit18; // indicate presence of an attribute "DefaultValue" (annotation method) - int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated" + int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated" + int AccHierarchyInconsistent = ASTNode.Bit22; + int Utf8Tag = 1; int IntegerTag = 3; int FloatTag = 4; Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java,v retrieving revision 1.71 diff -u -r1.71 ClassFileReader.java --- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 24 Jan 2006 18:27:37 -0000 1.71 +++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 26 Jan 2006 22:24:28 -0000 @@ -283,6 +283,8 @@ } } } + } else if (CharOperation.equals(attributeName, AttributeNamesConstants.InconsistentHierarchy)) { + this.accessFlags |= ClassFileConstants.AccHierarchyInconsistent; } break; case 'S' : Index: compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java,v retrieving revision 1.14 diff -u -r1.14 AttributeNamesConstants.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 13 Jan 2006 16:37:15 -0000 1.14 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 26 Jan 2006 22:24:28 -0000 @@ -28,5 +28,6 @@ final char[] RuntimeVisibleAnnotationsName = "RuntimeVisibleAnnotations".toCharArray(); //$NON-NLS-1$ final char[] RuntimeInvisibleParameterAnnotationsName = "RuntimeInvisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$ final char[] RuntimeVisibleParameterAnnotationsName = "RuntimeVisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$ - final char[] StackMapTableName = "StackMapTable".toCharArray(); //$NON-NLS-1$ + final char[] StackMapTableName = "StackMapTable".toCharArray(); //$NON-NLS-1$ + final char[] InconsistentHierarchy = "InconsistentHierarchy".toCharArray(); //$NON-NLS-1$ } Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.270 diff -u -r1.270 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 26 Jan 2006 15:31:04 -0000 1.270 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 26 Jan 2006 22:24:28 -0000 @@ -2334,8 +2334,6 @@ if (field.isSynthetic()) continue next; - if (field.name == ClassScope.IncompleteHierarchy) continue next; - if (onlyStaticFields && !field.isStatic()) continue next; if (fieldLength > field.name.length) continue next; Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v retrieving revision 1.122 diff -u -r1.122 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 20 Jan 2006 03:44:06 -0000 1.122 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 26 Jan 2006 22:24:28 -0000 @@ -684,6 +684,23 @@ } } } + + if (this.referenceBinding.isHierarchyInconsistent()) { + // add an attribute for inconsistent hierarchy + if (contentsOffset + 6 >= contents.length) { + resizeContents(6); + } + int inconsistentHierarchyNameIndex = + constantPool.literalIndex(AttributeNamesConstants.InconsistentHierarchy); + contents[contentsOffset++] = (byte) (inconsistentHierarchyNameIndex >> 8); + contents[contentsOffset++] = (byte) inconsistentHierarchyNameIndex; + // the length of an inconsistent hierarchy attribute is equals to 0 + contents[contentsOffset++] = 0; + contents[contentsOffset++] = 0; + contents[contentsOffset++] = 0; + contents[contentsOffset++] = 0; + attributeNumber++; + } // update the number of attributes if (attributeOffset + 2 >= this.contents.length) { resizeContents(2); 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.128 diff -u -r1.128 ClassScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 10 Jan 2006 14:37:28 -0000 1.128 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 26 Jan 2006 22:24:29 -0000 @@ -32,8 +32,6 @@ public TypeDeclaration referenceContext; public TypeReference superTypeReference; - public final static char[] IncompleteHierarchy = new char[] {'h', 'a', 's', ' ', 'i', 'n', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', ' ', 'h', 'i', 'e', 'r', 'a', 'r', 'c', 'h', 'y'}; - public ClassScope(Scope parent, TypeDeclaration context) { super(CLASS_SCOPE, parent); this.referenceContext = context; @@ -58,15 +56,8 @@ } private void buildFields() { - boolean hierarchyIsInconsistent = referenceContext.binding.isHierarchyInconsistent(); if (referenceContext.fields == null) { - if (hierarchyIsInconsistent) { // 72468 - referenceContext.binding.fields = new FieldBinding[1]; - referenceContext.binding.fields[0] = - new FieldBinding(IncompleteHierarchy, TypeBinding.INT, ClassFileConstants.AccPrivate, referenceContext.binding, null); - } else { - referenceContext.binding.fields = Binding.NO_FIELDS; - } + referenceContext.binding.fields = Binding.NO_FIELDS; return; } // count the number of fields vs. initializers @@ -81,8 +72,6 @@ } } - if (hierarchyIsInconsistent) - count++; // iterate the field declarations to create the bindings, lose all duplicates FieldBinding[] fieldBindings = new FieldBinding[count]; HashtableOfObject knownFieldNames = new HashtableOfObject(count); @@ -135,9 +124,6 @@ } fieldBindings = newFieldBindings; } - if (hierarchyIsInconsistent) - fieldBindings[count++] = new FieldBinding(IncompleteHierarchy, TypeBinding.INT, ClassFileConstants.AccPrivate, referenceContext.binding, null); - if (count != fieldBindings.length) System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count); for (int i = 0; i < count; i++)