Note: For most string-formatting needs, use {@link String#format String.format}, * {@link java.io.PrintWriter#format PrintWriter.format}, and related methods. These support the * full range of format + * href="https://docs.oracle.com/javase/21/docs/api/java/util/Formatter.html#syntax">format * specifiers, and alert you to usage errors by throwing {@link * java.util.IllegalFormatException}. * diff --git a/android/guava/src/com/google/common/collect/ImmutableCollection.java b/android/guava/src/com/google/common/collect/ImmutableCollection.java index 25d3336eadae..ab533379ee02 100644 --- a/android/guava/src/com/google/common/collect/ImmutableCollection.java +++ b/android/guava/src/com/google/common/collect/ImmutableCollection.java @@ -96,7 +96,7 @@ *
Expressing the immutability guarantee directly in the type that user code references is a * powerful advantage. Although Java offers certain immutable collection factory methods, such as * {@link Collections#singleton(Object)} and {@code Set.of}, + * href="https://docs.oracle.com/javase/21/docs/api/java/util/Set.html#immutable">{@code Set.of}, * we recommend using these classes instead for this reason (as well as for consistency). * *
Parameters for the benchmark are:
diff --git a/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java b/guava-bench/test/com/google/common/hash/MessageDigestCreationBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java
rename to guava-bench/test/com/google/common/hash/MessageDigestCreationBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java b/guava-bench/test/com/google/common/io/BaseEncodingBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java
rename to guava-bench/test/com/google/common/io/BaseEncodingBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java b/guava-bench/test/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java
rename to guava-bench/test/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java b/guava-bench/test/com/google/common/io/CharStreamsCopyBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java
rename to guava-bench/test/com/google/common/io/CharStreamsCopyBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java b/guava-bench/test/com/google/common/math/ApacheBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java
rename to guava-bench/test/com/google/common/math/ApacheBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java b/guava-bench/test/com/google/common/math/BigIntegerMathBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
rename to guava-bench/test/com/google/common/math/BigIntegerMathBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java b/guava-bench/test/com/google/common/math/BigIntegerMathRoundingBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java
rename to guava-bench/test/com/google/common/math/BigIntegerMathRoundingBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java b/guava-bench/test/com/google/common/math/DoubleMathBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java
rename to guava-bench/test/com/google/common/math/DoubleMathBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java b/guava-bench/test/com/google/common/math/DoubleMathRoundingBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java
rename to guava-bench/test/com/google/common/math/DoubleMathRoundingBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java b/guava-bench/test/com/google/common/math/IntMathBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java
rename to guava-bench/test/com/google/common/math/IntMathBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java b/guava-bench/test/com/google/common/math/IntMathRoundingBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java
rename to guava-bench/test/com/google/common/math/IntMathRoundingBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java b/guava-bench/test/com/google/common/math/LessThanBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java
rename to guava-bench/test/com/google/common/math/LessThanBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java b/guava-bench/test/com/google/common/math/LongMathBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java
rename to guava-bench/test/com/google/common/math/LongMathBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java b/guava-bench/test/com/google/common/math/LongMathRoundingBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java
rename to guava-bench/test/com/google/common/math/LongMathRoundingBenchmark.java
diff --git a/guava-tests/test/com/google/common/math/MathBenchmarking.java b/guava-bench/test/com/google/common/math/MathBenchmarking.java
similarity index 100%
rename from guava-tests/test/com/google/common/math/MathBenchmarking.java
rename to guava-bench/test/com/google/common/math/MathBenchmarking.java
diff --git a/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java b/guava-bench/test/com/google/common/math/QuantilesBenchmark.java
similarity index 98%
rename from guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java
rename to guava-bench/test/com/google/common/math/QuantilesBenchmark.java
index d97c2d56d642..7cf7e312bbcd 100644
--- a/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java
+++ b/guava-bench/test/com/google/common/math/QuantilesBenchmark.java
@@ -23,6 +23,7 @@
import com.google.common.collect.DiscreteDomain;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Range;
+import com.google.common.testing.math.QuantilesAlgorithm;
import java.util.Random;
/** Benchmarks some algorithms providing the same functionality as {@link Quantiles}. */
diff --git a/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java b/guava-bench/test/com/google/common/math/StatsBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/math/StatsBenchmark.java
rename to guava-bench/test/com/google/common/math/StatsBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java b/guava-bench/test/com/google/common/primitives/UnsignedBytesBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java
rename to guava-bench/test/com/google/common/primitives/UnsignedBytesBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java b/guava-bench/test/com/google/common/primitives/UnsignedLongsBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java
rename to guava-bench/test/com/google/common/primitives/UnsignedLongsBenchmark.java
diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java b/guava-bench/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java
similarity index 97%
rename from guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java
rename to guava-bench/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java
index d90c5bbe807d..9321eb05272a 100644
--- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java
+++ b/guava-bench/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java
@@ -16,17 +16,14 @@
package com.google.common.util.concurrent;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import com.google.errorprone.annotations.CanIgnoreReturnValue;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import org.checkerframework.checker.nullness.qual.Nullable;
+import java.util.concurrent.*;
+import java.util.concurrent.locks.AbstractQueuedSynchronizer;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
/** Utilities for the AbstractFutureBenchmarks */
final class AbstractFutureBenchmarks {
private AbstractFutureBenchmarks() {}
@@ -211,7 +208,7 @@ public void addListener(Runnable listener, Executor exec) {
/**
* Subclasses should invoke this method to set the result of the computation to {@code value}.
- * This will set the state of the future to {@link OldAbstractFuture.Sync#COMPLETED} and invoke
+ * This will set the state of the future to {@link Sync#COMPLETED} and invoke
* the listeners if the state was successfully changed.
*
* @param value the value that was the result of the task.
@@ -228,7 +225,7 @@ protected boolean set(@Nullable V value) {
/**
* Subclasses should invoke this method to set the result of the computation to an error, {@code
- * throwable}. This will set the state of the future to {@link OldAbstractFuture.Sync#COMPLETED}
+ * throwable}. This will set the state of the future to {@link Sync#COMPLETED}
* and invoke the listeners if the state was successfully changed.
*
* @param throwable the exception that the task failed with.
diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java b/guava-bench/test/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java
rename to guava-bench/test/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java b/guava-bench/test/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java
similarity index 100%
rename from guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java
rename to guava-bench/test/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java
diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java b/guava-bench/test/com/google/common/util/concurrent/ExecutionListBenchmark.java
similarity index 99%
rename from guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
rename to guava-bench/test/com/google/common/util/concurrent/ExecutionListBenchmark.java
index 946b85109cb8..def54109f0e4 100644
--- a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
+++ b/guava-bench/test/com/google/common/util/concurrent/ExecutionListBenchmark.java
@@ -42,6 +42,7 @@
/** Benchmarks for {@link ExecutionList}. */
@VmOptions({"-Xms8g", "-Xmx8g"})
+@SuppressWarnings({"removal", "deprecation"})
public class ExecutionListBenchmark {
private static final int NUM_THREADS = 10; // make a param?
@@ -375,7 +376,7 @@ public void run() {
// This is the old implementation of ExecutionList using a LinkedList.
private static final class OldExecutionList {
static final Logger log = Logger.getLogger(OldExecutionList.class.getName());
- final Queue
Note: For most string-formatting needs, use {@link String#format String.format},
* {@link java.io.PrintWriter#format PrintWriter.format}, and related methods. These support the
* full range of format
+ * href="https://docs.oracle.com/javase/21/docs/api/java/util/Formatter.html#syntax">format
* specifiers, and alert you to usage errors by throwing {@link
* java.util.IllegalFormatException}.
*
diff --git a/guava/src/com/google/common/cache/CacheBuilder.java b/guava/src/com/google/common/cache/CacheBuilder.java
index ca0754c83f92..ff54bfd2ff7c 100644
--- a/guava/src/com/google/common/cache/CacheBuilder.java
+++ b/guava/src/com/google/common/cache/CacheBuilder.java
@@ -967,7 +967,6 @@ Ticker getTicker(boolean recordsTime) {
*
* @return the cache builder reference that should be used instead of {@code this} for any
* remaining configuration and cache building
- * @return this {@code CacheBuilder} instance (for chaining)
* @throws IllegalStateException if a removal listener was already set
*/
public JVM intrinsics note: It would be possible to use a release-only form of CAS here, if it were
* provided.
*/
+ @SuppressWarnings({"deprecation", "removal", "unused"})
static final class Cell {
volatile long p0, p1, p2, p3, p4, p5, p6;
volatile long value;
@@ -103,7 +104,7 @@ static final class Cell {
value = x;
}
- final boolean cas(long cmp, long val) {
+ boolean cas(long cmp, long val) {
return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val);
}
diff --git a/guava/src/com/google/common/collect/ImmutableCollection.java b/guava/src/com/google/common/collect/ImmutableCollection.java
index 80987788cda7..40d3b9b4a5c9 100644
--- a/guava/src/com/google/common/collect/ImmutableCollection.java
+++ b/guava/src/com/google/common/collect/ImmutableCollection.java
@@ -94,9 +94,9 @@
* Expressing the immutability guarantee directly in the type that user code references is a
* powerful advantage. Although Java offers certain immutable collection factory methods, such as
* {@link Collections#singleton(Object)} and {@code Set.of},
- * we recommend using these classes instead for this reason (as well as for consistency).
- *
+ * href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Set.html#of()">
+ * {@code Set.of}, we recommend using these classes instead for this reason (as well
+ * as for consistency).
* Except for logically "abstract" types like {@code ImmutableCollection} itself, each {@code
diff --git a/guava/src/com/google/common/graph/ValueGraph.java b/guava/src/com/google/common/graph/ValueGraph.java
index 6495e2d4d0ba..089c712a9020 100644
--- a/guava/src/com/google/common/graph/ValueGraph.java
+++ b/guava/src/com/google/common/graph/ValueGraph.java
@@ -308,9 +308,9 @@ public interface ValueGraph Unlike the other {@code EndpointPair}-accepting methods, this method does not throw if the
* endpoints are unordered and the graph is directed; it simply returns {@code false}. This is for
- * consistency with the behavior of {@link Collection#contains(Object)} (which does not generally
- * throw if the object cannot be present in the collection), and the desire to have this method's
- * behavior be compatible with {@code edges().contains(endpoints)}.
+ * consistency with the behavior of {@link java.util.Collection#contains(Object)} (which does not
+ * generally throw if the object cannot be present in the collection), and the desire to have this
+ * method's behavior be compatible with {@code edges().contains(endpoints)}.
*
* @since 27.1
*/
diff --git a/guava/src/com/google/common/primitives/package-info.java b/guava/src/com/google/common/primitives/package-info.java
index ad38c111393c..af077e2cc43c 100644
--- a/guava/src/com/google/common/primitives/package-info.java
+++ b/guava/src/com/google/common/primitives/package-info.java
@@ -29,7 +29,7 @@
* The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the
* current thread is interrupted during the call, even if the value is already available.
*
- * @throws CancellationException {@inheritDoc}
+ * @throws CancellationException if the computation was cancelled
*/
@CanIgnoreReturnValue
@Override
@@ -539,7 +540,7 @@ public V get(long timeout, TimeUnit unit)
* The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the
* current thread is interrupted during the call, even if the value is already available.
*
- * @throws CancellationException {@inheritDoc}
+ * @throws CancellationException if the computation was cancelled
*/
@CanIgnoreReturnValue
@Override
diff --git a/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java b/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java
index 4e13a9d0b315..fd1ceac0408f 100644
--- a/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java
+++ b/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java
@@ -29,6 +29,7 @@
import com.google.errorprone.annotations.concurrent.LazyInit;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
+import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.CheckForNull;
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -37,7 +38,7 @@
* Serializes execution of tasks, somewhat like an "asynchronous {@code synchronized} block." Each
* {@linkplain #submit enqueued} callable will not be submitted to its associated executor until the
* previous callable has returned -- and, if the previous callable was an {@link AsyncCallable}, not
- * until the {@code Future} it returned is {@linkplain Future#isDone done} (successful, failed, or
+ * until the {@code Future} it returned is {@linkplain Future#isDone()} (successful, failed, or
* cancelled).
*
* This class serializes execution of submitted tasks but not any listeners of
diff --git a/guava/src/com/google/common/util/concurrent/ListeningExecutorService.java b/guava/src/com/google/common/util/concurrent/ListeningExecutorService.java
index b870e34fef59..ade3e6c44992 100644
--- a/guava/src/com/google/common/util/concurrent/ListeningExecutorService.java
+++ b/guava/src/com/google/common/util/concurrent/ListeningExecutorService.java
@@ -47,21 +47,21 @@
public interface ListeningExecutorService extends ExecutorService {
/**
* @return a {@code ListenableFuture} representing pending completion of the task
- * @throws RejectedExecutionException {@inheritDoc}
+ * @throws RejectedExecutionException if the task cannot be scheduled for execution
*/
@Override
Creation
*
*
*
diff --git a/guava/src/com/google/common/util/concurrent/AbstractFuture.java b/guava/src/com/google/common/util/concurrent/AbstractFuture.java
index 96ecda5f5168..6ae282d241af 100644
--- a/guava/src/com/google/common/util/concurrent/AbstractFuture.java
+++ b/guava/src/com/google/common/util/concurrent/AbstractFuture.java
@@ -65,6 +65,7 @@
* @since 1.0
*/
@SuppressWarnings({
+ "removal", // `AccessController` removal
"ShortCircuitBoolean", // we use non-short circuiting comparisons intentionally
"nullness", // TODO(b/147136275): Remove once our checker understands & and |.
})
@@ -426,7 +427,7 @@ protected AbstractFuture() {}
*