Skip to content

Commit 0cd4e9f

Browse files
netdpbronshapiro
authored andcommitted
Fix nonpublic identifiers and documentation that use "whitelist" or "blacklist" to use less problematic terms.
RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199834981
1 parent c2f8967 commit 0cd4e9f

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

android/guava-tests/test/com/google/common/base/AndroidIncompatible.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* would no longer have the problematic test. But why bother when we can instead strip it with
5858
* a more precisely named annotation?
5959
* <li>While a dependency on Android ought to be easy if it's for annotations only, it will
60-
* probably require adding the dep to various whitelists, license files, and Proguard
60+
* probably require adding the dep to various ACLs, license files, and Proguard
6161
* configurations, and there's always the potential that something will go wrong. It
6262
* <i>probably</i> won't, since the deps are needed only in tests (and maybe someday in
6363
* testlib), but why bother?

android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public class AbstractFutureFallbackAtomicHelperTest extends TestCase {
5050
// execution significantly)
5151

5252
/**
53-
* This classloader blacklists sun.misc.Unsafe which will prevent us from selecting our preferred
54-
* strategy {@code UnsafeAtomicHelper}.
53+
* This classloader disallows {@link sun.misc.Unsafe}, which will prevent us from selecting our
54+
* preferred strategy {@code UnsafeAtomicHelper}.
5555
*/
5656
private static final ClassLoader NO_UNSAFE =
5757
getClassLoader(ImmutableSet.of(sun.misc.Unsafe.class.getName()));
5858

5959
/**
60-
* This classloader blacklists sun.misc.Unsafe and AtomicReferenceFieldUpdater which will prevent
61-
* us from selecting our {@code SafeAtomicHelper} strategy.
60+
* This classloader disallows {@link sun.misc.Unsafe} and {@link AtomicReferenceFieldUpdater},
61+
* which will prevent us from selecting our {@code SafeAtomicHelper} strategy.
6262
*/
6363
private static final ClassLoader NO_ATOMIC_REFERENCE_FIELD_UPDATER =
6464
getClassLoader(
@@ -86,7 +86,7 @@ public void runTest() throws Exception {
8686
checkHelperVersion(NO_UNSAFE, "SafeAtomicHelper");
8787
checkHelperVersion(NO_ATOMIC_REFERENCE_FIELD_UPDATER, "SynchronizedHelper");
8888

89-
// Run the corresponding AbstractFutureTest test method in a new classloader that blacklists
89+
// Run the corresponding AbstractFutureTest test method in a new classloader that disallows
9090
// certain core jdk classes.
9191
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
9292
Thread.currentThread().setContextClassLoader(NO_UNSAFE);
@@ -119,14 +119,14 @@ private void checkHelperVersion(ClassLoader classLoader, String expectedHelperCl
119119
assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
120120
}
121121

122-
private static ClassLoader getClassLoader(final Set<String> blacklist) {
122+
private static ClassLoader getClassLoader(final Set<String> disallowedClassNames) {
123123
final String concurrentPackage = SettableFuture.class.getPackage().getName();
124124
ClassLoader classLoader = AbstractFutureFallbackAtomicHelperTest.class.getClassLoader();
125125
// we delegate to the current classloader so both loaders agree on classes like TestCase
126126
return new URLClassLoader(ClassPathUtil.getClassPathUrls(), classLoader) {
127127
@Override
128128
public Class<?> loadClass(String name) throws ClassNotFoundException {
129-
if (blacklist.contains(name)) {
129+
if (disallowedClassNames.contains(name)) {
130130
throw new ClassNotFoundException("I'm sorry Dave, I'm afraid I can't do that.");
131131
}
132132
if (name.startsWith(concurrentPackage)) {

android/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public class AggregateFutureStateFallbackAtomicHelperTest extends TestCase {
4949

5050
/**
51-
* This classloader blacklists AtomicReferenceFieldUpdater and AtomicIntegerFieldUpdate which will
51+
* This classloader disallows AtomicReferenceFieldUpdater and AtomicIntegerFieldUpdate which will
5252
* prevent us from selecting our {@code SafeAtomicHelper} strategy.
5353
*
5454
* <p>Stashing this in a static field avoids loading it over and over again and speeds up test
@@ -81,7 +81,7 @@ public void runTest() throws Exception {
8181
checkHelperVersion(getClass().getClassLoader(), "SafeAtomicHelper");
8282
checkHelperVersion(NO_ATOMIC_FIELD_UPDATER, "SynchronizedAtomicHelper");
8383

84-
// Run the corresponding FuturesTest test method in a new classloader that blacklists
84+
// Run the corresponding FuturesTest test method in a new classloader that disallows
8585
// certain core jdk classes.
8686
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
8787
Thread.currentThread().setContextClassLoader(NO_ATOMIC_FIELD_UPDATER);
@@ -110,14 +110,14 @@ private void checkHelperVersion(ClassLoader classLoader, String expectedHelperCl
110110
assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
111111
}
112112

113-
private static ClassLoader getClassLoader(final Set<String> blacklist) {
113+
private static ClassLoader getClassLoader(final Set<String> blocklist) {
114114
final String concurrentPackage = SettableFuture.class.getPackage().getName();
115115
ClassLoader classLoader = AggregateFutureStateFallbackAtomicHelperTest.class.getClassLoader();
116116
// we delegate to the current classloader so both loaders agree on classes like TestCase
117117
return new URLClassLoader(ClassPathUtil.getClassPathUrls(), classLoader) {
118118
@Override
119119
public Class<?> loadClass(String name) throws ClassNotFoundException {
120-
if (blacklist.contains(name)) {
120+
if (blocklist.contains(name)) {
121121
throw new ClassNotFoundException("I'm sorry Dave, I'm afraid I can't do that.");
122122
}
123123
if (name.startsWith(concurrentPackage)) {

android/guava/src/com/google/common/base/Throwables.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ private static Object invokeAccessibleNonThrowingMethod(
468468
private static final Method getStackTraceDepthMethod = (jla == null) ? null : getSizeMethod();
469469

470470
/**
471-
* Returns the JavaLangAccess class that is present in all Sun JDKs. It is not whitelisted for
471+
* Returns the JavaLangAccess class that is present in all Sun JDKs. It is not allowed in
472472
* AppEngine, and not present in non-Sun JDKs.
473473
*/
474474
@GwtIncompatible // java.lang.reflect
@@ -486,7 +486,7 @@ private static Object getJLA() {
486486
throw death;
487487
} catch (Throwable t) {
488488
/*
489-
* This is not one of AppEngine's whitelisted classes, so even in Sun JDKs, this can fail with
489+
* This is not one of AppEngine's allowed classes, so even in Sun JDKs, this can fail with
490490
* a NoClassDefFoundError. Other apps might deny access to sun.misc packages.
491491
*/
492492
return null;

cycle_whitelist.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NAMESPACE com.google.common.io
88
NAMESPACE com.google.common.net
99
NAMESPACE com.google.common.testing
1010

11-
# Whitelist our dependencies for now.
11+
# Allow our dependencies for now.
1212
NAMESPACE junit.framework
1313
NAMESPACE org.junit
1414

guava-tests/test/com/google/common/base/AndroidIncompatible.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* would no longer have the problematic test. But why bother when we can instead strip it with
5858
* a more precisely named annotation?
5959
* <li>While a dependency on Android ought to be easy if it's for annotations only, it will
60-
* probably require adding the dep to various whitelists, license files, and Proguard
60+
* probably require adding the dep to various ACLs, license files, and Proguard
6161
* configurations, and there's always the potential that something will go wrong. It
6262
* <i>probably</i> won't, since the deps are needed only in tests (and maybe someday in
6363
* testlib), but why bother?

guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public class AbstractFutureFallbackAtomicHelperTest extends TestCase {
5050
// execution significantly)
5151

5252
/**
53-
* This classloader blacklists sun.misc.Unsafe which will prevent us from selecting our preferred
54-
* strategy {@code UnsafeAtomicHelper}.
53+
* This classloader disallows {@link sun.misc.Unsafe}, which will prevent us from selecting our
54+
* preferred strategy {@code UnsafeAtomicHelper}.
5555
*/
5656
private static final ClassLoader NO_UNSAFE =
5757
getClassLoader(ImmutableSet.of(sun.misc.Unsafe.class.getName()));
5858

5959
/**
60-
* This classloader blacklists sun.misc.Unsafe and AtomicReferenceFieldUpdater which will prevent
61-
* us from selecting our {@code SafeAtomicHelper} strategy.
60+
* This classloader disallows {@link sun.misc.Unsafe} and {@link AtomicReferenceFieldUpdater},
61+
* which will prevent us from selecting our {@code SafeAtomicHelper} strategy.
6262
*/
6363
private static final ClassLoader NO_ATOMIC_REFERENCE_FIELD_UPDATER =
6464
getClassLoader(
@@ -86,7 +86,7 @@ public void runTest() throws Exception {
8686
checkHelperVersion(NO_UNSAFE, "SafeAtomicHelper");
8787
checkHelperVersion(NO_ATOMIC_REFERENCE_FIELD_UPDATER, "SynchronizedHelper");
8888

89-
// Run the corresponding AbstractFutureTest test method in a new classloader that blacklists
89+
// Run the corresponding AbstractFutureTest test method in a new classloader that disallows
9090
// certain core jdk classes.
9191
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
9292
Thread.currentThread().setContextClassLoader(NO_UNSAFE);
@@ -119,14 +119,14 @@ private void checkHelperVersion(ClassLoader classLoader, String expectedHelperCl
119119
assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
120120
}
121121

122-
private static ClassLoader getClassLoader(final Set<String> blacklist) {
122+
private static ClassLoader getClassLoader(final Set<String> disallowedClassNames) {
123123
final String concurrentPackage = SettableFuture.class.getPackage().getName();
124124
ClassLoader classLoader = AbstractFutureFallbackAtomicHelperTest.class.getClassLoader();
125125
// we delegate to the current classloader so both loaders agree on classes like TestCase
126126
return new URLClassLoader(ClassPathUtil.getClassPathUrls(), classLoader) {
127127
@Override
128128
public Class<?> loadClass(String name) throws ClassNotFoundException {
129-
if (blacklist.contains(name)) {
129+
if (disallowedClassNames.contains(name)) {
130130
throw new ClassNotFoundException("I'm sorry Dave, I'm afraid I can't do that.");
131131
}
132132
if (name.startsWith(concurrentPackage)) {

guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public class AggregateFutureStateFallbackAtomicHelperTest extends TestCase {
4949

5050
/**
51-
* This classloader blacklists AtomicReferenceFieldUpdater and AtomicIntegerFieldUpdate which will
51+
* This classloader disallows AtomicReferenceFieldUpdater and AtomicIntegerFieldUpdate which will
5252
* prevent us from selecting our {@code SafeAtomicHelper} strategy.
5353
*
5454
* <p>Stashing this in a static field avoids loading it over and over again and speeds up test
@@ -81,7 +81,7 @@ public void runTest() throws Exception {
8181
checkHelperVersion(getClass().getClassLoader(), "SafeAtomicHelper");
8282
checkHelperVersion(NO_ATOMIC_FIELD_UPDATER, "SynchronizedAtomicHelper");
8383

84-
// Run the corresponding FuturesTest test method in a new classloader that blacklists
84+
// Run the corresponding FuturesTest test method in a new classloader that disallows
8585
// certain core jdk classes.
8686
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
8787
Thread.currentThread().setContextClassLoader(NO_ATOMIC_FIELD_UPDATER);
@@ -110,14 +110,14 @@ private void checkHelperVersion(ClassLoader classLoader, String expectedHelperCl
110110
assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
111111
}
112112

113-
private static ClassLoader getClassLoader(final Set<String> blacklist) {
113+
private static ClassLoader getClassLoader(final Set<String> blocklist) {
114114
final String concurrentPackage = SettableFuture.class.getPackage().getName();
115115
ClassLoader classLoader = AggregateFutureStateFallbackAtomicHelperTest.class.getClassLoader();
116116
// we delegate to the current classloader so both loaders agree on classes like TestCase
117117
return new URLClassLoader(ClassPathUtil.getClassPathUrls(), classLoader) {
118118
@Override
119119
public Class<?> loadClass(String name) throws ClassNotFoundException {
120-
if (blacklist.contains(name)) {
120+
if (blocklist.contains(name)) {
121121
throw new ClassNotFoundException("I'm sorry Dave, I'm afraid I can't do that.");
122122
}
123123
if (name.startsWith(concurrentPackage)) {

guava/src/com/google/common/base/Throwables.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ private static Object invokeAccessibleNonThrowingMethod(
467467
(jla == null) ? null : getSizeMethod();
468468

469469
/**
470-
* Returns the JavaLangAccess class that is present in all Sun JDKs. It is not whitelisted for
470+
* Returns the JavaLangAccess class that is present in all Sun JDKs. It is not allowed in
471471
* AppEngine, and not present in non-Sun JDKs.
472472
*/
473473
@GwtIncompatible // java.lang.reflect
@@ -484,7 +484,7 @@ private static Object invokeAccessibleNonThrowingMethod(
484484
throw death;
485485
} catch (Throwable t) {
486486
/*
487-
* This is not one of AppEngine's whitelisted classes, so even in Sun JDKs, this can fail with
487+
* This is not one of AppEngine's allowed classes, so even in Sun JDKs, this can fail with
488488
* a NoClassDefFoundError. Other apps might deny access to sun.misc packages.
489489
*/
490490
return null;

0 commit comments

Comments
 (0)