]> source.dussan.org Git - aspectj.git/commitdiff
bullet proof (?) element formatter (135052)
authoraclement <aclement>
Thu, 6 Apr 2006 08:19:17 +0000 (08:19 +0000)
committeraclement <aclement>
Thu, 6 Apr 2006 08:19:17 +0000 (08:19 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java

index a1da0cffde7bf1bbb3dbd072642e06eb35391ec4..0916356d7131ac22efc8887f3526ebaced3c97e0 100644 (file)
@@ -39,9 +39,12 @@ import org.aspectj.weaver.patterns.OrPointcut;
 import org.aspectj.weaver.patterns.ReferencePointcut;
 import org.aspectj.weaver.patterns.TypePattern;
 import org.aspectj.weaver.patterns.TypePatternList;
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
 
 /**
  * @author Mik Kersten
@@ -299,7 +302,20 @@ public class AsmElementFormatter {
                        
                        for (int i = 0; i < argArray.length; i++) {
                                String argName = new String(argArray[i].name);
-                               String argType = argArray[i].type.resolvedType.debugName();
+                               String argType = "<UnknownType>"; // pr135052
+                               TypeReference typeR = argArray[i].type;
+                               if (typeR!=null) {
+                                       TypeBinding typeB = typeR.resolvedType;
+                                       if (typeB==null) {
+                                               if (typeR.getTypeName()!=null) 
+                                                         argType = CharOperation.toString(typeR.getTypeName());                                                
+                                       } else {
+                                               argType = typeB.debugName();
+                                       }
+                               }
+                               
+                               
+//                             String argType = argArray[i].type.resolvedType.debugName();
                                if (acceptArgument(argName, argArray[i].type.toString())) { 
                                        names.add(argName);
                                        types.add(argType);