protected void suppressLintWarnings(World inWorld) { if (suppressedLintKinds == null) { if (signature instanceof BcelMethod) { this.suppressedLintKinds = Utility.getSuppressedWarnings(signature.getAnnotations(), inWorld.getLint()); } else { this.suppressedLintKinds = Collections.emptyList(); return; } } inWorld.getLint().suppressKinds(suppressedLintKinds); }
/** * Checks for suppression specified on the member or on the declaring type of that member */ public static boolean isSuppressing(Member member, String lintkey) { boolean isSuppressing = Utils.isSuppressing(member.getAnnotations(), lintkey); if (isSuppressing) { return true; } UnresolvedType type = member.getDeclaringType(); if (type instanceof ResolvedType) { return Utils.isSuppressing(((ResolvedType) type).getAnnotations(), lintkey); } return false; }
if (pnames != null) { AnnotationAJ[] annos = getSignature().getAnnotations(); String parameterToLookup = null; if (annos != null && (getKind() == AdviceKind.AfterThrowing || getKind() == AdviceKind.AfterReturning)) {
AnnotationAJ[] annos = holder.getAnnotations(); for (AnnotationAJ anno : annos) { AnnotationGen annotation = ((BcelAnnotation) anno).getBcelAnnotation();
/** * In after returning advice if we are binding the extra parameter to a parameterized type we may not be able to do a type-safe * conversion. * * @param resolvedExtraParameterType the type in the after returning declaration * @param shadowReturnType the type at the shadow * @param world */ private void maybeIssueUncheckedMatchWarning(ResolvedType afterReturningType, ResolvedType shadowReturnType, Shadow shadow, World world) { boolean inDoubt = !afterReturningType.isAssignableFrom(shadowReturnType); if (inDoubt && world.getLint().uncheckedArgument.isEnabled()) { String uncheckedMatchWith = afterReturningType.getSimpleBaseName(); if (shadowReturnType.isParameterizedType() && (shadowReturnType.getRawType() == afterReturningType.getRawType())) { uncheckedMatchWith = shadowReturnType.getSimpleName(); } if (!Utils.isSuppressing(getSignature().getAnnotations(), "uncheckedArgument")) { world.getLint().uncheckedArgument.signal(new String[] { afterReturningType.getSimpleName(), uncheckedMatchWith, afterReturningType.getSimpleBaseName(), shadow.toResolvedString(world) }, getSourceLocation(), new ISourceLocation[] { shadow.getSourceLocation() }); } } }