Skip to content

Commit

Permalink
Suppress warnings about TypeMirror.equals in some cases where we are …
Browse files Browse the repository at this point in the history
…calling it deliberately.

See [] for more details

#TypeEqualsCleanup

RELNOTES=Suppress TypeEquals check

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=256471146
  • Loading branch information
sumitbhagwani authored and netdpb committed Aug 19, 2019
1 parent 00d7197 commit e1beeff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/src/main/java/com/google/auto/common/MoreTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ && equal(enclosingType(a), enclosingType(b), newVisiting)
}

@Override
@SuppressWarnings("TypeEquals")
public Boolean visitError(ErrorType a, EqualVisitorParam p) {
return a.equals(p.type);
}
Expand Down Expand Up @@ -295,6 +296,7 @@ private Set<ComparedElements> visitingSetPlus(
}
}

@SuppressWarnings("TypeEquals")
private static boolean equal(TypeMirror a, TypeMirror b, Set<ComparedElements> visiting) {
// TypeMirror.equals is not guaranteed to return true for types that are equal, but we can
// assume that if it does return true then the types are equal. This check also avoids getting
Expand Down

0 comments on commit e1beeff

Please sign in to comment.