Skip to content

Commit

Permalink
Remove @Beta from various math-related APIs.
Browse files Browse the repository at this point in the history
RELNOTES=`math`: Remove `@Beta` from various `math`-related APIs.
PiperOrigin-RevId: 531534926
  • Loading branch information
kluever authored and Google Java Core Libraries committed May 12, 2023
1 parent fcec25f commit 912815e
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 62 deletions.
3 changes: 0 additions & 3 deletions android/guava/src/com/google/common/math/BigIntegerMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand Down
8 changes: 0 additions & 8 deletions android/guava/src/com/google/common/math/IntMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,7 +34,6 @@
* @author Pete Gillin
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
8 changes: 0 additions & 8 deletions android/guava/src/com/google/common/math/LongMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/math/PairedStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,7 +37,6 @@
* @author Pete Gillin
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +30,6 @@
* @author Pete Gillin
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/math/Quantiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -127,7 +126,6 @@
* @author Pete Gillin
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/math/Stats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -59,7 +58,6 @@
* @author Kevin Bourrillion
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +32,6 @@
* @author Kevin Bourrillion
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
3 changes: 0 additions & 3 deletions guava/src/com/google/common/math/BigIntegerMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand Down
8 changes: 0 additions & 8 deletions guava/src/com/google/common/math/IntMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions guava/src/com/google/common/math/LinearTransformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,7 +34,6 @@
* @author Pete Gillin
* @since 20.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Expand Down
Loading

0 comments on commit 912815e

Please sign in to comment.