From 99ab5502226de80c5a5bee8e541ad5cfce7fdda1 Mon Sep 17 00:00:00 2001 From: cryptearth <57261571+cryptearth@users.noreply.github.com> Date: Sun, 23 Feb 2020 04:00:12 +0100 Subject: [PATCH] fix: reuse reference instead of calling getter twice fix for #982 changed switch parameter in parseValue from calling getCurrentToken() again to just declared and assigned local member "token" two lines above --- .../src/main/java/com/google/api/client/json/JsonParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java b/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java index 7ac07ff56..477640650 100644 --- a/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java +++ b/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java @@ -717,7 +717,7 @@ private final Object parseValue( // value type is now null, class, parameterized type, or generic array type JsonToken token = getCurrentToken(); try { - switch (getCurrentToken()) { + switch (token) { case START_ARRAY: case END_ARRAY: boolean isArray = Types.isArray(valueType);