@@ -30,7 +30,7 @@ final class Decoder {
3030
3131 // XXX - This is only for unit testings. We should possibly make a
3232 // constructor to set this
33- boolean POINTER_TEST_HACK = false ;
33+ boolean pointerTestHack = false ;
3434
3535 private final NodeCache cache ;
3636
@@ -105,7 +105,7 @@ private <T> DecodedValue decode(Class<T> cls, java.lang.reflect.Type genericType
105105 long pointer = packed + this .pointerBase + POINTER_VALUE_OFFSETS [pointerSize ];
106106
107107 // for unit testing
108- if (this .POINTER_TEST_HACK ) {
108+ if (this .pointerTestHack ) {
109109 return new DecodedValue (pointer );
110110 }
111111
@@ -163,9 +163,8 @@ private <T> Object decodeByType(
163163 case ARRAY :
164164 Class <?> elementClass = Object .class ;
165165 if (genericType instanceof ParameterizedType ) {
166- ParameterizedType pType = (ParameterizedType ) genericType ;
167- java .lang .reflect .Type [] actualTypes
168- = pType .getActualTypeArguments ();
166+ ParameterizedType ptype = (ParameterizedType ) genericType ;
167+ java .lang .reflect .Type [] actualTypes = ptype .getActualTypeArguments ();
169168 if (actualTypes .length == 1 ) {
170169 elementClass = (Class <?>) actualTypes [0 ];
171170 }
@@ -302,9 +301,9 @@ private <T, V> List<V> decodeArray(
302301 @ SuppressWarnings ("unchecked" )
303302 List <V > array2 = (List <V >) constructor .newInstance (parameters );
304303 array = array2 ;
305- } catch (InstantiationException |
306- IllegalAccessException |
307- InvocationTargetException e ) {
304+ } catch (InstantiationException
305+ | IllegalAccessException
306+ | InvocationTargetException e ) {
308307 throw new DeserializationException ("Error creating list: " + e .getMessage (), e );
309308 }
310309 }
@@ -325,9 +324,8 @@ private <T> Object decodeMap(
325324 if (Map .class .isAssignableFrom (cls ) || cls .equals (Object .class )) {
326325 Class <?> valueClass = Object .class ;
327326 if (genericType instanceof ParameterizedType ) {
328- ParameterizedType pType = (ParameterizedType ) genericType ;
329- java .lang .reflect .Type [] actualTypes
330- = pType .getActualTypeArguments ();
327+ ParameterizedType ptype = (ParameterizedType ) genericType ;
328+ java .lang .reflect .Type [] actualTypes = ptype .getActualTypeArguments ();
331329 if (actualTypes .length == 2 ) {
332330 Class <?> keyClass = (Class <?>) actualTypes [0 ];
333331 if (!keyClass .equals (String .class )) {
@@ -364,9 +362,9 @@ private <T, V> Map<String, V> decodeMapIntoMap(
364362 @ SuppressWarnings ("unchecked" )
365363 Map <String , V > map2 = (Map <String , V >) constructor .newInstance (parameters );
366364 map = map2 ;
367- } catch (InstantiationException |
368- IllegalAccessException |
369- InvocationTargetException e ) {
365+ } catch (InstantiationException
366+ | IllegalAccessException
367+ | InvocationTargetException e ) {
370368 throw new DeserializationException ("Error creating map: " + e .getMessage (), e );
371369 }
372370 }
@@ -388,7 +386,7 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
388386 java .lang .reflect .Type [] parameterGenericTypes ;
389387 Map <String , Integer > parameterIndexes ;
390388 if (cachedConstructor == null ) {
391- constructor = this . findConstructor (cls );
389+ constructor = findConstructor (cls );
392390
393391 parameterTypes = constructor .getParameterTypes ();
394392
@@ -397,7 +395,7 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
397395 parameterIndexes = new HashMap <>();
398396 Annotation [][] annotations = constructor .getParameterAnnotations ();
399397 for (int i = 0 ; i < constructor .getParameterCount (); i ++) {
400- String parameterName = this . getParameterName (cls , i , annotations [i ]);
398+ String parameterName = getParameterName (cls , i , annotations [i ]);
401399 parameterIndexes .put (parameterName , i );
402400 }
403401
@@ -436,9 +434,9 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
436434
437435 try {
438436 return constructor .newInstance (parameters );
439- } catch (InstantiationException |
440- IllegalAccessException |
441- InvocationTargetException e ) {
437+ } catch (InstantiationException
438+ | IllegalAccessException
439+ | InvocationTargetException e ) {
442440 throw new DeserializationException ("Error creating object: " + e .getMessage (), e );
443441 } catch (IllegalArgumentException e ) {
444442 StringBuilder sbErrors = new StringBuilder ();
0 commit comments