Skip to content

Commit

Permalink
Avoid exposing some types outside the scope in which those types are …
Browse files Browse the repository at this point in the history
…visible.

Java doesn't mind this, but it's not like it's accomplishing anything for us.

RELNOTES=n/a
PiperOrigin-RevId: 572427947
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Oct 11, 2023
1 parent ca01197 commit e38ed26
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 42 deletions.
28 changes: 14 additions & 14 deletions android/guava/src/com/google/common/base/CharMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ public final String toString() {
}

/** Negation of a {@link FastMatcher}. */
static class NegatedFastMatcher extends Negated {
private static class NegatedFastMatcher extends Negated {

NegatedFastMatcher(CharMatcher original) {
super(original);
Expand Down Expand Up @@ -1014,7 +1014,7 @@ void setBits(BitSet bitSet) {
/** Implementation of {@link #any()}. */
private static final class Any extends NamedFastMatcher {

static final Any INSTANCE = new Any();
static final CharMatcher INSTANCE = new Any();

private Any() {
super("CharMatcher.any()");
Expand Down Expand Up @@ -1111,7 +1111,7 @@ public CharMatcher negate() {
/** Implementation of {@link #none()}. */
private static final class None extends NamedFastMatcher {

static final None INSTANCE = new None();
static final CharMatcher INSTANCE = new None();

private None() {
super("CharMatcher.none()");
Expand Down Expand Up @@ -1227,7 +1227,7 @@ static final class Whitespace extends NamedFastMatcher {
static final int MULTIPLIER = 1682554634;
static final int SHIFT = Integer.numberOfLeadingZeros(TABLE.length() - 1);

static final Whitespace INSTANCE = new Whitespace();
static final CharMatcher INSTANCE = new Whitespace();

Whitespace() {
super("CharMatcher.whitespace()");
Expand Down Expand Up @@ -1285,7 +1285,7 @@ public String toString() {
/** Implementation of {@link #ascii()}. */
private static final class Ascii extends NamedFastMatcher {

static final Ascii INSTANCE = new Ascii();
static final CharMatcher INSTANCE = new Ascii();

Ascii() {
super("CharMatcher.ascii()");
Expand Down Expand Up @@ -1359,7 +1359,7 @@ private static char[] nines() {
return nines;
}

static final Digit INSTANCE = new Digit();
static final CharMatcher INSTANCE = new Digit();

private Digit() {
super("CharMatcher.digit()", zeroes(), nines());
Expand All @@ -1369,7 +1369,7 @@ private Digit() {
/** Implementation of {@link #javaDigit()}. */
private static final class JavaDigit extends CharMatcher {

static final JavaDigit INSTANCE = new JavaDigit();
static final CharMatcher INSTANCE = new JavaDigit();

@Override
public boolean matches(char c) {
Expand All @@ -1385,7 +1385,7 @@ public String toString() {
/** Implementation of {@link #javaLetter()}. */
private static final class JavaLetter extends CharMatcher {

static final JavaLetter INSTANCE = new JavaLetter();
static final CharMatcher INSTANCE = new JavaLetter();

@Override
public boolean matches(char c) {
Expand All @@ -1401,7 +1401,7 @@ public String toString() {
/** Implementation of {@link #javaLetterOrDigit()}. */
private static final class JavaLetterOrDigit extends CharMatcher {

static final JavaLetterOrDigit INSTANCE = new JavaLetterOrDigit();
static final CharMatcher INSTANCE = new JavaLetterOrDigit();

@Override
public boolean matches(char c) {
Expand All @@ -1417,7 +1417,7 @@ public String toString() {
/** Implementation of {@link #javaUpperCase()}. */
private static final class JavaUpperCase extends CharMatcher {

static final JavaUpperCase INSTANCE = new JavaUpperCase();
static final CharMatcher INSTANCE = new JavaUpperCase();

@Override
public boolean matches(char c) {
Expand All @@ -1433,7 +1433,7 @@ public String toString() {
/** Implementation of {@link #javaLowerCase()}. */
private static final class JavaLowerCase extends CharMatcher {

static final JavaLowerCase INSTANCE = new JavaLowerCase();
static final CharMatcher INSTANCE = new JavaLowerCase();

@Override
public boolean matches(char c) {
Expand All @@ -1449,7 +1449,7 @@ public String toString() {
/** Implementation of {@link #javaIsoControl()}. */
private static final class JavaIsoControl extends NamedFastMatcher {

static final JavaIsoControl INSTANCE = new JavaIsoControl();
static final CharMatcher INSTANCE = new JavaIsoControl();

private JavaIsoControl() {
super("CharMatcher.javaIsoControl()");
Expand All @@ -1474,7 +1474,7 @@ private static final class Invisible extends RangesMatcher {
"\u0020\u00a0\u00ad\u0605\u061c\u06dd\u070f\u0891\u08e2\u1680\u180e\u200f\u202f\u2064\u206f"
+ "\u3000\uf8ff\ufeff\ufffb";

static final Invisible INSTANCE = new Invisible();
static final CharMatcher INSTANCE = new Invisible();

private Invisible() {
super("CharMatcher.invisible()", RANGE_STARTS.toCharArray(), RANGE_ENDS.toCharArray());
Expand All @@ -1484,7 +1484,7 @@ private Invisible() {
/** Implementation of {@link #singleWidth()}. */
private static final class SingleWidth extends RangesMatcher {

static final SingleWidth INSTANCE = new SingleWidth();
static final CharMatcher INSTANCE = new SingleWidth();

private SingleWidth() {
super(
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/base/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public static <T> Converter<T, T> identity() {
* "pass-through type".
*/
private static final class IdentityConverter<T> extends Converter<T, T> implements Serializable {
static final IdentityConverter<?> INSTANCE = new IdentityConverter<>();
static final Converter<?, ?> INSTANCE = new IdentityConverter<>();

@Override
protected T doForward(T t) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/collect/Multisets.java
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multise
}

private static final class DecreasingCount implements Comparator<Entry<?>> {
static final DecreasingCount INSTANCE = new DecreasingCount();
static final Comparator<Entry<?>> INSTANCE = new DecreasingCount();

@Override
public int compare(Entry<?> entry1, Entry<?> entry2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static double[] concat(double[]... arrays) {

private static final class DoubleConverter extends Converter<String, Double>
implements Serializable {
static final DoubleConverter INSTANCE = new DoubleConverter();
static final Converter<String, Double> INSTANCE = new DoubleConverter();

@Override
protected Double doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/primitives/Floats.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public static float[] concat(float[]... arrays) {

private static final class FloatConverter extends Converter<String, Float>
implements Serializable {
static final FloatConverter INSTANCE = new FloatConverter();
static final Converter<String, Float> INSTANCE = new FloatConverter();

@Override
protected Float doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/primitives/Ints.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static int fromBytes(byte b1, byte b2, byte b3, byte b4) {

private static final class IntConverter extends Converter<String, Integer>
implements Serializable {
static final IntConverter INSTANCE = new IntConverter();
static final Converter<String, Integer> INSTANCE = new IntConverter();

@Override
protected Integer doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/primitives/Longs.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public static Long tryParse(String string, int radix) {
}

private static final class LongConverter extends Converter<String, Long> implements Serializable {
static final LongConverter INSTANCE = new LongConverter();
static final Converter<String, Long> INSTANCE = new LongConverter();

@Override
protected Long doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion android/guava/src/com/google/common/primitives/Shorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static short fromBytes(byte b1, byte b2) {

private static final class ShortConverter extends Converter<String, Short>
implements Serializable {
static final ShortConverter INSTANCE = new ShortConverter();
static final Converter<String, Short> INSTANCE = new ShortConverter();

@Override
protected Short doForward(String value) {
Expand Down
28 changes: 14 additions & 14 deletions guava/src/com/google/common/base/CharMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ public final String toString() {
}

/** Negation of a {@link FastMatcher}. */
static class NegatedFastMatcher extends Negated {
private static class NegatedFastMatcher extends Negated {

NegatedFastMatcher(CharMatcher original) {
super(original);
Expand Down Expand Up @@ -1015,7 +1015,7 @@ void setBits(BitSet bitSet) {
/** Implementation of {@link #any()}. */
private static final class Any extends NamedFastMatcher {

static final Any INSTANCE = new Any();
static final CharMatcher INSTANCE = new Any();

private Any() {
super("CharMatcher.any()");
Expand Down Expand Up @@ -1112,7 +1112,7 @@ public CharMatcher negate() {
/** Implementation of {@link #none()}. */
private static final class None extends NamedFastMatcher {

static final None INSTANCE = new None();
static final CharMatcher INSTANCE = new None();

private None() {
super("CharMatcher.none()");
Expand Down Expand Up @@ -1228,7 +1228,7 @@ static final class Whitespace extends NamedFastMatcher {
static final int MULTIPLIER = 1682554634;
static final int SHIFT = Integer.numberOfLeadingZeros(TABLE.length() - 1);

static final Whitespace INSTANCE = new Whitespace();
static final CharMatcher INSTANCE = new Whitespace();

Whitespace() {
super("CharMatcher.whitespace()");
Expand Down Expand Up @@ -1286,7 +1286,7 @@ public String toString() {
/** Implementation of {@link #ascii()}. */
private static final class Ascii extends NamedFastMatcher {

static final Ascii INSTANCE = new Ascii();
static final CharMatcher INSTANCE = new Ascii();

Ascii() {
super("CharMatcher.ascii()");
Expand Down Expand Up @@ -1360,7 +1360,7 @@ private static char[] nines() {
return nines;
}

static final Digit INSTANCE = new Digit();
static final CharMatcher INSTANCE = new Digit();

private Digit() {
super("CharMatcher.digit()", zeroes(), nines());
Expand All @@ -1370,7 +1370,7 @@ private Digit() {
/** Implementation of {@link #javaDigit()}. */
private static final class JavaDigit extends CharMatcher {

static final JavaDigit INSTANCE = new JavaDigit();
static final CharMatcher INSTANCE = new JavaDigit();

@Override
public boolean matches(char c) {
Expand All @@ -1386,7 +1386,7 @@ public String toString() {
/** Implementation of {@link #javaLetter()}. */
private static final class JavaLetter extends CharMatcher {

static final JavaLetter INSTANCE = new JavaLetter();
static final CharMatcher INSTANCE = new JavaLetter();

@Override
public boolean matches(char c) {
Expand All @@ -1402,7 +1402,7 @@ public String toString() {
/** Implementation of {@link #javaLetterOrDigit()}. */
private static final class JavaLetterOrDigit extends CharMatcher {

static final JavaLetterOrDigit INSTANCE = new JavaLetterOrDigit();
static final CharMatcher INSTANCE = new JavaLetterOrDigit();

@Override
public boolean matches(char c) {
Expand All @@ -1418,7 +1418,7 @@ public String toString() {
/** Implementation of {@link #javaUpperCase()}. */
private static final class JavaUpperCase extends CharMatcher {

static final JavaUpperCase INSTANCE = new JavaUpperCase();
static final CharMatcher INSTANCE = new JavaUpperCase();

@Override
public boolean matches(char c) {
Expand All @@ -1434,7 +1434,7 @@ public String toString() {
/** Implementation of {@link #javaLowerCase()}. */
private static final class JavaLowerCase extends CharMatcher {

static final JavaLowerCase INSTANCE = new JavaLowerCase();
static final CharMatcher INSTANCE = new JavaLowerCase();

@Override
public boolean matches(char c) {
Expand All @@ -1450,7 +1450,7 @@ public String toString() {
/** Implementation of {@link #javaIsoControl()}. */
private static final class JavaIsoControl extends NamedFastMatcher {

static final JavaIsoControl INSTANCE = new JavaIsoControl();
static final CharMatcher INSTANCE = new JavaIsoControl();

private JavaIsoControl() {
super("CharMatcher.javaIsoControl()");
Expand All @@ -1475,7 +1475,7 @@ private static final class Invisible extends RangesMatcher {
"\u0020\u00a0\u00ad\u0605\u061c\u06dd\u070f\u0891\u08e2\u1680\u180e\u200f\u202f\u2064\u206f"
+ "\u3000\uf8ff\ufeff\ufffb";

static final Invisible INSTANCE = new Invisible();
static final CharMatcher INSTANCE = new Invisible();

private Invisible() {
super("CharMatcher.invisible()", RANGE_STARTS.toCharArray(), RANGE_ENDS.toCharArray());
Expand All @@ -1485,7 +1485,7 @@ private Invisible() {
/** Implementation of {@link #singleWidth()}. */
private static final class SingleWidth extends RangesMatcher {

static final SingleWidth INSTANCE = new SingleWidth();
static final CharMatcher INSTANCE = new SingleWidth();

private SingleWidth() {
super(
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/base/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public static <T> Converter<T, T> identity() {
* "pass-through type".
*/
private static final class IdentityConverter<T> extends Converter<T, T> implements Serializable {
static final IdentityConverter<?> INSTANCE = new IdentityConverter<>();
static final Converter<?, ?> INSTANCE = new IdentityConverter<>();

@Override
protected T doForward(T t) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/collect/Multisets.java
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multise
}

private static final class DecreasingCount implements Comparator<Entry<?>> {
static final DecreasingCount INSTANCE = new DecreasingCount();
static final Comparator<Entry<?>> INSTANCE = new DecreasingCount();

@Override
public int compare(Entry<?> entry1, Entry<?> entry2) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/Doubles.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public static double[] concat(double[]... arrays) {

private static final class DoubleConverter extends Converter<String, Double>
implements Serializable {
static final DoubleConverter INSTANCE = new DoubleConverter();
static final Converter<String, Double> INSTANCE = new DoubleConverter();

@Override
protected Double doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/Floats.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public static float[] concat(float[]... arrays) {

private static final class FloatConverter extends Converter<String, Float>
implements Serializable {
static final FloatConverter INSTANCE = new FloatConverter();
static final Converter<String, Float> INSTANCE = new FloatConverter();

@Override
protected Float doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/Ints.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public static int fromBytes(byte b1, byte b2, byte b3, byte b4) {

private static final class IntConverter extends Converter<String, Integer>
implements Serializable {
static final IntConverter INSTANCE = new IntConverter();
static final Converter<String, Integer> INSTANCE = new IntConverter();

@Override
protected Integer doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/Longs.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public static Long tryParse(String string, int radix) {
}

private static final class LongConverter extends Converter<String, Long> implements Serializable {
static final LongConverter INSTANCE = new LongConverter();
static final Converter<String, Long> INSTANCE = new LongConverter();

@Override
protected Long doForward(String value) {
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/Shorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static short fromBytes(byte b1, byte b2) {

private static final class ShortConverter extends Converter<String, Short>
implements Serializable {
static final ShortConverter INSTANCE = new ShortConverter();
static final Converter<String, Short> INSTANCE = new ShortConverter();

@Override
protected Short doForward(String value) {
Expand Down

0 comments on commit e38ed26

Please sign in to comment.