@Override public boolean equals(Object o) { if (!(o instanceof HashCodeAndEqualsSafeSet)) { return false; } HashCodeAndEqualsSafeSet that = (HashCodeAndEqualsSafeSet) o; return backingHashSet.equals(that.backingHashSet); }
@Override public boolean equals(Object o) { if (!(o instanceof HashCodeAndEqualsSafeSet)) { return false; } HashCodeAndEqualsSafeSet that = (HashCodeAndEqualsSafeSet) o; return backingHashSet.equals(that.backingHashSet); }
@Override public boolean equals(Object another) { if (another == null || !(another instanceof StopMatcher)) { return false; } if (another == this) { return true; } StopMatcher anotherMatcher = (StopMatcher) another; return agencyAndStopIds.equals(anotherMatcher.agencyAndStopIds); }
@Override public boolean equals(Object another) { if (another == null || !(another instanceof RouteMatcher)) return false; if (another == this) return true; RouteMatcher anotherMatcher = (RouteMatcher) another; return agencyAndRouteIds.equals(anotherMatcher.agencyAndRouteIds) && agencyIdAndRouteNames.equals(anotherMatcher.agencyIdAndRouteNames) && routeNames.equals(anotherMatcher.routeNames); }
public boolean isEquivTo(RWSet other) { if (!(other instanceof SiteRWSet)) { return false; } SiteRWSet o = (SiteRWSet) other; if (o.callsNative != callsNative) { return false; } return o.sets.equals(sets); } }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof ResultsSet)) { return false; } if (!this.elementType.equals(((ResultsSet) other).elementType)) { return false; } return super.equals(other); }
public boolean equals(Object o) { if (o == null) return false; if (o.getClass()!=this.getClass()) return false; JobStateTransitions that = (JobStateTransitions) o; return new HashSet<>(this).equals(new HashSet<>(that)); }
static int compareSignature(Signature[] signatures1, Signature[] signatures2) { if (signatures1 == null) { return (signatures2 == null) ? SIGNATURE_NEITHER_SIGNED : SIGNATURE_FIRST_NOT_SIGNED; } if (signatures2 == null) { return SIGNATURE_SECOND_NOT_SIGNED; } if (signatures1.length != signatures2.length) { return SIGNATURE_NO_MATCH; } HashSet<Signature> signatures1set = new HashSet<>(asList(signatures1)); HashSet<Signature> signatures2set = new HashSet<>(asList(signatures2)); return signatures1set.equals(signatures2set) ? SIGNATURE_MATCH : SIGNATURE_NO_MATCH; }
private static boolean groupsOnAllColumns(AggregationNode node, List<Symbol> columns) { return new HashSet<>(node.getGroupingKeys()).equals(new HashSet<>(columns)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ScheduleOptions that = (ScheduleOptions) o; if (specifiedRevisions != null ? !specifiedRevisions.equals(that.specifiedRevisions) : that.specifiedRevisions != null) { return false; } // `Set` because we explicitly want to ignore ordering while comparing, for tests if (variables != null ? !new HashSet<>(variables).equals(new HashSet<>(that.variables)) : that.variables != null) { return false; } return true; }
@ExpectWarning("EC_UNRELATED_TYPES") public boolean test(HashSet<Integer> s1, HashSet<String> s2) { return s1.equals(s2); } @ExpectWarning("GC_UNRELATED_TYPES")
@NoWarning("EC_UNRELATED_TYPES") public boolean test(HashSet<Integer> s1, TreeSet<Integer> s2) { return s1.equals(s2); } @ExpectWarning("EC_UNRELATED_TYPES")
@ExpectWarning("EC_UNRELATED_TYPES") static boolean test3(HashSet<Integer> s, LinkedList<String> lst) { return s.equals(lst); }
@ExpectWarning("EC_UNRELATED_TYPES") static boolean test1(HashSet<Integer> s, LinkedList<Integer> lst) { return s.equals(lst); }
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof OptionSpec)) { return false; } OptionSpec other = (OptionSpec) obj; boolean result = super.equalsImpl(other) && help == other.help && usageHelp == other.usageHelp && versionHelp == other.versionHelp && order == other.order && new HashSet<String>(Arrays.asList(names)).equals(new HashSet<String>(Arrays.asList(other.names))); return result; } public int hashCode() {
private static boolean canUseUniqueIndex(Index idx, Table table, IndexColumn[] cols) { if (idx.getTable() != table || !idx.getIndexType().isUnique()) { return false; } Column[] indexCols = idx.getColumns(); HashSet<Column> indexColsSet = new HashSet<>(); Collections.addAll(indexColsSet, indexCols); HashSet<Column> colsSet = new HashSet<>(); for (IndexColumn c : cols) { colsSet.add(c.column); } return colsSet.equals(indexColsSet); }
public void testEquals_bothDefaultOrdering() { SortedSet<String> set = of("a", "b", "c"); assertEquals(set, Sets.newTreeSet(asList("a", "b", "c"))); assertEquals(Sets.newTreeSet(asList("a", "b", "c")), set); assertFalse(set.equals(Sets.newTreeSet(asList("a", "b", "d")))); assertFalse(Sets.newTreeSet(asList("a", "b", "d")).equals(set)); assertFalse(set.equals(Sets.newHashSet(4, 5, 6))); assertFalse(Sets.newHashSet(4, 5, 6).equals(set)); }
public void testEquals_bothExplicitOrdering() { SortedSet<String> set = of("in", "the", "a"); assertEquals(Sets.newTreeSet(asList("in", "the", "a")), set); assertFalse(set.equals(Sets.newTreeSet(asList("in", "the", "house")))); assertFalse(Sets.newTreeSet(asList("in", "the", "house")).equals(set)); assertFalse(set.equals(Sets.newHashSet(4, 5, 6))); assertFalse(Sets.newHashSet(4, 5, 6).equals(set)); Set<String> complex = Sets.newTreeSet(STRING_LENGTH); Collections.addAll(complex, "in", "the", "a"); assertEquals(set, complex); }
private static ConstraintUnique lookupUniqueForReferential(ConstraintReferential referential) { Table table = referential.getRefTable(); for (Constraint c : table.getConstraints()) { if (c.getConstraintType() == Constraint.Type.UNIQUE) { ConstraintUnique unique = (ConstraintUnique) c; if (unique.getReferencedColumns(table).equals(referential.getReferencedColumns(table))) { return unique; } } } return null; }
public PlanNode replace(int group, PlanNode node, String reason) { PlanNode old = getGroup(group).membership; checkArgument(new HashSet<>(old.getOutputSymbols()).equals(new HashSet<>(node.getOutputSymbols())), "%s: transformed expression doesn't produce same outputs: %s vs %s", reason, old.getOutputSymbols(), node.getOutputSymbols()); if (node instanceof GroupReference) { node = getNode(((GroupReference) node).getGroupId()); } else { node = insertChildrenAndRewrite(node); } incrementReferenceCounts(node, group); getGroup(group).membership = node; decrementReferenceCounts(old, group); evictStatisticsAndCost(group); return node; }