Skip to content

Commit

Permalink
Make some $Gson$Types members package-private again to prevent synthe…
Browse files Browse the repository at this point in the history
…tic accessors
  • Loading branch information
Marcono1234 committed Feb 6, 2022
1 parent 4436078 commit 446bf92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gson/src/main/java/com/google/gson/internal/$Gson$Types.java
Expand Up @@ -42,7 +42,7 @@
* @author Jesse Wilson
*/
public final class $Gson$Types {
private static final Type[] EMPTY_TYPE_ARRAY = new Type[] {};
static final Type[] EMPTY_TYPE_ARRAY = new Type[] {};

private $Gson$Types() {
throw new UnsupportedOperationException();
Expand Down Expand Up @@ -228,10 +228,6 @@ public static boolean equals(Type a, Type b) {
}
}

private static int hashCodeOrZero(Object o) {
return o != null ? o.hashCode() : 0;
}

public static String typeToString(Type type) {
return type instanceof Class ? ((Class<?>) type).getName() : type.toString();
}
Expand Down Expand Up @@ -480,7 +476,7 @@ private static Class<?> declaringClassOf(TypeVariable<?> typeVariable) {
: null;
}

private static void checkNotPrimitive(Type type) {
static void checkNotPrimitive(Type type) {
checkArgument(!(type instanceof Class<?>) || !((Class<?>) type).isPrimitive());
}

Expand Down Expand Up @@ -525,6 +521,10 @@ public Type getOwnerType() {
&& $Gson$Types.equals(this, (ParameterizedType) other);
}

private static int hashCodeOrZero(Object o) {
return o != null ? o.hashCode() : 0;
}

@Override public int hashCode() {
return Arrays.hashCode(typeArguments)
^ rawType.hashCode()
Expand Down

0 comments on commit 446bf92

Please sign in to comment.