Skip to content

Commit 1566940

Browse files
klueverGoogle Java Core Libraries
authored andcommitted
Remove @Beta from Hashing (plus some other minor cleanups).
RELNOTES=n/a PiperOrigin-RevId: 420062518
1 parent 828d9ee commit 1566940

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

android/guava/src/com/google/common/hash/Hashing.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import static com.google.common.base.Preconditions.checkArgument;
1818
import static com.google.common.base.Preconditions.checkNotNull;
1919

20-
import com.google.common.annotations.Beta;
2120
import com.google.errorprone.annotations.Immutable;
2221
import java.security.Key;
2322
import java.util.ArrayList;
2423
import java.util.Arrays;
24+
import java.util.Collections;
2525
import java.util.Iterator;
2626
import java.util.List;
2727
import java.util.zip.Adler32;
@@ -42,7 +42,6 @@
4242
* @author Kurt Alfred Kluever
4343
* @since 11.0
4444
*/
45-
@Beta
4645
@ElementTypesAreNonnullByDefault
4746
public final class Hashing {
4847
/**
@@ -645,7 +644,7 @@ public static HashFunction concatenating(
645644
List<HashFunction> list = new ArrayList<>();
646645
list.add(first);
647646
list.add(second);
648-
list.addAll(Arrays.asList(rest));
647+
Collections.addAll(list, rest);
649648
return new ConcatenatedHashFunction(list.toArray(new HashFunction[0]));
650649
}
651650

@@ -666,7 +665,7 @@ public static HashFunction concatenating(Iterable<HashFunction> hashFunctions) {
666665
for (HashFunction hashFunction : hashFunctions) {
667666
list.add(hashFunction);
668667
}
669-
checkArgument(list.size() > 0, "number of hash functions (%s) must be > 0", list.size());
668+
checkArgument(!list.isEmpty(), "number of hash functions (%s) must be > 0", list.size());
670669
return new ConcatenatedHashFunction(list.toArray(new HashFunction[0]));
671670
}
672671

guava/src/com/google/common/hash/Hashing.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import static com.google.common.base.Preconditions.checkArgument;
1818
import static com.google.common.base.Preconditions.checkNotNull;
1919

20-
import com.google.common.annotations.Beta;
2120
import com.google.errorprone.annotations.Immutable;
2221
import java.security.Key;
2322
import java.util.ArrayList;
2423
import java.util.Arrays;
24+
import java.util.Collections;
2525
import java.util.Iterator;
2626
import java.util.List;
2727
import java.util.zip.Adler32;
@@ -42,7 +42,6 @@
4242
* @author Kurt Alfred Kluever
4343
* @since 11.0
4444
*/
45-
@Beta
4645
@ElementTypesAreNonnullByDefault
4746
public final class Hashing {
4847
/**
@@ -645,7 +644,7 @@ public static HashFunction concatenating(
645644
List<HashFunction> list = new ArrayList<>();
646645
list.add(first);
647646
list.add(second);
648-
list.addAll(Arrays.asList(rest));
647+
Collections.addAll(list, rest);
649648
return new ConcatenatedHashFunction(list.toArray(new HashFunction[0]));
650649
}
651650

@@ -666,7 +665,7 @@ public static HashFunction concatenating(Iterable<HashFunction> hashFunctions) {
666665
for (HashFunction hashFunction : hashFunctions) {
667666
list.add(hashFunction);
668667
}
669-
checkArgument(list.size() > 0, "number of hash functions (%s) must be > 0", list.size());
668+
checkArgument(!list.isEmpty(), "number of hash functions (%s) must be > 0", list.size());
670669
return new ConcatenatedHashFunction(list.toArray(new HashFunction[0]));
671670
}
672671

0 commit comments

Comments
 (0)