@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ASTHelpers.TargetType) { ASTHelpers.TargetType that = (ASTHelpers.TargetType) o; return (this.type.equals(that.type())) && (this.path.equals(that.path())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof AbstractCollectionIncompatibleTypeMatcher.MatchResult) { AbstractCollectionIncompatibleTypeMatcher.MatchResult that = (AbstractCollectionIncompatibleTypeMatcher.MatchResult) o; return (this.sourceTree.equals(that.sourceTree())) && (this.sourceType.equals(that.sourceType())) && (this.targetType.equals(that.targetType())) && (this.matcher.equals(that.matcher())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof IncompatibleArgumentType.RequiredType) { IncompatibleArgumentType.RequiredType that = (IncompatibleArgumentType.RequiredType) o; return ((this.type == null) ? (that.type() == null) : this.type.equals(that.type())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MatchState) { MatchState that = (MatchState) o; return (this.ownerType.equals(that.ownerType())) && (this.sym.equals(that.sym())) && (this.paramTypes.equals(that.paramTypes())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof AssistedParameters.ConflictResult) { AssistedParameters.ConflictResult that = (AssistedParameters.ConflictResult) o; return (this.type.equals(that.type())) && (this.value.equals(that.value())) && (this.parameters.equals(that.parameters())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof UTypeVar.TypeWithExpression) { UTypeVar.TypeWithExpression that = (UTypeVar.TypeWithExpression) o; return (this.type.equals(that.type())) && ((this.expression == null) ? (that.expression() == null) : this.expression.equals(that.expression())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof EqualsIncompatibleType.TypeCompatibilityReport) { EqualsIncompatibleType.TypeCompatibilityReport that = (EqualsIncompatibleType.TypeCompatibilityReport) o; return (this.compatible == that.compatible()) && ((this.lhs == null) ? (that.lhs() == null) : this.lhs.equals(that.lhs())) && ((this.rhs == null) ? (that.rhs() == null) : this.rhs.equals(that.rhs())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GuardedByExpression.ClassLiteral) { GuardedByExpression.ClassLiteral that = (GuardedByExpression.ClassLiteral) o; return (this.kind.equals(that.kind())) && (this.sym.equals(that.sym())) && (this.type.equals(that.type())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GuardedByExpression.LocalVariable) { GuardedByExpression.LocalVariable that = (GuardedByExpression.LocalVariable) o; return (this.kind.equals(that.kind())) && (this.sym.equals(that.sym())) && (this.type.equals(that.type())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GuardedByExpression.Select) { GuardedByExpression.Select that = (GuardedByExpression.Select) o; return (this.kind.equals(that.kind())) && (this.sym.equals(that.sym())) && (this.type.equals(that.type())) && (this.base.equals(that.base())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GuardedByExpression.TypeLiteral) { GuardedByExpression.TypeLiteral that = (GuardedByExpression.TypeLiteral) o; return (this.kind.equals(that.kind())) && (this.sym.equals(that.sym())) && (this.type.equals(that.type())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Parameter) { Parameter that = (Parameter) o; return (this.name.equals(that.name())) && (this.type.equals(that.type())) && (this.index == that.index()) && (this.text.equals(that.text())) && (this.kind.equals(that.kind())) && (this.constant == that.constant()); } return false; }
@SuppressWarnings("TypeEquals") @Nullable public static MethodSymbol findSuperMethodInType( MethodSymbol methodSymbol, Type superType, Types types) { if (methodSymbol.isStatic() || superType.equals(methodSymbol.owner.type)) { return null; } Scope scope = superType.tsym.members(); for (Symbol sym : scope.getSymbolsByName(methodSymbol.name)) { if (sym != null && !sym.isStatic() && ((sym.flags() & Flags.SYNTHETIC) == 0) && methodSymbol.overrides( sym, (TypeSymbol) methodSymbol.owner, types, /* checkResult= */ true)) { return (MethodSymbol) sym; } } return null; }
@Override public Description matchCompoundAssignment(CompoundAssignmentTree tree, VisitorState state) { if (!matchWithinClass) { return Description.NO_MATCH; } Type lhsType = ASTHelpers.getType(tree.getVariable()); Type stringType = state.getTypeFromString("java.lang.String"); if (lhsType != null && !lhsType.equals(stringType)) { // both LHS and RHS could get unboxed return doUnboxingCheck(state, tree.getVariable(), tree.getExpression()); } return Description.NO_MATCH; }
if (s.equals(owner.type)) { continue;
private static int getCandidateMethodMatchScore(MethodSymbol candidate, MethodType methodType, Types types) { if (methodType == null || candidate.getParameters().size() != methodType.argtypes.size()) { return -50; } int score = 0; boolean isAbstract = (candidate.flags() & Flags.ABSTRACT) != 0; if (isAbstract) { score -= 30; } for (int i = 0; i < candidate.getParameters().size(); i++) { Type candidateParamType = candidate.getParameters().get(i).type; Type paramType = methodType.argtypes.get(i); if (!candidateParamType.equals(paramType)) { score--; } } return score; }
if (newClass.clazz.type.equals(context.symtab.stringType)) { if (newClass.args.length() >= 3) { getPrinter().print("((str, index, len) => ").print("str.substring(index, index + len))((")
|| !inv.args.isEmpty() && (inv.args.last().type.getKind() != TypeKind.ARRAY || !context.types.erasure(((ArrayType) inv.args.last().type).elemtype).equals( context.types.erasure(((ArrayType) methSym.getParameters().last().type).elemtype)))) { applyVarargs = false;
return; if (getScope().localClasses.stream().map(c -> c.type).anyMatch(t -> t.equals(newClass.type))) { print("new ").print(getScope().name + ".").print(newClass.clazz.toString()); print("(").printConstructorArgList(newClass, true).print(")");
|| newClass.args.last().type.getKind() != TypeKind.ARRAY || !context.types.erasure(((ArrayType) newClass.args.last().type).elemtype).equals( context.types.erasure(((ArrayType) methSym.getParameters().last().type).elemtype))) { applyVarargs = false;