From fdd4e869b979f9c5d75d339e898830a27650c1b3 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 6 Apr 2006 08:19:17 +0000 Subject: [PATCH] bullet proof (?) element formatter (135052) --- .../core/builder/AsmElementFormatter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index a1da0cffd..0916356d7 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -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 = ""; // 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); -- 2.39.5