public String getAnnotationDefaultValue() {
return realMember.getAnnotationDefaultValue();
}
+
+ public String getParameterSignatureErased() {
+ return realMember.getParameterSignatureErased();
+ }
+
+ public String getSignatureErased() {
+ return realMember.getSignatureErased();
+ }
}
public AnnotationX[][] getParameterAnnotations();
public ResolvedType[][] getParameterAnnotationTypes();
public String getAnnotationDefaultValue();
+ public String getParameterSignatureErased();
+ public String getSignatureErased();
public String[] getParameterNames(World world);
return true;
} else {
// try erasure
- myParameterSignature = getParameterSigErasure();
- candidateParameterSignature = candidateMatchImpl.getParameterSigErasure();
+ myParameterSignature = getParameterSignatureErased();
+ candidateParameterSignature = candidateMatchImpl.getParameterSignatureErased();
return myParameterSignature.equals(candidateParameterSignature);
}
}
return myParameterSignatureWithBoundsRemoved;
}
- private String getParameterSigErasure() {
+ /**
+ * Return the erased form of the signature with bounds collapsed for type variables, etc.
+ * Does not include the return type, @see getParam
+ */
+ public String getParameterSignatureErased() {
if (myParameterSignatureErasure != null) return myParameterSignatureErasure;
StringBuffer sig = new StringBuffer();
UnresolvedType[] myParameterTypes = getParameterTypes();
TypeVariableReferenceType typeVariableRT = (TypeVariableReferenceType) thisParameter;
sig.append(typeVariableRT.getUpperBound().getSignature());
} else {
- sig.append(thisParameter.getSignature());
+ sig.append(thisParameter.getErasureSignature());
}
}
myParameterSignatureErasure = sig.toString();
return myParameterSignatureErasure;
}
+ public String getSignatureErased() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("(");
+ sb.append(getParameterSignatureErased());
+ sb.append(")");
+ sb.append(getReturnType().getErasureSignature());
+ return sb.toString();
+ }
+
// does NOT produce a meaningful java signature, but does give a unique string suitable for
// comparison.
public static void appendSigWithTypeVarBoundsRemoved(UnresolvedType aType, StringBuffer toBuffer, Set alreadyUsedTypeVars) {
UnresolvedType[] bm = BcelWorld.fromBcel(bridgeToCandidate.getArgumentTypes());
ResolvedMember overriddenMethod = checkForOverride(theSuperclass,name,psig,rsig,bridgeToCandidate.getAccessFlags(),pkgName,bm);
if (overriddenMethod!=null) {
- String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignature()).toString();
+ String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignatureErased()).toString(); // pr 237419
boolean alreadyHaveABridgeMethod = methodsSet.contains(key);
- if (!alreadyHaveABridgeMethod) {
+ if (!alreadyHaveABridgeMethod) {
if (world.forDEBUG_bridgingCode) System.err.println("Bridging:bridging to '"+overriddenMethod+"'");
createBridgeMethod(world, bridgeToCandidate, clazz, overriddenMethod);
methodsSet.add(key);
ResolvedType interfaceType = world.resolve(interfaces[j]);
overriddenMethod = checkForOverride(interfaceType,name,psig,rsig,bridgeToCandidate.getAccessFlags(),clazz.getPackageName(),bm);
if (overriddenMethod!=null) {
- String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignature()).toString();
+ String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignatureErased()).toString(); // pr 237419
boolean alreadyHaveABridgeMethod = methodsSet.contains(key);
if (!alreadyHaveABridgeMethod) {
createBridgeMethod(world, bridgeToCandidate, clazz, overriddenMethod);
}
public boolean matches(ResolvedType onType) {
- //we cannot return onType.equals(aspectType)
- //since we need to eagerly create the nested ajcMighHaveAspect interface on LTW
- return true;
- //return aspectType.equals(onType);
+ // cannot always do the right thing because may need to eagerly generate ajcMightHaveAspect interface for LTW (says Alex)
+ if (hasGeneratedInner) { // pr237419 - not always going to generate the marker interface
+ return aspectType.equals(onType);
+ } else {
+ return true;
+ }
}
private boolean hasPerClauseMembersAlready(LazyClassGen classGen) {