@@ -30,7 +30,7 @@ final class Decoder {
30
30
31
31
// XXX - This is only for unit testings. We should possibly make a
32
32
// constructor to set this
33
- boolean POINTER_TEST_HACK = false ;
33
+ boolean pointerTestHack = false ;
34
34
35
35
private final NodeCache cache ;
36
36
@@ -105,7 +105,7 @@ private <T> DecodedValue decode(Class<T> cls, java.lang.reflect.Type genericType
105
105
long pointer = packed + this .pointerBase + POINTER_VALUE_OFFSETS [pointerSize ];
106
106
107
107
// for unit testing
108
- if (this .POINTER_TEST_HACK ) {
108
+ if (this .pointerTestHack ) {
109
109
return new DecodedValue (pointer );
110
110
}
111
111
@@ -163,9 +163,8 @@ private <T> Object decodeByType(
163
163
case ARRAY :
164
164
Class <?> elementClass = Object .class ;
165
165
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 ();
169
168
if (actualTypes .length == 1 ) {
170
169
elementClass = (Class <?>) actualTypes [0 ];
171
170
}
@@ -302,9 +301,9 @@ private <T, V> List<V> decodeArray(
302
301
@ SuppressWarnings ("unchecked" )
303
302
List <V > array2 = (List <V >) constructor .newInstance (parameters );
304
303
array = array2 ;
305
- } catch (InstantiationException |
306
- IllegalAccessException |
307
- InvocationTargetException e ) {
304
+ } catch (InstantiationException
305
+ | IllegalAccessException
306
+ | InvocationTargetException e ) {
308
307
throw new DeserializationException ("Error creating list: " + e .getMessage (), e );
309
308
}
310
309
}
@@ -325,9 +324,8 @@ private <T> Object decodeMap(
325
324
if (Map .class .isAssignableFrom (cls ) || cls .equals (Object .class )) {
326
325
Class <?> valueClass = Object .class ;
327
326
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 ();
331
329
if (actualTypes .length == 2 ) {
332
330
Class <?> keyClass = (Class <?>) actualTypes [0 ];
333
331
if (!keyClass .equals (String .class )) {
@@ -364,9 +362,9 @@ private <T, V> Map<String, V> decodeMapIntoMap(
364
362
@ SuppressWarnings ("unchecked" )
365
363
Map <String , V > map2 = (Map <String , V >) constructor .newInstance (parameters );
366
364
map = map2 ;
367
- } catch (InstantiationException |
368
- IllegalAccessException |
369
- InvocationTargetException e ) {
365
+ } catch (InstantiationException
366
+ | IllegalAccessException
367
+ | InvocationTargetException e ) {
370
368
throw new DeserializationException ("Error creating map: " + e .getMessage (), e );
371
369
}
372
370
}
@@ -388,7 +386,7 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
388
386
java .lang .reflect .Type [] parameterGenericTypes ;
389
387
Map <String , Integer > parameterIndexes ;
390
388
if (cachedConstructor == null ) {
391
- constructor = this . findConstructor (cls );
389
+ constructor = findConstructor (cls );
392
390
393
391
parameterTypes = constructor .getParameterTypes ();
394
392
@@ -397,7 +395,7 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
397
395
parameterIndexes = new HashMap <>();
398
396
Annotation [][] annotations = constructor .getParameterAnnotations ();
399
397
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 ]);
401
399
parameterIndexes .put (parameterName , i );
402
400
}
403
401
@@ -436,9 +434,9 @@ private <T> Object decodeMapIntoObject(int size, Class<T> cls)
436
434
437
435
try {
438
436
return constructor .newInstance (parameters );
439
- } catch (InstantiationException |
440
- IllegalAccessException |
441
- InvocationTargetException e ) {
437
+ } catch (InstantiationException
438
+ | IllegalAccessException
439
+ | InvocationTargetException e ) {
442
440
throw new DeserializationException ("Error creating object: " + e .getMessage (), e );
443
441
} catch (IllegalArgumentException e ) {
444
442
StringBuilder sbErrors = new StringBuilder ();
0 commit comments