From 912815e4e205d17a72975aad08e2f032f9af3796 Mon Sep 17 00:00:00 2001 From: Kurt Alfred Kluever Date: Fri, 12 May 2023 10:00:01 -0700 Subject: [PATCH] Remove `@Beta` from various `math`-related APIs. RELNOTES=`math`: Remove `@Beta` from various `math`-related APIs. PiperOrigin-RevId: 531534926 --- .../guava/src/com/google/common/math/BigIntegerMath.java | 3 --- android/guava/src/com/google/common/math/IntMath.java | 8 -------- .../src/com/google/common/math/LinearTransformation.java | 2 -- android/guava/src/com/google/common/math/LongMath.java | 8 -------- android/guava/src/com/google/common/math/PairedStats.java | 2 -- .../com/google/common/math/PairedStatsAccumulator.java | 2 -- android/guava/src/com/google/common/math/Quantiles.java | 2 -- android/guava/src/com/google/common/math/Stats.java | 2 -- .../src/com/google/common/math/StatsAccumulator.java | 2 -- guava/src/com/google/common/math/BigIntegerMath.java | 3 --- guava/src/com/google/common/math/IntMath.java | 8 -------- .../src/com/google/common/math/LinearTransformation.java | 2 -- guava/src/com/google/common/math/LongMath.java | 8 -------- guava/src/com/google/common/math/PairedStats.java | 2 -- .../com/google/common/math/PairedStatsAccumulator.java | 2 -- guava/src/com/google/common/math/Quantiles.java | 2 -- guava/src/com/google/common/math/Stats.java | 2 -- guava/src/com/google/common/math/StatsAccumulator.java | 2 -- 18 files changed, 62 deletions(-) diff --git a/android/guava/src/com/google/common/math/BigIntegerMath.java b/android/guava/src/com/google/common/math/BigIntegerMath.java index 3ba5685ccde5..cf943195d242 100644 --- a/android/guava/src/com/google/common/math/BigIntegerMath.java +++ b/android/guava/src/com/google/common/math/BigIntegerMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.UNNECESSARY; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -58,7 +57,6 @@ public final class BigIntegerMath { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static BigInteger ceilingPowerOfTwo(BigInteger x) { return BigInteger.ZERO.setBit(log2(x, CEILING)); } @@ -70,7 +68,6 @@ public static BigInteger ceilingPowerOfTwo(BigInteger x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static BigInteger floorPowerOfTwo(BigInteger x) { return BigInteger.ZERO.setBit(log2(x, FLOOR)); } diff --git a/android/guava/src/com/google/common/math/IntMath.java b/android/guava/src/com/google/common/math/IntMath.java index 1ceaa7e00e65..3fff5793c126 100644 --- a/android/guava/src/com/google/common/math/IntMath.java +++ b/android/guava/src/com/google/common/math/IntMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.HALF_UP; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -64,7 +63,6 @@ public final class IntMath { * int}, i.e. when {@code x > 2^30} * @since 20.0 */ - @Beta public static int ceilingPowerOfTwo(int x) { checkPositive("x", x); if (x > MAX_SIGNED_POWER_OF_TWO) { @@ -80,7 +78,6 @@ public static int ceilingPowerOfTwo(int x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static int floorPowerOfTwo(int x) { checkPositive("x", x); return Integer.highestOneBit(x); @@ -535,7 +532,6 @@ public static int checkedPow(int b, int k) { * * @since 20.0 */ - @Beta public static int saturatedAdd(int a, int b) { return Ints.saturatedCast((long) a + b); } @@ -546,7 +542,6 @@ public static int saturatedAdd(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedSubtract(int a, int b) { return Ints.saturatedCast((long) a - b); } @@ -557,7 +552,6 @@ public static int saturatedSubtract(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedMultiply(int a, int b) { return Ints.saturatedCast((long) a * b); } @@ -568,7 +562,6 @@ public static int saturatedMultiply(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedPow(int b, int k) { checkNonNegative("exponent", k); switch (b) { @@ -724,7 +717,6 @@ public static int mean(int x, int y) { */ @J2ktIncompatible @GwtIncompatible // TODO - @Beta public static boolean isPrime(int n) { return LongMath.isPrime(n); } diff --git a/android/guava/src/com/google/common/math/LinearTransformation.java b/android/guava/src/com/google/common/math/LinearTransformation.java index 1dee78e8b8f6..51d3f32a345a 100644 --- a/android/guava/src/com/google/common/math/LinearTransformation.java +++ b/android/guava/src/com/google/common/math/LinearTransformation.java @@ -18,7 +18,6 @@ import static com.google.common.math.DoubleUtils.isFinite; import static java.lang.Double.NaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.errorprone.annotations.concurrent.LazyInit; @@ -35,7 +34,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/android/guava/src/com/google/common/math/LongMath.java b/android/guava/src/com/google/common/math/LongMath.java index 620e2bd48ee6..fa8271a1eb67 100644 --- a/android/guava/src/com/google/common/math/LongMath.java +++ b/android/guava/src/com/google/common/math/LongMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.HALF_UP; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -65,7 +64,6 @@ public final class LongMath { * long}, i.e. when {@code x > 2^62} * @since 20.0 */ - @Beta public static long ceilingPowerOfTwo(long x) { checkPositive("x", x); if (x > MAX_SIGNED_POWER_OF_TWO) { @@ -81,7 +79,6 @@ public static long ceilingPowerOfTwo(long x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static long floorPowerOfTwo(long x) { checkPositive("x", x); @@ -659,7 +656,6 @@ public static long checkedPow(long b, int k) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedAdd(long a, long b) { long naiveSum = a + b; @@ -678,7 +674,6 @@ public static long saturatedAdd(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedSubtract(long a, long b) { long naiveDifference = a - b; @@ -697,7 +692,6 @@ public static long saturatedSubtract(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedMultiply(long a, long b) { // see checkedMultiply for explanation @@ -728,7 +722,6 @@ public static long saturatedMultiply(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedPow(long b, int k) { checkNonNegative("exponent", k); @@ -1017,7 +1010,6 @@ public static long mean(long x, long y) { */ @J2ktIncompatible @GwtIncompatible // TODO - @Beta public static boolean isPrime(long n) { if (n < 2) { checkNonNegative("n", n); diff --git a/android/guava/src/com/google/common/math/PairedStats.java b/android/guava/src/com/google/common/math/PairedStats.java index 82b657f451ee..c60a62b0aee3 100644 --- a/android/guava/src/com/google/common/math/PairedStats.java +++ b/android/guava/src/com/google/common/math/PairedStats.java @@ -21,7 +21,6 @@ import static java.lang.Double.doubleToLongBits; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.MoreObjects; @@ -38,7 +37,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/android/guava/src/com/google/common/math/PairedStatsAccumulator.java b/android/guava/src/com/google/common/math/PairedStatsAccumulator.java index f6aa10f3d4fe..9d365633a192 100644 --- a/android/guava/src/com/google/common/math/PairedStatsAccumulator.java +++ b/android/guava/src/com/google/common/math/PairedStatsAccumulator.java @@ -19,7 +19,6 @@ import static java.lang.Double.NaN; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.primitives.Doubles; @@ -31,7 +30,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/android/guava/src/com/google/common/math/Quantiles.java b/android/guava/src/com/google/common/math/Quantiles.java index 563ec2911752..78f310dd0ab6 100644 --- a/android/guava/src/com/google/common/math/Quantiles.java +++ b/android/guava/src/com/google/common/math/Quantiles.java @@ -21,7 +21,6 @@ import static java.util.Arrays.sort; import static java.util.Collections.unmodifiableMap; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.primitives.Doubles; @@ -127,7 +126,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/android/guava/src/com/google/common/math/Stats.java b/android/guava/src/com/google/common/math/Stats.java index a4ee99179dd6..0650a87f5bbc 100644 --- a/android/guava/src/com/google/common/math/Stats.java +++ b/android/guava/src/com/google/common/math/Stats.java @@ -24,7 +24,6 @@ import static java.lang.Double.doubleToLongBits; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.MoreObjects; @@ -59,7 +58,6 @@ * @author Kevin Bourrillion * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/android/guava/src/com/google/common/math/StatsAccumulator.java b/android/guava/src/com/google/common/math/StatsAccumulator.java index b83e203497f8..33406e7f7a30 100644 --- a/android/guava/src/com/google/common/math/StatsAccumulator.java +++ b/android/guava/src/com/google/common/math/StatsAccumulator.java @@ -20,7 +20,6 @@ import static java.lang.Double.NaN; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import java.util.Iterator; @@ -33,7 +32,6 @@ * @author Kevin Bourrillion * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/BigIntegerMath.java b/guava/src/com/google/common/math/BigIntegerMath.java index 3ba5685ccde5..cf943195d242 100644 --- a/guava/src/com/google/common/math/BigIntegerMath.java +++ b/guava/src/com/google/common/math/BigIntegerMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.UNNECESSARY; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -58,7 +57,6 @@ public final class BigIntegerMath { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static BigInteger ceilingPowerOfTwo(BigInteger x) { return BigInteger.ZERO.setBit(log2(x, CEILING)); } @@ -70,7 +68,6 @@ public static BigInteger ceilingPowerOfTwo(BigInteger x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static BigInteger floorPowerOfTwo(BigInteger x) { return BigInteger.ZERO.setBit(log2(x, FLOOR)); } diff --git a/guava/src/com/google/common/math/IntMath.java b/guava/src/com/google/common/math/IntMath.java index 1ceaa7e00e65..3fff5793c126 100644 --- a/guava/src/com/google/common/math/IntMath.java +++ b/guava/src/com/google/common/math/IntMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.HALF_UP; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -64,7 +63,6 @@ public final class IntMath { * int}, i.e. when {@code x > 2^30} * @since 20.0 */ - @Beta public static int ceilingPowerOfTwo(int x) { checkPositive("x", x); if (x > MAX_SIGNED_POWER_OF_TWO) { @@ -80,7 +78,6 @@ public static int ceilingPowerOfTwo(int x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static int floorPowerOfTwo(int x) { checkPositive("x", x); return Integer.highestOneBit(x); @@ -535,7 +532,6 @@ public static int checkedPow(int b, int k) { * * @since 20.0 */ - @Beta public static int saturatedAdd(int a, int b) { return Ints.saturatedCast((long) a + b); } @@ -546,7 +542,6 @@ public static int saturatedAdd(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedSubtract(int a, int b) { return Ints.saturatedCast((long) a - b); } @@ -557,7 +552,6 @@ public static int saturatedSubtract(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedMultiply(int a, int b) { return Ints.saturatedCast((long) a * b); } @@ -568,7 +562,6 @@ public static int saturatedMultiply(int a, int b) { * * @since 20.0 */ - @Beta public static int saturatedPow(int b, int k) { checkNonNegative("exponent", k); switch (b) { @@ -724,7 +717,6 @@ public static int mean(int x, int y) { */ @J2ktIncompatible @GwtIncompatible // TODO - @Beta public static boolean isPrime(int n) { return LongMath.isPrime(n); } diff --git a/guava/src/com/google/common/math/LinearTransformation.java b/guava/src/com/google/common/math/LinearTransformation.java index 1dee78e8b8f6..51d3f32a345a 100644 --- a/guava/src/com/google/common/math/LinearTransformation.java +++ b/guava/src/com/google/common/math/LinearTransformation.java @@ -18,7 +18,6 @@ import static com.google.common.math.DoubleUtils.isFinite; import static java.lang.Double.NaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.errorprone.annotations.concurrent.LazyInit; @@ -35,7 +34,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/LongMath.java b/guava/src/com/google/common/math/LongMath.java index 620e2bd48ee6..fa8271a1eb67 100644 --- a/guava/src/com/google/common/math/LongMath.java +++ b/guava/src/com/google/common/math/LongMath.java @@ -25,7 +25,6 @@ import static java.math.RoundingMode.HALF_EVEN; import static java.math.RoundingMode.HALF_UP; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; @@ -65,7 +64,6 @@ public final class LongMath { * long}, i.e. when {@code x > 2^62} * @since 20.0 */ - @Beta public static long ceilingPowerOfTwo(long x) { checkPositive("x", x); if (x > MAX_SIGNED_POWER_OF_TWO) { @@ -81,7 +79,6 @@ public static long ceilingPowerOfTwo(long x) { * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ - @Beta public static long floorPowerOfTwo(long x) { checkPositive("x", x); @@ -659,7 +656,6 @@ public static long checkedPow(long b, int k) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedAdd(long a, long b) { long naiveSum = a + b; @@ -678,7 +674,6 @@ public static long saturatedAdd(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedSubtract(long a, long b) { long naiveDifference = a - b; @@ -697,7 +692,6 @@ public static long saturatedSubtract(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedMultiply(long a, long b) { // see checkedMultiply for explanation @@ -728,7 +722,6 @@ public static long saturatedMultiply(long a, long b) { * * @since 20.0 */ - @Beta @SuppressWarnings("ShortCircuitBoolean") public static long saturatedPow(long b, int k) { checkNonNegative("exponent", k); @@ -1017,7 +1010,6 @@ public static long mean(long x, long y) { */ @J2ktIncompatible @GwtIncompatible // TODO - @Beta public static boolean isPrime(long n) { if (n < 2) { checkNonNegative("n", n); diff --git a/guava/src/com/google/common/math/PairedStats.java b/guava/src/com/google/common/math/PairedStats.java index 82b657f451ee..c60a62b0aee3 100644 --- a/guava/src/com/google/common/math/PairedStats.java +++ b/guava/src/com/google/common/math/PairedStats.java @@ -21,7 +21,6 @@ import static java.lang.Double.doubleToLongBits; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.MoreObjects; @@ -38,7 +37,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/PairedStatsAccumulator.java b/guava/src/com/google/common/math/PairedStatsAccumulator.java index f6aa10f3d4fe..9d365633a192 100644 --- a/guava/src/com/google/common/math/PairedStatsAccumulator.java +++ b/guava/src/com/google/common/math/PairedStatsAccumulator.java @@ -19,7 +19,6 @@ import static java.lang.Double.NaN; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.primitives.Doubles; @@ -31,7 +30,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/Quantiles.java b/guava/src/com/google/common/math/Quantiles.java index 563ec2911752..78f310dd0ab6 100644 --- a/guava/src/com/google/common/math/Quantiles.java +++ b/guava/src/com/google/common/math/Quantiles.java @@ -21,7 +21,6 @@ import static java.util.Arrays.sort; import static java.util.Collections.unmodifiableMap; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.primitives.Doubles; @@ -127,7 +126,6 @@ * @author Pete Gillin * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/Stats.java b/guava/src/com/google/common/math/Stats.java index 36e067f657b3..c1143c04f75d 100644 --- a/guava/src/com/google/common/math/Stats.java +++ b/guava/src/com/google/common/math/Stats.java @@ -24,7 +24,6 @@ import static java.lang.Double.doubleToLongBits; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.MoreObjects; @@ -63,7 +62,6 @@ * @author Kevin Bourrillion * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault diff --git a/guava/src/com/google/common/math/StatsAccumulator.java b/guava/src/com/google/common/math/StatsAccumulator.java index 2c4b83ba67aa..c7bf01cf6d38 100644 --- a/guava/src/com/google/common/math/StatsAccumulator.java +++ b/guava/src/com/google/common/math/StatsAccumulator.java @@ -20,7 +20,6 @@ import static java.lang.Double.NaN; import static java.lang.Double.isNaN; -import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import java.util.Iterator; @@ -36,7 +35,6 @@ * @author Kevin Bourrillion * @since 20.0 */ -@Beta @J2ktIncompatible @GwtIncompatible @ElementTypesAreNonnullByDefault