Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Johnson2004-08-26 11:30:49 -0400
committerKent Johnson2004-08-26 11:30:49 -0400
commitdd39a75a6a4637cdaf8d94acd7aef53a8b719c61 (patch)
tree4f1ee088b665f2775d0d30ecd0d7f60cd6dcab58
parentda7e7c455df05c4fdade74608af19cb4c2d54b6b (diff)
downloadeclipse.jdt.core-dd39a75a6a4637cdaf8d94acd7aef53a8b719c61.tar.gz
eclipse.jdt.core-dd39a75a6a4637cdaf8d94acd7aef53a8b719c61.tar.xz
eclipse.jdt.core-dd39a75a6a4637cdaf8d94acd7aef53a8b719c61.zip
72468
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index 575119c453..6d83943540 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -22,7 +22,9 @@ import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
public class ClassScope extends Scope {
public TypeDeclaration referenceContext;
-
+
+ private 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;
@@ -47,8 +49,15 @@ public class ClassScope extends Scope {
}
private void buildFields() {
+ boolean hierarchyIsInconsistent = referenceContext.binding.isHierarchyInconsistent();
if (referenceContext.fields == null) {
- referenceContext.binding.fields = NoFields;
+ if (hierarchyIsInconsistent) { // 72468
+ referenceContext.binding.fields = new FieldBinding[1];
+ referenceContext.binding.fields[0] =
+ new FieldBinding(IncompleteHierarchy, VoidBinding, AccPrivate, referenceContext.binding, null);
+ } else {
+ referenceContext.binding.fields = NoFields;
+ }
return;
}
// count the number of fields vs. initializers
@@ -59,6 +68,8 @@ public class ClassScope extends Scope {
if (fields[i].isField())
count++;
+ if (hierarchyIsInconsistent)
+ count++;
// iterate the field declarations to create the bindings, lose all duplicates
FieldBinding[] fieldBindings = new FieldBinding[count];
HashtableOfObject knownFieldNames = new HashtableOfObject(count);
@@ -111,6 +122,8 @@ public class ClassScope extends Scope {
}
fieldBindings = newFieldBindings;
}
+ if (hierarchyIsInconsistent)
+ fieldBindings[count++] = new FieldBinding(IncompleteHierarchy, VoidBinding, AccPrivate, referenceContext.binding, null);
if (count != fieldBindings.length)
System.arraycopy(fieldBindings, 0, fieldBindings = new FieldBinding[count], 0, count);

Back to the top