From 45724fa9056cf8d969d926e18d453673c07c102e Mon Sep 17 00:00:00 2001 From: hoisie Date: Fri, 12 Nov 2021 13:39:51 -0800 Subject: [PATCH] Remove inaccessible Google issue tracker links Remove some obsolete ones and replace some with GitHub issues. PiperOrigin-RevId: 409490755 --- .../org/robolectric/res/android/Asset.java | 8 +++---- .../org/robolectric/res/android/Chunk.java | 1 - .../org/robolectric/res/android/FileMap.java | 2 +- .../android/internal/LocalUiController.java | 6 ++--- .../shadows/ShadowBugreportManagerTest.java | 23 ++++++++----------- .../shadows/ShadowLegacyMessageQueueTest.java | 2 +- .../internal/bytecode/SandboxClassLoader.java | 2 +- .../shadows/ShadowLegacyMessageQueue.java | 3 ++- .../org/robolectric/shadows/ShadowParcel.java | 2 +- .../shadows/ShadowSQLiteOpenHelper.java | 2 +- .../shadows/ShadowTelephonyManager.java | 2 +- 11 files changed, 25 insertions(+), 28 deletions(-) diff --git a/resources/src/main/java/org/robolectric/res/android/Asset.java b/resources/src/main/java/org/robolectric/res/android/Asset.java index 06fd5b83b77..bc88e3f5021 100644 --- a/resources/src/main/java/org/robolectric/res/android/Asset.java +++ b/resources/src/main/java/org/robolectric/res/android/Asset.java @@ -656,7 +656,7 @@ public boolean isNinePatch() { // : mStart(0), mLength(0), mOffset(0), mFp(null), mFileName(null), mMap(null), mBuf(null) { // Register the Asset with the global list here after it is fully constructed and its - // vtable pointer points to this concrete type. b/31113965 + // vtable pointer points to this concrete type. registerAsset(this); } @@ -668,7 +668,7 @@ protected void finalize() { close(); // Unregister the Asset from the global list here before it is destructed and while its vtable - // pointer still points to this concrete type. b/31113965 + // pointer still points to this concrete type. unregisterAsset(this); } @@ -1136,7 +1136,7 @@ public boolean isNinePatch() { mFd = -1; // Register the Asset with the global list here after it is fully constructed and its - // vtable pointer points to this concrete type. b/31113965 + // vtable pointer points to this concrete type. registerAsset(this); } @@ -1167,7 +1167,7 @@ protected void finalize() { close(); // Unregister the Asset from the global list here before it is destructed and while its vtable - // pointer still points to this concrete type. b/31113965 + // pointer still points to this concrete type. unregisterAsset(this); } diff --git a/resources/src/main/java/org/robolectric/res/android/Chunk.java b/resources/src/main/java/org/robolectric/res/android/Chunk.java index 823312ceaad..9318af9e74b 100644 --- a/resources/src/main/java/org/robolectric/res/android/Chunk.java +++ b/resources/src/main/java/org/robolectric/res/android/Chunk.java @@ -166,7 +166,6 @@ Chunk Next() { return new Chunk(this_chunk); } - // TODO(b/111401637) remove this and have full resource file verification // Returns false if there was an error. For legacy purposes. boolean VerifyNextChunkNonFatal() { if (len_ < ResChunk_header.SIZEOF) { diff --git a/resources/src/main/java/org/robolectric/res/android/FileMap.java b/resources/src/main/java/org/robolectric/res/android/FileMap.java index 09fb4e4132a..fa4fecfd523 100644 --- a/resources/src/main/java/org/robolectric/res/android/FileMap.java +++ b/resources/src/main/java/org/robolectric/res/android/FileMap.java @@ -239,7 +239,7 @@ static ImmutableMap guessDataOffsets(File zipFile, int length) { while (true) { // Instead of trusting numRecords, read until we find the // end-of-central-directory signature. numRecords may wrap - // around with >64K entries (b/5455504). + // around with >64K entries. int sig = readInt(buffer, offset); if (sig == ENDSIG || sig == ENDSIG64) { break; diff --git a/robolectric/src/main/java/org/robolectric/android/internal/LocalUiController.java b/robolectric/src/main/java/org/robolectric/android/internal/LocalUiController.java index 6a12b793048..02d570a3b9a 100644 --- a/robolectric/src/main/java/org/robolectric/android/internal/LocalUiController.java +++ b/robolectric/src/main/java/org/robolectric/android/internal/LocalUiController.java @@ -57,7 +57,8 @@ public boolean injectKeyEvent(KeyEvent event) throws InjectEventSecurityExceptio return true; } - // TODO(b/80130000): implementation copied from espresso's UIControllerImpl. Refactor code into common location + // TODO: implementation copied from espresso's UIControllerImpl. Refactor code into common + // location @Override public boolean injectString(String str) throws InjectEventSecurityException { checkNotNull(str); @@ -72,8 +73,7 @@ public boolean injectString(String str) throws InjectEventSecurityException { boolean eventInjected = false; KeyCharacterMap keyCharacterMap = getKeyCharacterMap(); - // TODO(b/80130875): Investigate why not use (as suggested in javadoc of - // keyCharacterMap.getEvents): + // TODO: Investigate why not use (as suggested in javadoc of keyCharacterMap.getEvents): // http://developer.android.com/reference/android/view/KeyEvent.html#KeyEvent(long, // java.lang.String, int, int) KeyEvent[] events = keyCharacterMap.getEvents(str.toCharArray()); diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowBugreportManagerTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowBugreportManagerTest.java index 20931cc2be6..e8235b5f7ed 100644 --- a/robolectric/src/test/java/org/robolectric/shadows/ShadowBugreportManagerTest.java +++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowBugreportManagerTest.java @@ -4,7 +4,6 @@ import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static org.junit.Assert.assertThrows; -import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; @@ -69,18 +68,16 @@ public void startBugreport_noPermission() throws Exception { BugreportCallback callback = mock(BugreportCallback.class); shadowBugreportManager.setHasPermission(false); - // TODO(b/179958637) switch to assertThrows once ThrowingRunnable no longer causes a test - // instantiation failure. - try { - shadowBugreportManager.startBugreport( - createWriteFile("bugreport"), - createWriteFile("screenshot"), - new BugreportParams(BugreportParams.BUGREPORT_MODE_FULL), - directExecutor(), - callback); - fail("Expected SecurityException"); - } catch (SecurityException expected) { - } + assertThrows( + SecurityException.class, + () -> { + shadowBugreportManager.startBugreport( + createWriteFile("bugreport"), + createWriteFile("screenshot"), + new BugreportParams(BugreportParams.BUGREPORT_MODE_FULL), + directExecutor(), + callback); + }); shadowMainLooper().idle(); assertThat(shadowBugreportManager.isBugreportInProgress()).isFalse(); diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowLegacyMessageQueueTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowLegacyMessageQueueTest.java index 399827597da..89892fa863f 100644 --- a/robolectric/src/test/java/org/robolectric/shadows/ShadowLegacyMessageQueueTest.java +++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowLegacyMessageQueueTest.java @@ -204,7 +204,7 @@ public void postAndRemoveSyncBarrierToken() { } @Test - // TODO(b/74402484): enable once workaround is removed + // TODO(https://github.com/robolectric/robolectric/issues/6852): enable once workaround is removed @Ignore public void removeInvalidSyncBarrierToken() { try { diff --git a/sandbox/src/main/java/org/robolectric/internal/bytecode/SandboxClassLoader.java b/sandbox/src/main/java/org/robolectric/internal/bytecode/SandboxClassLoader.java index fa0f96c0b1e..c71a735c6db 100644 --- a/sandbox/src/main/java/org/robolectric/internal/bytecode/SandboxClassLoader.java +++ b/sandbox/src/main/java/org/robolectric/internal/bytecode/SandboxClassLoader.java @@ -82,7 +82,7 @@ private static URL[] getClassPathUrls(ClassLoader classloader) { return parseJavaClassPath(); } - // TODO(b/65488446): Use a public API once one is available. + // TODO(https://github.com/google/guava/issues/2956): Use a public API once one is available. private static URL[] parseJavaClassPath() { ImmutableList.Builder urls = ImmutableList.builder(); for (String entry : Splitter.on(PATH_SEPARATOR.value()).split(JAVA_CLASS_PATH.value())) { diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowLegacyMessageQueue.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowLegacyMessageQueue.java index f60f1b4c9e2..9934fb4ef9b 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowLegacyMessageQueue.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowLegacyMessageQueue.java @@ -166,7 +166,8 @@ private static void dispatchMessage(Message msg) { @Implementation @HiddenApi protected void removeSyncBarrier(int token) { - // TODO(b/74402484): workaround scheduler corruption of message queue + // TODO(https://github.com/robolectric/robolectric/issues/6852): workaround scheduler corruption + // of message queue try { reflector(MessageQueueReflector.class, realQueue).removeSyncBarrier(token); } catch (IllegalStateException e) { diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java index c0e3e930403..5b11bb9d8a3 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java @@ -89,7 +89,7 @@ public Parcelable.Creator readParcelableCreator(ClassLoader loader) { // classloader" behavior. ClassLoader parcelableClassLoader = (loader == null ? getClass().getClassLoader() : loader); // Avoid initializing the Parcelable class until we know it implements - // Parcelable and has the necessary CREATOR field. http://b/1171613. + // Parcelable and has the necessary CREATOR field. Class parcelableClass = Class.forName(name, false /* initialize */, parcelableClassLoader); if (!Parcelable.class.isAssignableFrom(parcelableClass)) { throw new BadParcelableException( diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteOpenHelper.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteOpenHelper.java index 8621359d112..a3208e034ae 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteOpenHelper.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteOpenHelper.java @@ -15,6 +15,6 @@ public class ShadowSQLiteOpenHelper { @Implementation(minSdk = O_MR1) protected void setIdleConnectionTimeout(long idleConnectionTimeoutMs) { // Calling the real one currently results in a Robolectric deadlock. Just ignore it. - // See b/78464547 . + // See https://github.com/robolectric/robolectric/issues/6853. } } diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowTelephonyManager.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowTelephonyManager.java index e628ecb25fe..d1b965256b0 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowTelephonyManager.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowTelephonyManager.java @@ -918,7 +918,7 @@ public void setSignalStrength(SignalStrength signalStrength) { /** * Cribbed from {@link android.telephony.PhoneNumberUtils#isEmergencyNumberInternal}. * - *

TODO(b/122324733) need better implementation + *

TODO: need better implementation */ @Implementation(minSdk = Build.VERSION_CODES.Q) protected boolean isEmergencyNumber(String number) {