Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Use Types.isSameType for comparing TypeMirrors.
Browse files Browse the repository at this point in the history
The documentation on TypeMirror.equals states "Semantic comparisons of type equality should instead use Types.isSameType(TypeMirror, TypeMirror). The results of t1.equals(t2) and Types.isSameType(t1, t2) may differ.".
  • Loading branch information
JakeWharton committed Aug 26, 2014
1 parent b088b28 commit 61e471d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private Map<String, List<ExecutableElement>> providerMethodsByClass(RoundEnviron
TypeElement moduleType = (TypeElement) module;

// Verify that all modules do not extend from non-Object types.
if (!moduleType.getSuperclass().equals(objectType)) {
if (!types.isSameType(moduleType.getSuperclass(), objectType)) {
error("Modules must not extend from other classes: " + elementToString(module), module);
}

Expand Down

0 comments on commit 61e471d

Please sign in to comment.