return realMember.compareTo(other);
}
- public String toLongString() {
- return realMember.toLongString();
- }
-
public MemberKind getKind() {
return realMember.getKind();
}
return realMember.canBeParameterized();
}
- public String getExtractableName() {
- return realMember.getExtractableName();
- }
-
public AnnotationX[] getAnnotations() {
return realMember.getAnnotations();
}
throw new UnsupportedOperationException("Adrian doesn't think you should be calling this...");
}
- public String getSignatureMakerName() {
- return realMember.getSignatureMakerName();
- }
-
- public String getSignatureType() {
- return realMember.getSignatureType();
- }
-
- public String getSignatureString(World world) {
- return realMember.getSignatureString(world);
- }
-
public Iterator getJoinPointSignatures(World world) {
return realMember.getJoinPointSignatures(world);
}
public int compareTo(Object other);
- public String toLongString();
-
public UnresolvedType getDeclaringType();
public UnresolvedType getReturnType();
public UnresolvedType getGenericReturnType();
+
public UnresolvedType[] getGenericParameterTypes();
public UnresolvedType getType();
*/
public boolean canBeParameterized();
- public String getExtractableName();
-
public AnnotationX[] getAnnotations();
-
- // ---- reflective thisJoinPoint stuff
- public String getSignatureMakerName();
-
- public String getSignatureType();
public Collection/* ResolvedType */getDeclaringTypes(World world);
-
- public String getSignatureString(World world);
public String[] getParameterNames(World world);
public class MemberImpl implements Member {
protected MemberKind kind;
-
protected int modifiers;
protected String name;
protected UnresolvedType returnType;
// OPTIMIZE move out of the member!
private boolean reportedCantFindDeclaringType = false;
private boolean reportedUnresolvableMember = false;
-
/**
* All the signatures that a join point with this member as its signature has.
- * The fact that this has to go on MemberImpl and not ResolvedMemberImpl says a lot about
- * how broken the Member/ResolvedMember distinction currently is.
*/
private JoinPointSignatureIterator joinPointSignatures = null;
String name,
UnresolvedType[] parameterTypes)
{
- super();
this.kind = kind;
this.declaringType = declaringType;
this.modifiers = modifiers;
public static Member field(UnresolvedType declaring, int mods, String name, UnresolvedType type) {
return new MemberImpl(FIELD, declaring, mods, type, name, UnresolvedType.NONE);
}
+ // OPTIMIZE do we need to call this? unless necessary the signatureToTypes() call smacks of laziness on the behalf of the caller of this method
public static MemberImpl method(UnresolvedType declaring, int mods, String name, String signature) {
Object[] pair = signatureToTypes(signature,false);
return method(declaring, mods, (UnresolvedType) pair[0], name, (UnresolvedType[]) pair[1]);
name,
paramTys);
}
+
private static Member pointcut(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys) {
return new MemberImpl(
POINTCUT,
"(" + catchType.getSignature() + ")V");
}
- // ---- parsing methods
-
- // ---- things we know without resolution
-
public boolean equals(Object other) {
if (! (other instanceof Member)) return false;
Member o = (Member) other;
public int compareTo(Object other) {
Member o = (Member) other;
-
int i = getName().compareTo(o.getName());
if (i != 0) return i;
return getSignature().compareTo(o.getSignature());
}
return buf.toString();
}
-
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#toLongString()
- */
- public String toLongString() {
- StringBuffer buf = new StringBuffer();
- buf.append(kind);
- buf.append(' ');
- if (modifiers != 0) {
- buf.append(Modifier.toString(modifiers));
- buf.append(' ');
- }
- buf.append(toString());
- buf.append(" <");
- buf.append(signature);
- buf.append(" >");
- return buf.toString();
- }
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#getKind()
- */
public MemberKind getKind() {
return kind;
}
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#getDeclaringType()
- */
+
public UnresolvedType getDeclaringType() { return declaringType; }
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#getReturnType()
- */
+
public UnresolvedType getReturnType() { return returnType; }
public UnresolvedType getGenericReturnType() { return getReturnType(); }
}
public final boolean isInterface() {
- return Modifier.isInterface(modifiers); // this is kinda weird
+ return Modifier.isInterface(modifiers);
}
public final boolean isPrivate() {
return modifiers;
}
- public final String getExtractableName() {
- // OPTIMIZE remove silly string compares for init - use kind==CTOR/STATIC_INITIALIZATION
- if (name.equals("<init>")) return "init$";
- else if (name.equals("<clinit>")) return "clinit$";
- else return name;
- }
-
public AnnotationX[] getAnnotations() {
throw new UnsupportedOperationException("You should resolve this member '"+this+"' and call getAnnotations() on the result...");
}
}
}
- // ---- reflective thisJoinPoint stuff
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#getSignatureMakerName()
- */
- public String getSignatureMakerName() {
- if (getName().equals("<clinit>")) return "makeInitializerSig";
-
- MemberKind kind = getKind();
- if (kind == METHOD) {
- return "makeMethodSig";
- } else if (kind == CONSTRUCTOR) {
- return "makeConstructorSig";
- } else if (kind == FIELD) {
- return "makeFieldSig";
- } else if (kind == HANDLER) {
- return "makeCatchClauseSig";
- } else if (kind == STATIC_INITIALIZATION) {
- return "makeInitializerSig";
- } else if (kind == ADVICE) {
- return "makeAdviceSig";
- } else if (kind == MONITORENTER) {
- return "makeLockSig";
- } else if (kind == MONITOREXIT) {
- return "makeUnlockSig";
- } else {
- throw new RuntimeException("unimplemented");
- }
- }
-
-
- public String getSignatureType() {
- MemberKind kind = getKind();
- if (getName().equals("<clinit>")) return "org.aspectj.lang.reflect.InitializerSignature";
-
- if (kind == METHOD) {
- return "org.aspectj.lang.reflect.MethodSignature";
- } else if (kind == CONSTRUCTOR) {
- return "org.aspectj.lang.reflect.ConstructorSignature";
- } else if (kind == FIELD) {
- return "org.aspectj.lang.reflect.FieldSignature";
- } else if (kind == HANDLER) {
- return "org.aspectj.lang.reflect.CatchClauseSignature";
- } else if (kind == STATIC_INITIALIZATION) {
- return "org.aspectj.lang.reflect.InitializerSignature";
- } else if (kind == ADVICE) {
- return "org.aspectj.lang.reflect.AdviceSignature";
- } else if (kind == MONITORENTER) {
- return "org.aspectj.lang.reflect.LockSignature";
- } else if (kind == MONITOREXIT) {
- return "org.aspectj.lang.reflect.UnlockSignature";
- } else {
- throw new RuntimeException("unimplemented");
- }
- }
-
- /* (non-Javadoc)
- * @see org.aspectj.weaver.Member#getSignatureString(org.aspectj.weaver.World)
- */
- public String getSignatureString(World world) {
- if (getName().equals("<clinit>")) return getStaticInitializationSignatureString(world);
-
- MemberKind kind = getKind();
- if (kind == METHOD) {
- return getMethodSignatureString(world);
- } else if (kind == CONSTRUCTOR) {
- return getConstructorSignatureString(world);
- } else if (kind == FIELD) {
- return getFieldSignatureString(world);
- } else if (kind == HANDLER) {
- return getHandlerSignatureString(world);
- } else if (kind == STATIC_INITIALIZATION) {
- return getStaticInitializationSignatureString(world);
- } else if (kind == ADVICE) {
- return getAdviceSignatureString(world);
- } else if (kind == MONITORENTER || kind == MONITOREXIT) {
- return getMonitorSignatureString(world);
- } else {
- throw new RuntimeException("unimplemented");
- }
- }
-
- private String getHandlerSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(0));
- buf.append('-');
- //buf.append(getName());
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- buf.append(makeString(getParameterTypes()[0]));
- buf.append('-');
- String pName = "<missing>";
- String[] names = getParameterNames(world);
- if (names != null) pName = names[0];
- buf.append(pName);
- buf.append('-');
- return buf.toString();
- }
-
- private String getStaticInitializationSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(getModifiers(world)));
- buf.append('-');
- //buf.append(getName());
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- return buf.toString();
- }
-
-
-
- protected String getAdviceSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(getModifiers(world)));
- buf.append('-');
- buf.append(getName());
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- buf.append(makeString(getParameterTypes()));
- buf.append('-');
- buf.append(makeString(getParameterNames(world)));
- buf.append('-');
- buf.append(makeString(getExceptions(world)));
- buf.append('-');
- buf.append(makeString(getReturnType()));
- buf.append('-');
- return buf.toString();
- }
-
-
- protected String getMethodSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(getModifiers(world)));
- buf.append('-');
- buf.append(getName());
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- buf.append(makeString(getParameterTypes()));
- buf.append('-');
- buf.append(makeString(getParameterNames(world)));
- buf.append('-');
- buf.append(makeString(getExceptions(world)));
- buf.append('-');
- buf.append(makeString(getReturnType()));
- buf.append('-');
- return buf.toString();
- }
-
- protected String getMonitorSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(Modifier.STATIC)); // modifiers
- buf.append('-');
- buf.append(getName()); // name
- buf.append('-');
- buf.append(makeString(getDeclaringType())); // Declaring Type
- buf.append('-');
- buf.append(makeString(getParameterTypes()[0])); // Parameter Types
- buf.append('-');
- buf.append(""); // Parameter names
- buf.append('-');
- return buf.toString();
- }
-
-
-
- protected String getConstructorSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(getModifiers(world)));
- buf.append('-');
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- buf.append(makeString(getParameterTypes()));
- buf.append('-');
- buf.append(makeString(getParameterNames(world)));
- buf.append('-');
- buf.append(makeString(getExceptions(world)));
- buf.append('-');
- return buf.toString();
- }
-
-
-
-
- protected String getFieldSignatureString(World world) {
- StringBuffer buf = new StringBuffer();
- buf.append(makeString(getModifiers(world)));
- buf.append('-');
- buf.append(getName());
- buf.append('-');
- buf.append(makeString(getDeclaringType()));
- buf.append('-');
- buf.append(makeString(getReturnType()));
- buf.append('-');
- return buf.toString();
- }
-
- protected String makeString(int i) {
- return Integer.toString(i, 16);
- }
-
-
-
-
- protected String makeString(UnresolvedType t) {
- // this is the inverse of the odd behavior for Class.forName w/ arrays
- if (t.isArray()) {
- // this behavior matches the string used by the eclipse compiler for Foo.class literals
- return t.getSignature().replace('/', '.');
- } else {
- return t.getName();
- }
- }
-
-
-
- protected String makeString(UnresolvedType[] types) {
- if (types == null) return "";
- StringBuffer buf = new StringBuffer();
- for (int i = 0, len=types.length; i < len; i++) {
- buf.append(makeString(types[i]));
- buf.append(':');
- }
- return buf.toString();
- }
-
-
-
- protected String makeString(String[] names) {
- if (names == null) return "";
- StringBuffer buf = new StringBuffer();
- for (int i = 0, len=names.length; i < len; i++) {
- buf.append(names[i]);
- buf.append(':');
- }
- return buf.toString();
- }
-
public String[] getParameterNames(World world) {
ResolvedMember resolved = resolve(world);
if (resolved == null) {
new BcelShadow(
world,
ConstructorExecution,
- world.makeJoinPointSignature(enclosingMethod),
+ world.makeJoinPointSignatureFromMethod(enclosingMethod,Member.CONSTRUCTOR),
enclosingMethod,
null);
ShadowRange r = new ShadowRange(body);
new BcelShadow(
world,
StaticInitialization,
- world.makeJoinPointSignature(enclosingMethod),
+ world.makeJoinPointSignatureFromMethod(enclosingMethod,Member.STATIC_INITIALIZATION),
enclosingMethod,
null);
ShadowRange r = new ShadowRange(body);
BcelShadow ret = new BcelShadow(
world,
Initialization,
- world.makeJoinPointSignature(constructor),
+ world.makeJoinPointSignatureFromMethod(constructor,Member.CONSTRUCTOR),
constructor,
null);
if (constructor.getEffectiveSignature() != null) {
BcelShadow ret = new BcelShadow(
world,
PreInitialization,
- world.makeJoinPointSignature(constructor),
+ world.makeJoinPointSignatureFromMethod(constructor,Member.CONSTRUCTOR),
constructor,
null);
-// ret.fallsThrough = true;
if (constructor.getEffectiveSignature() != null) {
ret.setMatchingSignature(constructor.getEffectiveSignature().getEffectiveSignature());
}
null);
ShadowRange r = new ShadowRange(body);
r.associateWithShadow(s);
- r.associateWithTargets(
+ r.associateWithTargets(// OPTIMIZE this occurs lots of times for all jp kinds...
Range.genStart(body),
Range.genEnd(body));
return s;
public BcelVar getThisJoinPointStaticPartBcelVar(final boolean isEnclosingJp) {
if (thisJoinPointStaticPartVar == null) {
Field field = getEnclosingClass().getTjpField(this, isEnclosingJp);
-
ResolvedType sjpType = null;
if (world.isTargettingAspectJRuntime12()) { // TAG:SUPPORTING12: We didn't have different jpsp types in 1.2
- sjpType = world.getCoreType(UnresolvedType.forName("org.aspectj.lang.JoinPoint$StaticPart"));
+ sjpType = world.getCoreType(UnresolvedType.JOINPOINT_STATICPART);
} else {
sjpType = isEnclosingJp?
- world.getCoreType(UnresolvedType.forName("org.aspectj.lang.JoinPoint$EnclosingStaticPart")):
- world.getCoreType(UnresolvedType.forName("org.aspectj.lang.JoinPoint$StaticPart"));
+ world.getCoreType(UnresolvedType.JOINPOINT_ENCLOSINGSTATICPART):
+ world.getCoreType(UnresolvedType.JOINPOINT_STATICPART);
}
thisJoinPointStaticPartVar = new BcelFieldRef(
sjpType,
}
return foundMember.getAnnotationTypes();
}
-
+
+ /**
+ * By determining what "kind" of shadow we are, we can find out the
+ * annotations on the appropriate element (method, field, constructor, type).
+ * Then create one BcelVar entry in the map for each annotation, keyed by
+ * annotation type.
+ */
public void initializeKindedAnnotationVars() {
if (kindedAnnotationVars != null) return;
kindedAnnotationVars = new HashMap();
- // by determining what "kind" of shadow we are, we can find out the
- // annotations on the appropriate element (method, field, constructor, type).
- // Then create one BcelVar entry in the map for each annotation, keyed by
- // annotation type.
// FIXME asc Refactor this code, there is duplication
ResolvedType[] annotations = null;
-// Member relevantMember = getSignature();
Member shadowSignature = getSignature();
Member annotationHolder = getSignature();
ResolvedType relevantType = shadowSignature.getDeclaringType().resolve(world);
- if (relevantType.isRawType() || relevantType.isParameterizedType()) relevantType = relevantType.getGenericType();
+ if (relevantType.isRawType() || relevantType.isParameterizedType()) relevantType = relevantType.getGenericType();
- if (getKind() == Shadow.StaticInitialization) {
+ if (getKind() == Shadow.StaticInitialization) {
annotations = relevantType.resolve(world).getAnnotationTypes();
-
} else if (getKind() == Shadow.MethodCall || getKind() == Shadow.ConstructorCall) {
ResolvedMember foundMember = findMethod2(relevantType.resolve(world).getDeclaredMethods(),getSignature());
annotations = getAnnotations(foundMember, shadowSignature, relevantType);
} else if (getKind() == Shadow.ExceptionHandler) {
relevantType = getSignature().getParameterTypes()[0].resolve(world);
annotations = relevantType.getAnnotationTypes();
-
} else if (getKind() == Shadow.PreInitialization || getKind() == Shadow.Initialization) {
ResolvedMember found = findMethod2(relevantType.getDeclaredMethods(),getSignature());
annotations = found.getAnnotationTypes();
if (annotations == null) {
// We can't have recognized the shadow - should blow up now to be on the safe side
- throw new BCException("Couldn't discover annotations for shadow: "+getKind());
+ throw new BCException("Could not discover annotations for shadow: "+getKind());
}
for (int i = 0; i < annotations.length; i++) {
- ResolvedType aTX = annotations[i];
- AnnotationAccessVar kaav = new AnnotationAccessVar(getKind(),aTX.resolve(world),relevantType,annotationHolder);
- kindedAnnotationVars.put(aTX,kaav);
+ ResolvedType annotationType = annotations[i];
+ AnnotationAccessVar accessVar = new AnnotationAccessVar(getKind(),annotationType.resolve(world),relevantType,annotationHolder);
+ kindedAnnotationVars.put(annotationType,accessVar);
}
}
-//FIXME asc whats the real diff between this one and the version in findMethod()?
+ //FIXME asc whats the real diff between this one and the version in findMethod()?
ResolvedMember findMethod2(ResolvedMember rm[], Member sig) {
ResolvedMember found = null;
// String searchString = getSignature().getName()+getSignature().getParameterSignature();
}
public boolean isFallsThrough() {
- return !terminatesWithReturn(); //fallsThrough;
+ return !terminatesWithReturn();
}
public void setActualTargetType(String className) {
fi.getName(cpg),
fi.getSignature(cpg));
}
-
-// public static Member makeFieldSetSignature(LazyClassGen cg, FieldInstruction fi) {
-// ConstantPoolGen cpg = cg.getConstantPoolGen();
-// return
-// MemberImpl.field(
-// fi.getClassName(cpg),
-// (fi instanceof GETSTATIC || fi instanceof PUTSTATIC)
-// ? Modifier.STATIC
-// : 0,
-// fi.getName(cpg),
-// "(" + fi.getSignature(cpg) + ")" +fi.getSignature(cpg));
-// }
-
- public Member makeJoinPointSignature(LazyMethodGen mg) {
- return makeJoinPointSignatureFromMethod(mg, null);
- }
public Member makeJoinPointSignatureFromMethod(LazyMethodGen mg, MemberKind kind) {
if (mg.getEnclosingClass().isInterface()) {
mods |= Modifier.INTERFACE;
}
- if (kind == null) {
- //OPTIMIZE surely we can pass the kind in and not resort to string compares?
- if (mg.getName().equals("<init>")) {
- kind = Member.CONSTRUCTOR;
- } else if (mg.getName().equals("<clinit>")) {
- kind = Member.STATIC_INITIALIZATION;
- } else {
- kind = Member.METHOD;
- }
- }
return new ResolvedMemberImpl(kind,
UnresolvedType.forName(mg.getClassName()),
mods,
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.SignatureUtils;
import org.aspectj.weaver.TypeVariable;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverMessages;
for (int i = 0; i < methods.length; i++) {
ResolvedMember method = methods[i];
if (method.getName().equals("<clinit>")) {
+ if (method.getKind()!=Member.STATIC_INITIALIZATION) {
+ throw new RuntimeException("qui?");
+ }
hasClinit = true;
}
}
private static boolean hasSourceDebugExtensionAttribute(ClassGen gen) {
return gen.hasAttribute("SourceDebugExtension");
-// ConstantPool pool = gen.getConstantPool();
-// Attribute[] attrs = gen.getAttributes();
-// for (int i = 0; i < attrs.length; i++) {
-// if ("SourceDebugExtension"
-// .equals(((ConstantUtf8) pool.getConstant(attrs[i].getNameIndex())).getBytes())) {
-// return true;
-// }
-// }
-// return false;
}
public JavaClass getJavaClass(BcelWorld world) {
}
private boolean isEmptyClinit(LazyMethodGen gen) {
+
if (!gen.getName().equals("<clinit>")) return false;
//System.err.println("checking clinig: " + gen);
InstructionHandle start = gen.getBody().getStart();
public LazyMethodGen getStaticInitializer() {
for (Iterator i = methodGens.iterator(); i.hasNext();) {
LazyMethodGen gen = (LazyMethodGen) i.next();
+ // OPTIMIZE persist kind of member into the gen object? for clinit
if (gen.getName().equals("<clinit>")) return gen;
}
LazyMethodGen clinit = new LazyMethodGen(
// create the signature
list.append(InstructionFactory.createLoad(factoryType, 0));
+ String signatureMakerName = SignatureUtils.getSignatureMakerName(sig);
+ ObjectType signatureType = new ObjectType(SignatureUtils.getSignatureType(sig));
+
+
if (world.isTargettingAspectJRuntime12()) { // TAG:SUPPORTING12: We didn't have optimized factory methods in 1.2
- list.append(InstructionFactory.PUSH(getConstantPool(), sig.getSignatureString(shadow.getWorld())));
+ list.append(InstructionFactory.PUSH(getConstantPool(), SignatureUtils.getSignatureString(sig,shadow.getWorld())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING },
- Constants.INVOKEVIRTUAL));
- } else if (sig.getKind().equals(Member.METHOD)) {
+ signatureMakerName,signatureType,Type.STRINGARRAY1, Constants.INVOKEVIRTUAL));
+ } else if (sig.getKind().equals(Member.METHOD)) {
BcelWorld w = shadow.getWorld();
// For methods, push the parts of the signature on.
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getModifiers(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getReturnType())));
// And generate a call to the variant of makeMethodSig() that takes 7 strings
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
+ signatureMakerName,signatureType,
new Type[] { Type.STRING,Type.STRING,Type.STRING,Type.STRING,Type.STRING,Type.STRING,Type.STRING },
Constants.INVOKEVIRTUAL));
} else if (sig.getKind().equals(Member.MONITORENTER)) {
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getDeclaringType())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING},
+ signatureMakerName,signatureType,Type.STRINGARRAY1,
Constants.INVOKEVIRTUAL));
} else if (sig.getKind().equals(Member.MONITOREXIT)) {
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getDeclaringType())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING},
+ signatureMakerName,signatureType,Type.STRINGARRAY1,
Constants.INVOKEVIRTUAL));
} else if (sig.getKind().equals(Member.HANDLER)) {
BcelWorld w = shadow.getWorld();
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getParameterTypes())));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getParameterNames(w))));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING, Type.STRING, Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY3,
Constants.INVOKEVIRTUAL));
} else if(sig.getKind().equals(Member.CONSTRUCTOR)) {
BcelWorld w = shadow.getWorld();
list.append(InstructionFactory.PUSH(getConstantPool(),""));//makeString("")));//sig.getParameterNames(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),""));//makeString("")));//sig.getExceptions(w))));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING, Type.STRING, Type.STRING, Type.STRING, Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY5,
Constants.INVOKEVIRTUAL));
} else {
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getModifiers(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getParameterNames(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getExceptions(w))));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING, Type.STRING, Type.STRING, Type.STRING, Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY5,
Constants.INVOKEVIRTUAL));
}
} else if(sig.getKind().equals(Member.FIELD)) {
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(dType)));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getReturnType())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING, Type.STRING, Type.STRING, Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY4,
Constants.INVOKEVIRTUAL));
} else if(sig.getKind().equals(Member.ADVICE)) {
BcelWorld w = shadow.getWorld();
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getExceptions(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString((sig.getReturnType()))));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
+ signatureMakerName,signatureType,
new Type[] { Type.STRING, Type.STRING, Type.STRING, Type.STRING, Type.STRING, Type.STRING, Type.STRING },
Constants.INVOKEVIRTUAL));
} else if(sig.getKind().equals(Member.STATIC_INITIALIZATION)) {
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getModifiers(w))));
list.append(InstructionFactory.PUSH(getConstantPool(),makeString(sig.getDeclaringType())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING, Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY2,
Constants.INVOKEVIRTUAL));
} else {
- list.append(InstructionFactory.PUSH(getConstantPool(), sig.getSignatureString(shadow.getWorld())));
+ list.append(InstructionFactory.PUSH(getConstantPool(), SignatureUtils.getSignatureString(sig,shadow.getWorld())));
list.append(fact.createInvoke(factoryType.getClassName(),
- sig.getSignatureMakerName(),
- new ObjectType(sig.getSignatureType()),
- new Type[] { Type.STRING },
+ signatureMakerName,signatureType,Type.STRINGARRAY1,
Constants.INVOKEVIRTUAL));
}