From: Andy Clement Date: Wed, 13 Mar 2013 15:24:28 +0000 (-0700) Subject: debug for problem in hierarchy builder X-Git-Tag: AS_BETA_JAVA8_CREATED~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f8c2a9aff1c7cad6a967bd26734be31fce628e96;p=aspectj.git debug for problem in hierarchy builder --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java index 97a67a00a..dd38f7750 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java @@ -827,7 +827,30 @@ public class AsmHierarchyBuilder extends ASTVisitor { // value peNode = new ProgramElement(activeStructureModel, new String(fieldDeclaration.name), IProgramElement.Kind.ENUM_VALUE, makeLocation(fieldDeclaration), fieldDeclaration.modifiers, null, null); - peNode.setCorrespondingType(fieldDeclaration.binding.type.debugName()); + String type = null; + boolean isOk = true; + if (fieldDeclaration.binding == null) { + type="fieldDeclaration_binding_is_null"; + System.err.println("DebugFor402832: null fieldDeclaration.binding for "+fieldDeclaration); + isOk=false; + } else { + if (fieldDeclaration.binding.type==null) { + System.err.println("DebugFor402832: null fieldDeclaration.binding.type for "+fieldDeclaration); + type="fieldDeclaration_binding_type_is_null"; + isOk=false; + } else { + type=fieldDeclaration.binding.type.debugName(); + } + } + if (!isOk) { + if (fieldDeclaration.type!=null && fieldDeclaration.type.resolvedType!=null) { + type = fieldDeclaration.type.resolvedType.debugName(); + System.err.println("DebugFor402832: used secondary route to compute name for "+fieldDeclaration+", set to "+type); + isOk=true; + } + } + peNode.setCorrespondingType(type); +// peNode.setCorrespondingType(fieldDeclaration.binding.type.debugName()); } else { peNode = new ProgramElement(activeStructureModel, new String(fieldDeclaration.name), IProgramElement.Kind.FIELD, makeLocation(fieldDeclaration), fieldDeclaration.modifiers, null, null);