public boolean resolveDiagnosticNeeded(Type site, List<Type> argtypes, List<Type> typeargtypes) { return !site.isErroneous() && !Type.isErroneous(argtypes) && (typeargtypes == null || !Type.isErroneous(typeargtypes)); } public List<Type> getArgumentTypes(ResolveError errSym, Symbol accessedSym, Name name, List<Type> argtypes) {
public static boolean isErroneous(List<Type> ts) { for (List<Type> l = ts; l.nonEmpty(); l = l.tail) if (l.head.isErroneous()) return true; return false; }
public boolean isErroneous() { return isErroneous(argtypes) || restype != null && restype.isErroneous(); }
public void visitAnnotatedType(JCAnnotatedType tree) { if (!tree.underlyingType.type.isErroneous()) { super.visitAnnotatedType(tree); } } public void visitTypeParameter(JCTypeParameter tree) {
/** Report array/varargs duplicate declaration */ void varargsDuplicateError(DiagnosticPosition pos, Symbol sym1, Symbol sym2) { if (!sym1.type.isErroneous() && !sym2.type.isErroneous()) { log.error(pos, "array.and.varargs", sym1, sym2, sym2.location()); } }
public Type glb(List<Type> ts) { Type t1 = ts.head; for (Type t2 : ts.tail) { if (t1.isErroneous()) return t1; t1 = glb(t1, t2); } return t1; } //where
public boolean isErroneous() { return getEnclosingType().isErroneous() || isErroneous(getTypeArguments()) || this != tsym.type && tsym.type.isErroneous(); }
@Override public boolean accepts(Type t) { return !t.isErroneous() && !inferenceContext.free(t) && !t.hasTag(BOT); } };
void checkType(JCTree tree, Type type, String diag) { if (!tree.type.isErroneous() && !types.isSameType(tree.type, type)) { log.error(tree, diag, type, tree.type); } }
/** Report duplicate declaration error. */ void duplicateError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { log.error(pos, "already.defined", sym, sym.location()); } }
/** * Returns the next class to search for inherited annotations or {@code null} * if the next class can't be found. */ private ClassSymbol getSuperClassToSearchForAnnotations() { Type sup = getSuperclass(); if (!sup.hasTag(CLASS) || sup.isErroneous()) return null; return (ClassSymbol) sup.tsym; }
/** Report a conflict between a user symbol and a synthetic symbol. */ private void duplicateError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { log.error(pos, "synthetic.name.conflict", sym, sym.location()); } }
/** Report duplicate declaration error. */ void duplicateError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { log.error(pos, "already.defined", sym, sym.location()); } }
/** Report a conflict between a user symbol and a synthetic symbol. */ private void duplicateError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { log.error(pos, "synthetic.name.conflict", sym, sym.location()); } }
public void visitTypeParameter(JCTypeParameter tree) { TypeVar typeVar = (TypeVar) tree.type; if (tree.annotations != null && tree.annotations.nonEmpty()) { annotateType(tree, tree.annotations); } if (!typeVar.bound.isErroneous()) { //fixup type-parameter bound computed in 'attribTypeVariables' typeVar.bound = checkIntersection(tree, tree.bounds); } }
/** Report a conflict between a user symbol and a synthetic symbol. */ private void syntheticError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { if (warnOnSyntheticConflicts) { log.warning(pos, "synthetic.name.conflict", sym, sym.location()); } else { log.error(pos, "synthetic.name.conflict", sym, sym.location()); } } }
void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) { if (allowAnnotations && lint.isEnabled(Lint.LintCategory.DEP_ANN) && (s.flags() & DEPRECATED) != 0 && !syms.deprecatedType.isErroneous() && s.attribute(syms.deprecatedType.tsym) == null) { log.warning(pos, "missing.deprecated.annotation"); } }
/** Report a conflict between a user symbol and a synthetic symbol. */ private void syntheticError(DiagnosticPosition pos, Symbol sym) { if (!sym.type.isErroneous()) { if (warnOnSyntheticConflicts) { log.warning(pos, "synthetic.name.conflict", sym, sym.location()); } else { log.error(pos, "synthetic.name.conflict", sym, sym.location()); } } }
void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) { if (allowAnnotations && lint.isEnabled(Lint.LintCategory.DEP_ANN) && (s.flags() & DEPRECATED) != 0 && !syms.deprecatedType.isErroneous() && s.attribute(syms.deprecatedType.tsym) == null) { log.warning(pos, "missing.deprecated.annotation"); } }
/** @see com.sun.tools.javadoc.ClassDocImpl */ private boolean hasParameterTypes(MethodSymbol method, List<Type> paramTypes) { if (paramTypes == null) return true; if (method.params().size() != paramTypes.size()) return false; List<Type> methodParamTypes = types.erasureRecursive(method.asType()).getParameterTypes(); return (Type.isErroneous(paramTypes)) ? fuzzyMatch(paramTypes, methodParamTypes) : types.isSameTypes(paramTypes, methodParamTypes); }