@@ -172,7 +172,7 @@ private NewSessionPayload(Reader source, boolean forceMobileJSONWP) throws IOExc
172172 if (getOss () != null ) {
173173 dialects .add (Dialect .OSS );
174174 }
175- if (getAlwaysMatch () != null || getFirstMatches () != null ) {
175+ if (getAlwaysMatch () != null || getFirstMatch () != null ) {
176176 dialects .add (Dialect .W3C );
177177 }
178178
@@ -185,7 +185,7 @@ private void validate() throws IOException {
185185 alwaysMatch = of ();
186186 }
187187 Map <String , Object > always = alwaysMatch ;
188- Collection <Map <String , Object >> firsts = getFirstMatches ();
188+ Collection <Map <String , Object >> firsts = getFirstMatch ();
189189 if (firsts == null ) {
190190 firsts = ImmutableList .of (of ());
191191 }
@@ -400,25 +400,25 @@ public Object getValue() {
400400 public Object setValue (Object value ) {
401401 return stringObjectEntry .setValue (value );
402402 }})
403- .collect (ImmutableMap . toImmutableMap (Map .Entry ::getKey , Map .Entry ::getValue )))
403+ .collect (toImmutableMap (Map .Entry ::getKey , Map .Entry ::getValue )))
404404 .map (map -> (Map <String , Object >) map );
405405 } else {
406406 fromOss = Stream .of ();
407407 }
408408
409409 Stream <Map <String , Object >> fromW3c ;
410410 Map <String , Object > alwaysMatch = getAlwaysMatch ();
411- Collection <Map <String , Object >> firsts = getFirstMatches ();
411+ Collection <Map <String , Object >> firsts = getFirstMatch ();
412412
413413 if (alwaysMatch == null && firsts == null ) {
414414 fromW3c = Stream .of (); // No W3C capabilities.
415415 } else {
416416 if (alwaysMatch == null ) {
417- alwaysMatch = ImmutableMap . of ();
417+ alwaysMatch = of ();
418418 }
419419 Map <String , Object > always = alwaysMatch ; // Keep the comoiler happy.
420420 if (firsts == null ) {
421- firsts = ImmutableList .of (ImmutableMap . of ());
421+ firsts = ImmutableList .of (of ());
422422 }
423423
424424 fromW3c = firsts .stream ()
@@ -457,9 +457,8 @@ public Object setValue(Object value) {
457457 name = input .nextName ();
458458 if (ALWAYS_MATCH .equals (name )) {
459459 return input .read (MAP_TYPE );
460- } else {
461- input .skipValue ();
462460 }
461+ input .skipValue ();
463462 }
464463 input .endObject ();
465464 } else {
@@ -470,7 +469,7 @@ public Object setValue(Object value) {
470469 return null ;
471470 }
472471
473- private @ Nullable Collection <Map <String , Object >> getFirstMatches () throws IOException {
472+ private @ Nullable Collection <Map <String , Object >> getFirstMatch () throws IOException {
474473 CharSource charSource = backingStore .asByteSource ().asCharSource (UTF_8 );
475474 try (Reader reader = charSource .openBufferedStream ();
476475 JsonInput input = json .newInput (reader )) {
@@ -483,9 +482,8 @@ public Object setValue(Object value) {
483482 name = input .nextName ();
484483 if (FIRST_MATCH .equals (name )) {
485484 return input .read (LIST_OF_MAPS_TYPE );
486- } else {
487- input .skipValue ();
488485 }
486+ input .skipValue ();
489487 }
490488 input .endObject ();
491489 } else {
0 commit comments