]> source.dussan.org Git - aspectj.git/commitdiff
debug for problem in hierarchy builder
authorAndy Clement <andrew.clement@gmail.com>
Wed, 13 Mar 2013 15:24:28 +0000 (08:24 -0700)
committerAndy Clement <andrew.clement@gmail.com>
Wed, 13 Mar 2013 15:24:28 +0000 (08:24 -0700)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java

index 97a67a00ab1f419729c4291b0d9a569c1c74ea66..dd38f775097326005768d805b5a81d678617525b 100644 (file)
@@ -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);