public String toString() { return getKind() + "(" + getSignature() + ")"; // + getSourceLines(); }
public UnresolvedType[] getArgTypes() { if (getKind() == FieldSet) { return new UnresolvedType[] { getSignature().getReturnType() }; } return getSignature().getParameterTypes(); }
public UnresolvedType getArgType(int arg) { if (getKind() == FieldSet) { return getSignature().getReturnType(); } return getSignature().getParameterTypes()[arg]; }
/** * the type of the target object here * * @throws IllegalStateException if there is no target here */ public final UnresolvedType getTargetType() { if (!hasTarget()) { throw new IllegalStateException("no target"); } return getSignature().getDeclaringType(); }
public int getArgCount() { if (getKind() == FieldSet) { return 1; } return getSignature().getParameterTypes().length; }
public String toResolvedString(World world) { StringBuffer sb = new StringBuffer(); sb.append(getKind()); sb.append("("); Member m = getSignature(); if (m == null) { sb.append("<<missing signature>>"); } else { ResolvedMember rm = world.resolve(m); if (rm == null) { sb.append("<<unresolvableMember:").append(m).append(">>"); } else { String genString = rm.toGenericString(); if (genString == null) { sb.append("<<unableToGetGenericStringFor:").append(rm).append(">>"); } else { sb.append(genString); } } } sb.append(")"); return sb.toString(); // was: return getKind() + "(" + world.resolve(getSignature()).toGenericString() + ")"; }
public UnresolvedType getReturnType() { if (kind == ConstructorCall) { return getSignature().getDeclaringType(); } else if (kind == FieldSet) { return UnresolvedType.VOID; } else if (kind == SynchronizationLock || kind == SynchronizationUnlock) { return UnresolvedType.VOID; } return getResolvedSignature().getGenericReturnType(); }
/** * the type of the this object here * * @throws IllegalStateException if there is no this here */ public final UnresolvedType getThisType() { if (!hasThis()) { throw new IllegalStateException("no this"); } if (getKind().isEnclosingKind()) { return getSignature().getDeclaringType(); } else { return enclosingShadow.getThisType(); } }
/** * could target(*) pcd ever match */ public final boolean hasTarget() { if (getKind().neverHasTarget()) { return false; } else if (getKind().isTargetSameAsThis()) { return hasThis(); } else { return !Modifier.isStatic(getSignature().getModifiers()); } }
/** * could this(*) pcd ever match */ public final boolean hasThis() { if (getKind().neverHasThis()) { return false; } else if (getKind().isEnclosingKind()) { return !Modifier.isStatic(getSignature().getModifiers()); } else if (enclosingShadow == null) { return false; } else { return enclosingShadow.hasThis(); } }
public Member getEnclosingCodeSignature() { // XXX this code is copied from BcelShadow with one minor change... if (getKind().isEnclosingKind()) { return getSignature(); } else if (getKind() == Shadow.PreInitialization) { // PreInit doesn't enclose code but its signature // is correctly the signature of the ctor. return getSignature(); } else if (enclosingShadow == null) { return this.enclosingMember; } else { return enclosingShadow.getSignature(); } }
return shadow.getSignature().toString(); } else if (key.equalsIgnoreCase("joinpoint.signature.declaringtype")) { return shadow.getSignature().getDeclaringType().toString(); } else if (key.equalsIgnoreCase("joinpoint.signature.name")) { return shadow.getSignature().getName(); } else if (key.equalsIgnoreCase("joinpoint.sourcelocation.sourcefile")) { ISourceLocation loc = shadow.getSourceLocation();
public Member getEnclosingCodeSignature() { // XXX this code is copied from BcelShadow with one minor change... if (getKind().isEnclosingKind()) { return getSignature(); } else if (getKind() == Shadow.PreInitialization) { // PreInit doesn't enclose code but its signature // is correctly the signature of the ctor. return getSignature(); } else if (enclosingShadow == null) { return this.enclosingMember; } else { return enclosingShadow.getSignature(); } }
protected FuzzyBoolean matchInternal(Shadow shadow) { if (shadow.getKind() != Shadow.ExceptionHandler) { return FuzzyBoolean.NO; } exceptionType.resolve(shadow.getIWorld()); // we know we have exactly one parameter since we're checking an exception handler return exceptionType.matches(shadow.getSignature().getParameterTypes()[0].resolve(shadow.getIWorld()), TypePattern.STATIC); }
@Override public Member getEnclosingCodeSignature() { if (getKind().isEnclosingKind()) { return getSignature(); } else if (getKind() == Shadow.PreInitialization) { // PreInit doesn't enclose code but its signature // is correctly the signature of the ctor. return getSignature(); } else if (enclosingShadow == null) { return getEnclosingMethod().getMemberView(); } else { return enclosingShadow.getSignature(); } }
protected boolean checkCanThrow(ShadowMunger munger, ResolvedType resolvedTypeX) { if (getKind() == ExceptionHandler) { // XXX much too lenient rules here, need to walk up exception handlers return true; } if (!isDeclaredException(resolvedTypeX, getSignature())) { getIWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.CANT_THROW_CHECKED, resolvedTypeX, this), // from // advice // in // \ // '" // + // munger // . // + // "\'" // , getSourceLocation(), munger.getSourceLocation()); } return true; }
@Override protected FuzzyBoolean matchInternal(Shadow shadow) { AnnotatedElement toMatchAgainst = null; Member member = shadow.getSignature(); ResolvedMember rMember = member.resolve(shadow.getIWorld());
ResolvedType shadowDeclaringType = shadow.getSignature().getDeclaringType().resolve(world); ResolvedMember rm = shadow.getSignature().resolve(world); if (!signature.getReturnType().matchesStatically(shadow.getSignature().getReturnType().resolve(world))) { signature.getThrowsPattern(), signature.getAnnotationPattern()); if (nonConfusingPattern.matches(shadow.getSignature(), shadow.getIWorld(), true)) { shadow.getIWorld().getLint().unmatchedSuperTypeInCall.signal(new String[] { shadow.getSignature().getDeclaringType().toString(), signature.getDeclaringType().toString() }, this.getSourceLocation(), new ISourceLocation[] { shadow.getSourceLocation() });
Member shadowSig = shadow.getSignature();
Member enclosingMember = shadow.getEnclosingShadow().getSignature(); if (enclosingMember instanceof BcelMethod) { removeUnnecessaryProblems((BcelMethod) enclosingMember, && (s.getSignature().getModifiers() & Modifier.SYNCHRONIZED) != 0) { shadow.getIWorld().getLint().advisingSynchronizedMethods.signal(new String[] { shadow.toString() }, shadow.getSourceLocation(), new ISourceLocation[] { getSourceLocation() });