1616
1717package com .google .gson .reflect ;
1818
19- import com .google .gson .internal .$Gson$Types ;
19+ import com .google .gson .internal .GsonTypes ;
2020import com .google .gson .internal .TroubleshootingGuide ;
2121import java .lang .reflect .GenericArrayType ;
2222import java .lang .reflect .ParameterizedType ;
@@ -72,15 +72,15 @@ public class TypeToken<T> {
7272 @ SuppressWarnings ("unchecked" )
7373 protected TypeToken () {
7474 this .type = getTypeTokenTypeArgument ();
75- this .rawType = (Class <? super T >) $Gson$Types .getRawType (type );
75+ this .rawType = (Class <? super T >) GsonTypes .getRawType (type );
7676 this .hashCode = type .hashCode ();
7777 }
7878
7979 /** Unsafe. Constructs a type literal manually. */
8080 @ SuppressWarnings ("unchecked" )
8181 private TypeToken (Type type ) {
82- this .type = $Gson$Types .canonicalize (Objects .requireNonNull (type ));
83- this .rawType = (Class <? super T >) $Gson$Types .getRawType (this .type );
82+ this .type = GsonTypes .canonicalize (Objects .requireNonNull (type ));
83+ this .rawType = (Class <? super T >) GsonTypes .getRawType (this .type );
8484 this .hashCode = this .type .hashCode ();
8585 }
8686
@@ -90,14 +90,14 @@ private static boolean isCapturingTypeVariablesForbidden() {
9090
9191 /**
9292 * Verifies that {@code this} is an instance of a direct subclass of TypeToken and returns the
93- * type argument for {@code T} in {@link $Gson$Types #canonicalize canonical form}.
93+ * type argument for {@code T} in {@link GsonTypes #canonicalize canonical form}.
9494 */
9595 private Type getTypeTokenTypeArgument () {
9696 Type superclass = getClass ().getGenericSuperclass ();
9797 if (superclass instanceof ParameterizedType ) {
9898 ParameterizedType parameterized = (ParameterizedType ) superclass ;
9999 if (parameterized .getRawType () == TypeToken .class ) {
100- Type typeArgument = $Gson$Types .canonicalize (parameterized .getActualTypeArguments ()[0 ]);
100+ Type typeArgument = GsonTypes .canonicalize (parameterized .getActualTypeArguments ()[0 ]);
101101
102102 if (isCapturingTypeVariablesForbidden ()) {
103103 verifyNoTypeVariable (typeArgument );
@@ -193,11 +193,11 @@ public boolean isAssignableFrom(Type from) {
193193 }
194194
195195 if (type instanceof Class <?>) {
196- return rawType .isAssignableFrom ($Gson$Types .getRawType (from ));
196+ return rawType .isAssignableFrom (GsonTypes .getRawType (from ));
197197 } else if (type instanceof ParameterizedType ) {
198198 return isAssignableFrom (from , (ParameterizedType ) type , new HashMap <String , Type >());
199199 } else if (type instanceof GenericArrayType ) {
200- return rawType .isAssignableFrom ($Gson$Types .getRawType (from ))
200+ return rawType .isAssignableFrom (GsonTypes .getRawType (from ))
201201 && isAssignableFrom (from , (GenericArrayType ) type );
202202 } else {
203203 throw buildUnsupportedTypeException (
@@ -253,7 +253,7 @@ private static boolean isAssignableFrom(
253253 }
254254
255255 // First figure out the class and any type information.
256- Class <?> clazz = $Gson$Types .getRawType (from );
256+ Class <?> clazz = GsonTypes .getRawType (from );
257257 ParameterizedType ptype = null ;
258258 if (from instanceof ParameterizedType ) {
259259 ptype = (ParameterizedType ) from ;
@@ -343,12 +343,12 @@ public final int hashCode() {
343343
344344 @ Override
345345 public final boolean equals (Object o ) {
346- return o instanceof TypeToken <?> && $Gson$Types .equals (type , ((TypeToken <?>) o ).type );
346+ return o instanceof TypeToken <?> && GsonTypes .equals (type , ((TypeToken <?>) o ).type );
347347 }
348348
349349 @ Override
350350 public final String toString () {
351- return $Gson$Types .typeToString (type );
351+ return GsonTypes .typeToString (type );
352352 }
353353
354354 /** Gets type literal for the given {@code Type} instance. */
@@ -412,7 +412,7 @@ public static TypeToken<?> getParameterized(Type rawType, Type... typeArguments)
412412 }
413413
414414 // Check for this here to avoid misleading exception thrown by ParameterizedTypeImpl
415- if ($Gson$Types .requiresOwnerType (rawType )) {
415+ if (GsonTypes .requiresOwnerType (rawType )) {
416416 throw new IllegalArgumentException (
417417 "Raw type "
418418 + rawClass .getName ()
@@ -422,11 +422,11 @@ public static TypeToken<?> getParameterized(Type rawType, Type... typeArguments)
422422 for (int i = 0 ; i < expectedArgsCount ; i ++) {
423423 Type typeArgument =
424424 Objects .requireNonNull (typeArguments [i ], "Type argument must not be null" );
425- Class <?> rawTypeArgument = $Gson$Types .getRawType (typeArgument );
425+ Class <?> rawTypeArgument = GsonTypes .getRawType (typeArgument );
426426 TypeVariable <?> typeVariable = typeVariables [i ];
427427
428428 for (Type bound : typeVariable .getBounds ()) {
429- Class <?> rawBound = $Gson$Types .getRawType (bound );
429+ Class <?> rawBound = GsonTypes .getRawType (bound );
430430
431431 if (!rawBound .isAssignableFrom (rawTypeArgument )) {
432432 throw new IllegalArgumentException (
@@ -440,14 +440,13 @@ public static TypeToken<?> getParameterized(Type rawType, Type... typeArguments)
440440 }
441441 }
442442
443- return new TypeToken <>(
444- $Gson$Types .newParameterizedTypeWithOwner (null , rawClass , typeArguments ));
443+ return new TypeToken <>(GsonTypes .newParameterizedTypeWithOwner (null , rawClass , typeArguments ));
445444 }
446445
447446 /**
448447 * Gets type literal for the array type whose elements are all instances of {@code componentType}.
449448 */
450449 public static TypeToken <?> getArray (Type componentType ) {
451- return new TypeToken <>($Gson$Types .arrayOf (componentType ));
450+ return new TypeToken <>(GsonTypes .arrayOf (componentType ));
452451 }
453452}
0 commit comments