Error Prone: Enable and fix ReferenceEquality
An unfortunate number of instances of this warning are actually
depending on this behavior, but in those cases it's probably better to
have an actual method making the intent explicit. The exception is
WrappableSearcherManager, which is intended to have minimal diff from
the implementation we copied from Lucene.
In the cases in PatchScriptBuilder, it was using "x == y || x.equals(y)"
as a sort of null-safe comparison, which we now have Objects#equals for.
Change-Id: I8781765813459c7fd03a45d4ef0fb355b8c5f486
diff --git a/tools/BUILD b/tools/BUILD
index 65ac23d..c3cc95b 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -85,7 +85,7 @@
"-Xep:PreconditionsInvalidPlaceholder:ERROR",
"-Xep:ProtoFieldPreconditionsCheckNotNull:ERROR",
"-Xep:ProtocolBufferOrdinal:ERROR",
- #"-Xep:ReferenceEquality:ERROR",
+ "-Xep:ReferenceEquality:ERROR",
"-Xep:RequiredModifiers:ERROR",
"-Xep:ShortCircuitBoolean:ERROR",
"-Xep:SimpleDateFormatConstant:ERROR",