Skip to content

Commit

Permalink
Fix @VisibleForTesting violations.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 637960009
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed May 28, 2024
1 parent c4b883d commit 142ddbc
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ void init(int expectedSize) {
}

/** Returns whether arrays need to be allocated. */
@VisibleForTesting
boolean needsAllocArrays() {
return table == null;
}
Expand Down Expand Up @@ -291,7 +290,6 @@ Map<K, V> createHashFloodingResistantDelegate(int tableSize) {
return new LinkedHashMap<>(tableSize, 1.0f);
}

@VisibleForTesting
@CanIgnoreReturnValue
Map<K, V> convertToHashFloodingResistantImplementation() {
Map<K, V> newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ void init(int expectedSize) {
}

/** Returns whether arrays need to be allocated. */
@VisibleForTesting
boolean needsAllocArrays() {
return table == null;
}
Expand Down Expand Up @@ -256,7 +255,6 @@ private Set<E> createHashFloodingResistantDelegate(int tableSize) {
return new LinkedHashSet<>(tableSize, 1.0f);
}

@VisibleForTesting
@CanIgnoreReturnValue
Set<E> convertToHashFloodingResistantImplementation() {
Set<E> newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1);
Expand Down
1 change: 0 additions & 1 deletion android/guava/src/com/google/common/collect/Ordering.java
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ public int binarySearch(
* Object[])} comparator when comparing a value outside the set of values it can compare.
* Extending {@link ClassCastException} may seem odd, but it is required.
*/
@VisibleForTesting
static class IncomparableValueException extends ClassCastException {
final Object value;

Expand Down
2 changes: 0 additions & 2 deletions guava/src/com/google/common/collect/CompactHashMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ void init(int expectedSize) {
}

/** Returns whether arrays need to be allocated. */
@VisibleForTesting
boolean needsAllocArrays() {
return table == null;
}
Expand Down Expand Up @@ -295,7 +294,6 @@ Map<K, V> createHashFloodingResistantDelegate(int tableSize) {
return new LinkedHashMap<>(tableSize, 1.0f);
}

@VisibleForTesting
@CanIgnoreReturnValue
Map<K, V> convertToHashFloodingResistantImplementation() {
Map<K, V> newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1);
Expand Down
2 changes: 0 additions & 2 deletions guava/src/com/google/common/collect/CompactHashSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void init(int expectedSize) {
}

/** Returns whether arrays need to be allocated. */
@VisibleForTesting
boolean needsAllocArrays() {
return table == null;
}
Expand Down Expand Up @@ -260,7 +259,6 @@ private Set<E> createHashFloodingResistantDelegate(int tableSize) {
return new LinkedHashSet<>(tableSize, 1.0f);
}

@VisibleForTesting
@CanIgnoreReturnValue
Set<E> convertToHashFloodingResistantImplementation() {
Set<E> newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
import com.google.errorprone.annotations.concurrent.LazyInit;
import com.google.j2objc.annotations.RetainedWith;
import com.google.j2objc.annotations.WeakOuter;
Expand All @@ -35,7 +34,6 @@
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
final class JdkBackedImmutableBiMap<K, V> extends ImmutableBiMap<K, V> {
@VisibleForTesting
static <K, V> ImmutableBiMap<K, V> create(int n, @Nullable Entry<K, V>[] entryArray) {
Map<K, V> forwardDelegate = Maps.newHashMapWithExpectedSize(n);
Map<V, K> backwardDelegate = Maps.newHashMapWithExpectedSize(n);
Expand Down
1 change: 0 additions & 1 deletion guava/src/com/google/common/collect/Ordering.java
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ public int binarySearch(
* Object[])} comparator when comparing a value outside the set of values it can compare.
* Extending {@link ClassCastException} may seem odd, but it is required.
*/
@VisibleForTesting
static class IncomparableValueException extends ClassCastException {
final Object value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final class RegularImmutableMap<K, V> extends ImmutableMap<K, V> {
* Maximum allowed length of a hash table bucket before falling back to a j.u.HashMap based
* implementation. Experimentally determined.
*/
@VisibleForTesting static final int MAX_HASH_BUCKET_LENGTH = 8;
static final int MAX_HASH_BUCKET_LENGTH = 8;

// entries in insertion order
@VisibleForTesting final transient Entry<K, V>[] entries;
Expand Down

0 comments on commit 142ddbc

Please sign in to comment.