Suppress Error Prone findings locally.

RELNOTES=n/a
PiperOrigin-RevId: 664836848
This commit is contained in:
cpovirk 2024-08-19 09:14:35 -07:00 committed by Google Java Core Libraries
parent 55911e8432
commit d6192739d0
8 changed files with 16 additions and 3 deletions

View File

@ -59,6 +59,7 @@ public class BigIntegerMathBenchmark {
}
/** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
@SuppressWarnings("UseCorrectAssertInTests") // TODO(b/345814817): Remove or convert assertion.
private static BigInteger oldSlowFactorial(int n1, int n2) {
assert n1 <= n2;
if (IntMath.log2(n2, CEILING) * (n2 - n1) < Long.SIZE - 1) {

View File

@ -390,6 +390,8 @@ public abstract class ImmutableList<E> extends ImmutableCollection<E>
}
/** A singleton implementation of iterator() for the empty ImmutableList. */
// TODO(b/345814817): Move this to RegularImmutableList?
@SuppressWarnings("ClassInitializationDeadlock")
private static final UnmodifiableListIterator<Object> EMPTY_ITR =
new Itr<Object>(RegularImmutableList.EMPTY, 0);

View File

@ -429,6 +429,7 @@ public abstract class AbstractFuture<V extends @Nullable Object> extends Interna
*
* @throws CancellationException {@inheritDoc}
*/
@SuppressWarnings("LabelledBreakTarget") // TODO(b/345814817): Maybe fix?
@CanIgnoreReturnValue
@Override
@ParametricNullness

View File

@ -460,7 +460,10 @@ public final class Monitor {
* @return whether the monitor was entered, which guarantees that the guard is now satisfied
* @throws InterruptedException if interrupted while waiting
*/
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
@SuppressWarnings({
"GoodTime", // should accept a java.time.Duration
"LabelledBreakTarget", // TODO(b/345814817): Maybe fix.
})
public boolean enterWhen(Guard guard, long time, TimeUnit unit) throws InterruptedException {
final long timeoutNanos = toSafeNanos(time, unit);
if (guard.monitor != this) {

View File

@ -55,7 +55,8 @@ public abstract class ImmutableSortedSet<E> extends ForwardingImmutableSet<E>
private static final Comparator<?> NATURAL_ORDER = Ordering.natural();
@SuppressWarnings("unchecked")
// TODO(b/345814817): Move this to RegularImmutableSortedSet?
@SuppressWarnings({"unchecked", "ClassInitializationDeadlock"})
private static final ImmutableSortedSet<Object> NATURAL_EMPTY_SET =
new RegularImmutableSortedSet<Object>(
new TreeSet<Object>((Comparator<Object>) NATURAL_ORDER), false);

View File

@ -59,6 +59,7 @@ public class BigIntegerMathBenchmark {
}
/** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
@SuppressWarnings("UseCorrectAssertInTests") // TODO(b/345814817): Remove or convert assertion.
private static BigInteger oldSlowFactorial(int n1, int n2) {
assert n1 <= n2;
if (IntMath.log2(n2, CEILING) * (n2 - n1) < Long.SIZE - 1) {

View File

@ -429,6 +429,7 @@ public abstract class AbstractFuture<V extends @Nullable Object> extends Interna
*
* @throws CancellationException {@inheritDoc}
*/
@SuppressWarnings("LabelledBreakTarget") // TODO(b/345814817): Maybe fix?
@CanIgnoreReturnValue
@Override
@ParametricNullness

View File

@ -514,7 +514,10 @@ public final class Monitor {
* @return whether the monitor was entered, which guarantees that the guard is now satisfied
* @throws InterruptedException if interrupted while waiting
*/
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
@SuppressWarnings({
"GoodTime", // should accept a java.time.Duration
"LabelledBreakTarget", // TODO(b/345814817): Maybe fix.
})
public boolean enterWhen(Guard guard, long time, TimeUnit unit) throws InterruptedException {
final long timeoutNanos = toSafeNanos(time, unit);
if (guard.monitor != this) {