@Override public void warn(LintCategory lint) { boolean warned = this.warned; super.warn(lint); if (warned) return; // suppress redundant diagnostics switch (lint) { case UNCHECKED: Check.this.warnUnchecked(pos(), "prob.found.req", diags.fragment(uncheckedKey), found, expected); break; case VARARGS: if (method != null && method.attribute(syms.trustMeType.tsym) != null && isTrustMeAllowedOnMethod(method) && !types.isReifiable(method.type.getParameterTypes().last())) { Check.this.warnUnsafeVararg(pos(), "varargs.unsafe.use.varargs.param", method.params.last()); } break; default: throw new AssertionError("Unexpected lint: " + lint); } } }
@Override public void warn(LintCategory lint) { boolean warned = this.warned; super.warn(lint); if (warned) return; // suppress redundant diagnostics switch (lint) { case UNCHECKED: Check.this.warnUnchecked(pos(), "prob.found.req", diags.fragment(uncheckedKey), found, expected); break; case VARARGS: if (method != null && method.attribute(syms.trustMeType.tsym) != null && isTrustMeAllowedOnMethod(method) && !types.isReifiable(method.type.getParameterTypes().last())) { Check.this.warnUnsafeVararg(pos(), "varargs.unsafe.use.varargs.param", method.params.last()); } break; default: throw new AssertionError("Unexpected lint: " + lint); } } }
if (m.attribute(syms.overrideType.tsym) != null && !isOverrider(m)) { DiagnosticPosition pos = tree.pos(); for (JCAnnotation a : tree.getModifiers().annotations) {
void checkVarargsMethodDecl(Env<AttrContext> env, JCMethodDecl tree) { MethodSymbol m = tree.sym; if (!allowSimplifiedVarargs) return; boolean hasTrustMeAnno = m.attribute(syms.trustMeType.tsym) != null; Type varargElemType = null; if (m.isVarArgs()) {
if (m.attribute(syms.overrideType.tsym) != null && !isOverrider(m)) { DiagnosticPosition pos = tree.pos(); for (JCAnnotation a : tree.getModifiers().annotations) {
void checkVarargsMethodDecl(Env<AttrContext> env, JCMethodDecl tree) { MethodSymbol m = tree.sym; if (!allowSimplifiedVarargs) return; boolean hasTrustMeAnno = m.attribute(syms.trustMeType.tsym) != null; Type varargElemType = null; if (m.isVarArgs()) {
/** Returns true if the given method symbol has a {@code @Test(expected=...)} annotation. */ private static boolean isExpectedExceptionTest(MethodSymbol sym, VisitorState state) { Compound attribute = sym.attribute(state.getSymbolFromString(JUnitMatchers.JUNIT4_TEST_ANNOTATION)); if (attribute == null) { return false; } return attribute.member(state.getName("expected")) != null; }
/** Returns true if the given method symbol has a {@code @Test(expected=...)} annotation. */ private static boolean isExpectedExceptionTest(MethodSymbol sym, VisitorState state) { Compound attribute = sym.attribute(state.getSymbolFromString(JUnitMatchers.JUNIT4_TEST_ANNOTATION)); if (attribute == null) { return false; } return attribute.member(state.getName("expected")) != null; }