Skip to content

Commit

Permalink
Update suppressions for usage of sun.misc.Unsafe.
Browse files Browse the repository at this point in the history
- As best I can tell (cl/712957106, cl/714130759), the `removal` suppressions aren't accomplishing anything.

RELNOTES=n/a
PiperOrigin-RevId: 715941598
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jan 15, 2025
1 parent d6ceb21 commit 18131c0
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/cache/Striped64.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* striping on 64bit values. The class extends Number so that concrete subclasses must publicly do
* so.
*/
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
@GwtIncompatible
abstract class Striped64 extends Number {
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private interface LittleEndianBytes {
* Unsafe.theUnsafe is inaccessible, the attempt to load the nested class fails, and the outer
* class's static initializer can fall back on a non-Unsafe version.
*/
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
@VisibleForTesting
enum UnsafeByteArray implements LittleEndianBytes {
// Do *not* change the order of these constants!
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/hash/Striped64.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* so.
*/
@GwtIncompatible
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
abstract class Striped64 extends Number {
/*
* This class maintains a lazily-initialized table of atomically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static class LexicographicalComparatorHolder {

static final Comparator<byte[]> BEST_COMPARATOR = getBestComparator();

@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
@VisibleForTesting
enum UnsafeComparator implements Comparator<byte[]> {
INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ abstract boolean casListeners(
* <p>Static initialization of this class will fail if the {@link sun.misc.Unsafe} object cannot
* be accessed.
*/
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
private static final class UnsafeAtomicHelper extends AtomicHelper {
static final Unsafe UNSAFE;
static final long LISTENERS_OFFSET;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public boolean usesFastPath() {
* Unsafe.theUnsafe is inaccessible, the attempt to load the nested class fails, and the outer
* class's static initializer can fall back on a non-Unsafe version.
*/
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
@VisibleForTesting
enum UnsafeByteArray implements LittleEndianBytes {
// Do *not* change the order of these constants!
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/UnsignedBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static class LexicographicalComparatorHolder {

static final Comparator<byte[]> BEST_COMPARATOR = getBestComparator();

@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
@VisibleForTesting
enum UnsafeComparator implements Comparator<byte[]> {
INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ private static LinkageError newLinkageError(Throwable cause) {
* <p>Static initialization of this class will fail if the {@link sun.misc.Unsafe} object cannot
* be accessed.
*/
@SuppressWarnings({"SunApi", "removal"}) // b/345822163
@SuppressWarnings("SunApi") // b/345822163
private static final class UnsafeAtomicHelper extends AtomicHelper {
static final Unsafe UNSAFE;
static final long LISTENERS_OFFSET;
Expand Down

0 comments on commit 18131c0

Please sign in to comment.