Skip to content

Commit

Permalink
Prepare for release 31.0.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 398792880
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Sep 24, 2021
1 parent fe3b762 commit 7396bab
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 87 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Guava's Maven group ID is `com.google.guava`, and its artifact ID is `guava`.
Guava provides two different "flavors": one for use on a (Java 8+) JRE and one
for use on Android or Java 7 or by any library that wants to be compatible with
either of those. These flavors are specified in the Maven version field as
either `30.1.1-jre` or `30.1.1-android`. For more about depending on Guava, see
either `31.0-jre` or `31.0-android`. For more about depending on Guava, see
[using Guava in your build].

To add a dependency on Guava using Maven, use the following:
Expand All @@ -32,9 +32,9 @@ To add a dependency on Guava using Maven, use the following:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<version>31.0-jre</version>
<!-- or, for Android: -->
<version>30.1.1-android</version>
<version>31.0-android</version>
</dependency>
```

Expand All @@ -45,16 +45,16 @@ dependencies {
// Pick one:
// 1. Use Guava in your implementation only:
implementation("com.google.guava:guava:30.1.1-jre")
implementation("com.google.guava:guava:31.0-jre")
// 2. Use Guava types in your public API:
api("com.google.guava:guava:30.1.1-jre")
api("com.google.guava:guava:31.0-jre")
// 3. Android - Use Guava in your implementation only:
implementation("com.google.guava:guava:30.1.1-android")
implementation("com.google.guava:guava:31.0-android")
// 4. Android - Use Guava types in your public API:
api("com.google.guava:guava:30.1.1-android")
api("com.google.guava:guava:31.0-android")
}
```

Expand Down
23 changes: 12 additions & 11 deletions android/guava/src/com/google/common/collect/ImmutableBiMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public static <K, V> ImmutableBiMap<K, V> of(
/**
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @throws IllegalArgumentException if duplicate keys or values are added
* @since 31.0
*/
public static <K, V> ImmutableBiMap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) {
Expand All @@ -129,8 +129,8 @@ public static <K, V> ImmutableBiMap<K, V> of(
/**
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @throws IllegalArgumentException if duplicate keys or values are added
* @since 31.0
*/
public static <K, V> ImmutableBiMap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) {
Expand All @@ -147,8 +147,8 @@ public static <K, V> ImmutableBiMap<K, V> of(
/**
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @throws IllegalArgumentException if duplicate keys or values are added
* @since 31.0
*/
public static <K, V> ImmutableBiMap<K, V> of(
K k1,
Expand Down Expand Up @@ -181,8 +181,8 @@ public static <K, V> ImmutableBiMap<K, V> of(
/**
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @throws IllegalArgumentException if duplicate keys or values are added
* @since 31.0
*/
public static <K, V> ImmutableBiMap<K, V> of(
K k1,
Expand Down Expand Up @@ -218,8 +218,8 @@ public static <K, V> ImmutableBiMap<K, V> of(
/**
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @throws IllegalArgumentException if duplicate keys or values are added
* @since 31.0
*/
public static <K, V> ImmutableBiMap<K, V> of(
K k1,
Expand Down Expand Up @@ -265,7 +265,7 @@ public static <K, V> ImmutableBiMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys or values are provided
* @since NEXT
* @since 31.0
*/
@SafeVarargs
public static <K, V> ImmutableBiMap<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
Expand Down Expand Up @@ -441,6 +441,7 @@ public ImmutableBiMap<K, V> build() {
* entries are sorted by value.
*
* @throws IllegalArgumentException if duplicate keys or values were added
* @since 31.0
*/
@Override
public ImmutableBiMap<K, V> buildOrThrow() {
Expand Down
13 changes: 7 additions & 6 deletions android/guava/src/com/google/common/collect/ImmutableMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
public static <K, V> ImmutableMap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) {
Expand All @@ -154,7 +154,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
public static <K, V> ImmutableMap<K, V> of(
K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) {
Expand All @@ -172,7 +172,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
public static <K, V> ImmutableMap<K, V> of(
K k1,
Expand Down Expand Up @@ -206,7 +206,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
public static <K, V> ImmutableMap<K, V> of(
K k1,
Expand Down Expand Up @@ -243,7 +243,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
public static <K, V> ImmutableMap<K, V> of(
K k1,
Expand Down Expand Up @@ -289,7 +289,7 @@ public static <K, V> ImmutableMap<K, V> of(
* Returns an immutable map containing the given entries, in order.
*
* @throws IllegalArgumentException if duplicate keys are provided
* @since NEXT
* @since 31.0
*/
@SafeVarargs
public static <K, V> ImmutableMap<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
Expand Down Expand Up @@ -525,6 +525,7 @@ public ImmutableMap<K, V> build() {
* sorted by value.
*
* @throws IllegalArgumentException if duplicate keys were added
* @since 31.0
*/
@SuppressWarnings("unchecked")
public ImmutableMap<K, V> buildOrThrow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
* their keys.
*
* @throws IllegalArgumentException if any two keys are equal according to their natural ordering
* @since NEXT
* @since 31.0
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
Expand All @@ -174,7 +174,7 @@ public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
* their keys.
*
* @throws IllegalArgumentException if any two keys are equal according to their natural ordering
* @since NEXT
* @since 31.0
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
Expand All @@ -194,7 +194,7 @@ public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
* their keys.
*
* @throws IllegalArgumentException if any two keys are equal according to their natural ordering
* @since NEXT
* @since 31.0
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
Expand Down Expand Up @@ -230,7 +230,7 @@ public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
* their keys.
*
* @throws IllegalArgumentException if any two keys are equal according to their natural ordering
* @since NEXT
* @since 31.0
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
Expand Down Expand Up @@ -269,7 +269,7 @@ public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
* their keys.
*
* @throws IllegalArgumentException if any two keys are equal according to their natural ordering
* @since NEXT
* @since 31.0
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
Expand Down Expand Up @@ -704,6 +704,7 @@ public ImmutableSortedMap<K, V> build() {
*
* @throws IllegalArgumentException if any two keys are equal according to the comparator (which
* might be the keys' natural order)
* @since 31.0
*/
@Override
public ImmutableSortedMap<K, V> buildOrThrow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public ImmutableTable<R, C, V> build() {
* added.
*
* @throws IllegalArgumentException if duplicate key pairs were added
* @since 31.0
*/
public ImmutableTable<R, C, V> buildOrThrow() {
int size = cells.size();
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/hash/Hashing.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static HashFunction murmur3_32() {
* <p>This method is called {@code murmur3_32_fixed} because it fixes a bug in the {@code
* HashFunction} returned by the original {@code murmur3_32} method.
*
* @since NEXT
* @since 31.0
*/
public static HashFunction murmur3_32_fixed(int seed) {
return new Murmur3_32HashFunction(seed, /* supplementaryPlaneFix= */ true);
Expand All @@ -153,7 +153,7 @@ public static HashFunction murmur3_32_fixed(int seed) {
* <p>This method is called {@code murmur3_32_fixed} because it fixes a bug in the {@code
* HashFunction} returned by the original {@code murmur3_32} method.
*
* @since NEXT
* @since 31.0
*/
public static HashFunction murmur3_32_fixed() {
return Murmur3_32HashFunction.MURMUR3_32_FIXED;
Expand Down
Loading

0 comments on commit 7396bab

Please sign in to comment.