Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public FakeTicker advance(long nanoseconds) {
@GwtIncompatible
@J2ktIncompatible
@CanIgnoreReturnValue
@IgnoreJRERequirement // TODO: b/288085449 - Remove this once we use library-desugaring scents.
@Beta // TODO: b/288085449 - Remove @Beta after we're sure that Java 8 APIs are safe for Android
@IgnoreJRERequirement // TODO(b/288085449): Remove this once we use library-desugaring scents.
@Beta // TODO(b/288085449): Remove @Beta after we're sure that Java 8 APIs are safe for Android
public FakeTicker advance(Duration duration) {
return advance(duration.toNanos());
}
Expand Down Expand Up @@ -104,8 +104,8 @@ public FakeTicker setAutoIncrementStep(long autoIncrementStep, TimeUnit timeUnit
@GwtIncompatible
@J2ktIncompatible
@CanIgnoreReturnValue
@IgnoreJRERequirement // TODO: b/288085449 - Remove this once we use library-desugaring scents.
@Beta // TODO: b/288085449 - Remove @Beta after we're sure that Java 8 APIs are safe for Android
@IgnoreJRERequirement // TODO(b/288085449): Remove this once we use library-desugaring scents.
@Beta // TODO(b/288085449): Remove @Beta after we're sure that Java 8 APIs are safe for Android
public FakeTicker setAutoIncrementStep(Duration autoIncrementStep) {
return setAutoIncrementStep(autoIncrementStep.toNanos(), NANOSECONDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void nullPointerExceptions() {

@Test
@GwtIncompatible // java.time.Duration
@IgnoreJRERequirement // TODO: b/288085449 - Remove this once we use library-desugaring scents.
@IgnoreJRERequirement // TODO(b/288085449): Remove this once we use library-desugaring scents.
public void advance() {
FakeTicker ticker = new FakeTicker();
assertEquals(0, ticker.read());
Expand Down Expand Up @@ -100,7 +100,7 @@ public void autoIncrementStep_seconds() {

@Test
@GwtIncompatible // java.time.Duration
@IgnoreJRERequirement // TODO: b/288085449 - Remove this once we use library-desugaring scents.
@IgnoreJRERequirement // TODO(b/288085449): Remove this once we use library-desugaring scents.
public void autoIncrementStep_duration() {
FakeTicker ticker = new FakeTicker().setAutoIncrementStep(Duration.ofMillis(1));
assertEquals(0, ticker.read());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static final class Interruptenator extends Thread {
this(interruptee, new AtomicBoolean(false));
}

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
Interruptenator(Thread interruptee, AtomicBoolean shutdown) {
super(
() -> {
Expand All @@ -141,7 +141,7 @@ static final class Interruptenator extends Thread {
start();
}

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
void shutdown() {
shutdown.set(true);
while (this.isAlive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public String load(String key) throws InterruptedException {
@J2ktIncompatible
@GwtIncompatible // QueuingRemovalListener

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
public void testRemovalNotification_clear_basher() throws InterruptedException {
// If a clear() happens close to the end of computation, one of two things should happen:
// - computation ends first: the removal listener is called, and the cache does not contain the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ public String load(String key) throws IOException, InterruptedException {
* {@code getUnchecked}, and threads with an odd index will call {@code get}. If the cache throws
* exceptions, this difference may be visible in the returned List.
*/
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
private static <K> List<Object> doConcurrentGet(
LoadingCache<K, ?> cache, K key, int nThreads, CountDownLatch gettersStartedSignal)
throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public String load(String key) {
}

@Override
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
public ListenableFuture<String> reload(String key, String oldValue) {
return refreshExecutor.submit(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public void testContains() {
assertFalse(set.contains(4));
}

// TODO: https://youtrack.jetbrains.com/issue/KT-71001/ - Enable when Kotlin throws expected CCE.
// TODO(user): Enable when Kotlin throws expected CCE.
@J2ktIncompatible
public void testContains_typeMismatch() {
ImmutableSortedSet<Integer> set = ContiguousSet.create(Range.open(0, 4), integers());
Expand All @@ -299,7 +299,7 @@ public void testContainsAll() {
}
}

// TODO: https://youtrack.jetbrains.com/issue/KT-71001/ - Enable when Kotlin throws expected CCE.
// TODO(user): Enable when Kotlin throws expected CCE.
@J2ktIncompatible
public void testContainsAll_typeMismatch() {
ImmutableSortedSet<Integer> set = ContiguousSet.create(Range.closed(1, 3), integers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private void assertInterruptibleDrained(BlockingQueue<Object> q) {
}

// same as above; uninterruptible version
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
private void assertUninterruptibleDrained(BlockingQueue<Object> q) {
assertEquals(0, drainUninterruptibly(q, ImmutableList.of(), 0, 10, MILLISECONDS));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void testCreateParentDirectories_multipleParentsNeeded() throws IOExcepti

public void testCreateParentDirectories_noPermission() {
if (isWindows()) {
return; // TODO: b/136041958 - Create/find a directory that we don't have permissions on?
return; // TODO(b/136041958): Create/find a directory that we don't have permissions on?
}
Path file = root().resolve("parent/nonexistent.file");
Path parent = file.getParent();
Expand Down Expand Up @@ -570,7 +570,7 @@ public void testDeleteDirectoryContents_symlinkToDir_sdsNotSupported_allowInsecu
* <p>We can only test this with a file system that supports SecureDirectoryStream, because it's
* not possible to protect against this if the file system doesn't.
*/
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
public void testDirectoryDeletion_directorySymlinkRace() throws Exception {
int iterations = isAndroid() ? 100 : 5000;
for (DirectoryDeleteMethod method : EnumSet.allOf(DirectoryDeleteMethod.class)) {
Expand Down Expand Up @@ -641,7 +641,7 @@ public void testDeleteRecursively_nonDirectoryFile() throws IOException {
* between being a directory and being a symlink, while the given {@code target} is the target the
* symlink should have.
*/
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
private static Future<?> startDirectorySymlinkSwitching(
Path file, Path target, ExecutorService executor) {
return executor.submit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public void testGCDNegativeZeroThrows() {
public void testCheckedAdd() {
for (int a : ALL_INTEGER_CANDIDATES) {
for (int b : ALL_INTEGER_CANDIDATES) {
// TODO: cpovirk - Test against Math.addExact instead?
// TODO(cpovirk): Test against Math.addExact instead?
BigInteger expectedResult = bigInt(a).add(bigInt(b));
boolean expectedSuccess = fitsInInt(expectedResult);
try {
Expand All @@ -474,7 +474,7 @@ public void testCheckedAdd() {
public void testCheckedSubtract() {
for (int a : ALL_INTEGER_CANDIDATES) {
for (int b : ALL_INTEGER_CANDIDATES) {
// TODO: cpovirk - Test against Math.subtractExact instead?
// TODO(cpovirk): Test against Math.subtractExact instead?
BigInteger expectedResult = bigInt(a).subtract(bigInt(b));
boolean expectedSuccess = fitsInInt(expectedResult);
try {
Expand All @@ -492,7 +492,7 @@ public void testCheckedSubtract() {
public void testCheckedMultiply() {
for (int a : ALL_INTEGER_CANDIDATES) {
for (int b : ALL_INTEGER_CANDIDATES) {
// TODO: cpovirk - Test against Math.multiplyExact instead?
// TODO(cpovirk): Test against Math.multiplyExact instead?
BigInteger expectedResult = bigInt(a).multiply(bigInt(b));
boolean expectedSuccess = fitsInInt(expectedResult);
try {
Expand Down Expand Up @@ -742,7 +742,7 @@ public void testSaturatedAbs() {

private static int force32(int value) {
// GWT doesn't consistently overflow values to make them 32-bit, so we need to force it.
// TODO: b/404577035 - Remove this unless it's needed for J2CL.
// TODO(b/404577035): Remove this unless it's needed for J2CL.
// One of its users, testDivNonZero, is currently @GwtIncompatible, but maybe it WOULD need it?
// And if it's needed, maybe use our usual trick of ~~ instead?
return value & 0xffffffff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public void testGCDNegativeZeroThrows() {
public void testCheckedAdd() {
for (long a : ALL_LONG_CANDIDATES) {
for (long b : ALL_LONG_CANDIDATES) {
// TODO: cpovirk - Test against Math.addExact instead?
// TODO(cpovirk): Test against Math.addExact instead?
BigInteger expectedResult = bigInt(a).add(bigInt(b));
boolean expectedSuccess = fitsInLong(expectedResult);
try {
Expand All @@ -530,7 +530,7 @@ public void testCheckedAdd() {
public void testCheckedSubtract() {
for (long a : ALL_LONG_CANDIDATES) {
for (long b : ALL_LONG_CANDIDATES) {
// TODO: cpovirk - Test against Math.subtractExact instead?
// TODO(cpovirk): Test against Math.subtractExact instead?
BigInteger expectedResult = bigInt(a).subtract(bigInt(b));
boolean expectedSuccess = fitsInLong(expectedResult);
try {
Expand Down Expand Up @@ -563,7 +563,7 @@ public void testCheckedMultiply() {
*/
continue;
}
// TODO: cpovirk - Test against Math.multiplyExact instead?
// TODO(cpovirk): Test against Math.multiplyExact instead?
BigInteger expectedResult = bigInt(a).multiply(bigInt(b));
boolean expectedSuccess = fitsInLong(expectedResult);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void testScanFromFile_notJarFile() throws IOException {

public void testGetClassPathEntry() throws MalformedURLException, URISyntaxException {
if (isWindows()) {
return; // TODO: b/136041958 - We need to account for drive letters in the path.
return; // TODO(b/136041958): We need to account for drive letters in the path.
}
assertEquals(
new File("/usr/test/dep.jar").toURI(),
Expand Down Expand Up @@ -288,7 +288,7 @@ public void testGetClassPathFromManifest_jarInCurrentDirectory() throws IOExcept

public void testGetClassPathFromManifest_absoluteDirectory() throws IOException {
if (isWindows()) {
return; // TODO: b/136041958 - We need to account for drive letters in the path.
return; // TODO(b/136041958): We need to account for drive letters in the path.
}
File jarFile = new File("base/some.jar");
Manifest manifest = manifestClasspath("file:/with/absolute/dir");
Expand All @@ -298,7 +298,7 @@ public void testGetClassPathFromManifest_absoluteDirectory() throws IOException

public void testGetClassPathFromManifest_absoluteJar() throws IOException {
if (isWindows()) {
return; // TODO: b/136041958 - We need to account for drive letters in the path.
return; // TODO(b/136041958): We need to account for drive letters in the path.
}
File jarFile = new File("base/some.jar");
Manifest manifest = manifestClasspath("file:/with/absolute.jar");
Expand All @@ -308,7 +308,7 @@ public void testGetClassPathFromManifest_absoluteJar() throws IOException {

public void testGetClassPathFromManifest_multiplePaths() throws IOException {
if (isWindows()) {
return; // TODO: b/136041958 - We need to account for drive letters in the path.
return; // TODO(b/136041958): We need to account for drive letters in the path.
}
File jarFile = new File("base/some.jar");
Manifest manifest = manifestClasspath("file:/with/absolute.jar relative.jar relative/dir");
Expand Down Expand Up @@ -371,7 +371,7 @@ public void testGetPackageName() {
@AndroidIncompatible
public void testGetClassPathUrls() throws Exception {
if (isWindows()) {
return; // TODO: b/136041958 - We need to account for drive letters in the path.
return; // TODO(b/136041958): We need to account for drive letters in the path.
}
String oldPathSeparator = PATH_SEPARATOR.value();
String oldClassPath = JAVA_CLASS_PATH.value();
Expand Down Expand Up @@ -518,7 +518,7 @@ private static File fullpath(String path) {

private static URL makeJarUrlWithName(String name) throws IOException {
/*
* TODO: cpovirk - Use java.nio.file.Files.createTempDirectory instead of
* TODO(cpovirk): Use java.nio.file.Files.createTempDirectory instead of
* c.g.c.io.Files.createTempDir?
*/
File fullPath = new File(Files.createTempDir(), name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <T> Facade<T> newFacade() {
abstract <T> Facade<T> newFacade();
}

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
static void awaitWaiting(Thread t) {
while (true) {
Thread.State state = t.getState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public void testCompletionFinishesWithDone() {
@J2ktIncompatible
public void testFutureBash() {
if (isWindows()) {
return; // TODO: b/136041958 - Running very slowly on Windows CI.
return; // TODO(b/136041958): Running very slowly on Windows CI.
}
CyclicBarrier barrier =
new CyclicBarrier(
Expand Down Expand Up @@ -638,7 +638,7 @@ public void testFutureBash() {
// setFuture and cancel() interact in more complicated ways than the other setters.
public void testSetFutureCancelBash() {
if (isWindows()) {
return; // TODO: b/136041958 - Running very slowly on Windows CI.
return; // TODO(b/136041958): Running very slowly on Windows CI.
}
int size = 50;
CyclicBarrier barrier =
Expand Down Expand Up @@ -1222,7 +1222,7 @@ public void run() {
}
}

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
Expand Down Expand Up @@ -1265,7 +1265,7 @@ public void run() {
}
}

@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public void run() {
}

/** Wait for the given thread to reach the {@link State#TIMED_WAITING} thread state. */
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
@SuppressWarnings("ThreadPriorityCheck") // TODO(b/175898629): Consider onSpinWait.
@J2ktIncompatible
void awaitTimedWaiting(Thread thread) {
while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public TestThread(L lockLikeObject, String threadName) {
}

/*
* TODO: b/318391980 - Once we test only under Java 20 and higher, avoid calling Thread.stop. As
* TODO(b/318391980): Once we test only under Java 20 and higher, avoid calling Thread.stop. As
* of Java 20, it always throws an exception, and as of Java 26, the method does not even exist.
* For now, we continue using it to clean up under older JDKs.
*
Expand Down
12 changes: 6 additions & 6 deletions android/guava/src/com/google/common/base/Joiner.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public <A extends Appendable> A appendTo(A appendable, Iterator<?> parts) throws
@CanIgnoreReturnValue
public final <A extends Appendable> A appendTo(A appendable, @Nullable Object[] parts)
throws IOException {
@SuppressWarnings("nullness") // TODO: b/316358623 - Remove suppression after fixing checker
@SuppressWarnings("nullness") // TODO(b/316358623): Remove suppression after fixing checker
List<?> partsList = Arrays.<@Nullable Object>asList(parts);
return appendTo(appendable, partsList);
}
Expand Down Expand Up @@ -167,7 +167,7 @@ public final StringBuilder appendTo(StringBuilder builder, Iterator<?> parts) {
*/
@CanIgnoreReturnValue
public final StringBuilder appendTo(StringBuilder builder, @Nullable Object[] parts) {
@SuppressWarnings("nullness") // TODO: b/316358623 - Remove suppression after fixing checker
@SuppressWarnings("nullness") // TODO(b/316358623): Remove suppression after fixing checker
List<?> partsList = Arrays.<@Nullable Object>asList(parts);
return appendTo(builder, partsList);
}
Expand All @@ -192,17 +192,17 @@ public final StringBuilder appendTo(
*/
public String join(Iterable<?> parts) {
// We don't use the same optimization here as in the JRE flavor.
// TODO: b/381289911 - Evaluate the performance impact of doing so.
// TODO(b/381289911): Evaluate the performance impact of doing so.
return join(parts.iterator());
}

/*
* TODO: b/381289911 - Make the Iterator overload use StringJoiner (including Android or not)—or
* TODO(b/381289911): Make the Iterator overload use StringJoiner (including Android or not)—or
* some other optimization, given that StringJoiner can over-allocate:
* https://bugs.openjdk.org/browse/JDK-8305774
*/

// TODO: b/381289911 - Optimize MapJoiner similarly to Joiner (including Android or not).
// TODO(b/381289911): Optimize MapJoiner similarly to Joiner (including Android or not).

/**
* Returns a string containing the string representation of each of {@code parts}, using the
Expand All @@ -219,7 +219,7 @@ public final String join(Iterator<?> parts) {
* previously configured separator between each.
*/
public final String join(@Nullable Object[] parts) {
@SuppressWarnings("nullness") // TODO: b/316358623 - Remove suppression after fixing checker
@SuppressWarnings("nullness") // TODO(b/316358623): Remove suppression after fixing checker
List<?> partsList = Arrays.<@Nullable Object>asList(parts);
return join(partsList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public static void checkArgument(
*/
public static void checkArgument(
boolean expression,
// TODO: cl/604933487 - Make errorMessageTemplate consistently @Nullable across overloads.
// TODO(user): Make errorMessageTemplate consistently @Nullable across overloads.
@Nullable String errorMessageTemplate,
@Nullable Object p1,
@Nullable Object p2) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/base/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static boolean validSurrogatePairAt(CharSequence string, int index) {
* non-null values are converted to strings using {@link Object#toString()}.
* @since 25.1
*/
// TODO: b/136042644 - consider using Arrays.toString() for array parameters
// TODO(b/136042644): consider using Arrays.toString() for array parameters
public static String lenientFormat(
@Nullable String template, @Nullable Object @Nullable ... args) {
template = String.valueOf(template); // null -> "null"
Expand Down
Loading
Loading