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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java (-1 / +3 lines)
Lines 45-51 Link Here
45
	 * Extra flags for types and members attributes.
45
	 * Extra flags for types and members attributes.
46
	 */
46
	 */
47
	int AccAnnotationDefault = ASTNode.Bit18; // indicate presence of an attribute  "DefaultValue" (annotation method)
47
	int AccAnnotationDefault = ASTNode.Bit18; // indicate presence of an attribute  "DefaultValue" (annotation method)
48
	int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated"	
48
	int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated"
49
	int AccHierarchyInconsistent = ASTNode.Bit22; 
50
49
	int Utf8Tag = 1;
51
	int Utf8Tag = 1;
50
	int IntegerTag = 3;
52
	int IntegerTag = 3;
51
	int FloatTag = 4;
53
	int FloatTag = 4;
(-)compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java (+2 lines)
Lines 283-288 Link Here
283
								}
283
								}
284
							}
284
							}
285
						}
285
						}
286
					} else if (CharOperation.equals(attributeName, AttributeNamesConstants.InconsistentHierarchy)) {
287
						this.accessFlags |= ClassFileConstants.AccHierarchyInconsistent;
286
					}
288
					}
287
					break;
289
					break;
288
				case 'S' :
290
				case 'S' :
(-)compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java (-1 / +2 lines)
Lines 28-32 Link Here
28
	final char[] RuntimeVisibleAnnotationsName = "RuntimeVisibleAnnotations".toCharArray(); //$NON-NLS-1$
28
	final char[] RuntimeVisibleAnnotationsName = "RuntimeVisibleAnnotations".toCharArray(); //$NON-NLS-1$
29
	final char[] RuntimeInvisibleParameterAnnotationsName = "RuntimeInvisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$
29
	final char[] RuntimeInvisibleParameterAnnotationsName = "RuntimeInvisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$
30
	final char[] RuntimeVisibleParameterAnnotationsName = "RuntimeVisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$
30
	final char[] RuntimeVisibleParameterAnnotationsName = "RuntimeVisibleParameterAnnotations".toCharArray(); //$NON-NLS-1$
31
	final char[] StackMapTableName = "StackMapTable".toCharArray(); //$NON-NLS-1$	
31
	final char[] StackMapTableName = "StackMapTable".toCharArray(); //$NON-NLS-1$
32
	final char[] InconsistentHierarchy = "InconsistentHierarchy".toCharArray(); //$NON-NLS-1$
32
}
33
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-2 lines)
Lines 2334-2341 Link Here
2334
2334
2335
			if (field.isSynthetic())	continue next;
2335
			if (field.isSynthetic())	continue next;
2336
			
2336
			
2337
			if (field.name == ClassScope.IncompleteHierarchy) continue next;
2338
2339
			if (onlyStaticFields && !field.isStatic()) continue next;
2337
			if (onlyStaticFields && !field.isStatic()) continue next;
2340
2338
2341
			if (fieldLength > field.name.length) continue next;
2339
			if (fieldLength > field.name.length) continue next;
(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (+17 lines)
Lines 684-689 Link Here
684
				}
684
				}
685
			}
685
			}
686
		}
686
		}
687
		
688
		if (this.referenceBinding.isHierarchyInconsistent()) {
689
			// add an attribute for inconsistent hierarchy
690
			if (contentsOffset + 6 >= contents.length) {
691
				resizeContents(6);
692
			}
693
			int inconsistentHierarchyNameIndex =
694
				constantPool.literalIndex(AttributeNamesConstants.InconsistentHierarchy);
695
			contents[contentsOffset++] = (byte) (inconsistentHierarchyNameIndex >> 8);
696
			contents[contentsOffset++] = (byte) inconsistentHierarchyNameIndex;
697
			// the length of an inconsistent hierarchy attribute is equals to 0
698
			contents[contentsOffset++] = 0;
699
			contents[contentsOffset++] = 0;
700
			contents[contentsOffset++] = 0;
701
			contents[contentsOffset++] = 0;
702
			attributeNumber++;
703
		}
687
		// update the number of attributes
704
		// update the number of attributes
688
		if (attributeOffset + 2 >= this.contents.length) {
705
		if (attributeOffset + 2 >= this.contents.length) {
689
			resizeContents(2);
706
			resizeContents(2);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (-14 / +1 lines)
Lines 32-39 Link Here
32
	public TypeDeclaration referenceContext;
32
	public TypeDeclaration referenceContext;
33
	public TypeReference superTypeReference;
33
	public TypeReference superTypeReference;
34
34
35
	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'};
36
37
	public ClassScope(Scope parent, TypeDeclaration context) {
35
	public ClassScope(Scope parent, TypeDeclaration context) {
38
		super(CLASS_SCOPE, parent);
36
		super(CLASS_SCOPE, parent);
39
		this.referenceContext = context;
37
		this.referenceContext = context;
Lines 60-72 Link Here
60
	private void buildFields() {
58
	private void buildFields() {
61
		boolean hierarchyIsInconsistent = referenceContext.binding.isHierarchyInconsistent();
59
		boolean hierarchyIsInconsistent = referenceContext.binding.isHierarchyInconsistent();
62
		if (referenceContext.fields == null) {
60
		if (referenceContext.fields == null) {
63
			if (hierarchyIsInconsistent) { // 72468
61
			referenceContext.binding.fields = Binding.NO_FIELDS;
64
				referenceContext.binding.fields = new FieldBinding[1];
65
				referenceContext.binding.fields[0] =
66
					new FieldBinding(IncompleteHierarchy, TypeBinding.INT, ClassFileConstants.AccPrivate, referenceContext.binding, null);
67
			} else {
68
				referenceContext.binding.fields = Binding.NO_FIELDS;
69
			}
70
			return;
62
			return;
71
		}
63
		}
72
		// count the number of fields vs. initializers
64
		// count the number of fields vs. initializers
Lines 81-88 Link Here
81
			}
73
			}
82
		}
74
		}
83
75
84
		if (hierarchyIsInconsistent)
85
			count++;
86
		// iterate the field declarations to create the bindings, lose all duplicates
76
		// iterate the field declarations to create the bindings, lose all duplicates
87
		FieldBinding[] fieldBindings = new FieldBinding[count];
77
		FieldBinding[] fieldBindings = new FieldBinding[count];
88
		HashtableOfObject knownFieldNames = new HashtableOfObject(count);
78
		HashtableOfObject knownFieldNames = new HashtableOfObject(count);
Lines 135-143 Link Here
135
			}
125
			}
136
			fieldBindings = newFieldBindings;
126
			fieldBindings = newFieldBindings;
137
		}
127
		}
138
		if (hierarchyIsInconsistent)
139
			fieldBindings[count++] = new FieldBinding(IncompleteHierarchy, TypeBinding.INT, ClassFileConstants.AccPrivate, referenceContext.binding, null);
140
141
		if (count != fieldBindings.length)
128
		if (count != fieldBindings.length)
142
			System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count);
129
			System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count);
143
		for (int i = 0; i < count; i++)
130
		for (int i = 0; i < count; i++)

Return to bug 124810