Source:
public synchronized String requestToken(String refreshToken) throws ETSdkException { if (clientId == null || clientSecret == null) { return null; } logger.debug("requesting access token..."); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("clientId", clientId); jsonObject.addProperty("clientSecret", clientSecret); jsonObject.addProperty("accessType", "offline"); if (configuration.isFalse("useRefreshToken")) { }else if(refreshToken != null) { jsonObject.addProperty("refreshToken", refreshToken); } String requestPayload = gson.toJson(jsonObject); ETRestConnection.Response response = null; if (configuration.isTrue("requestLegacyToken")) { response = authConnection.post(PATH_REQUESTTOKEN_LEGACY, requestPayload); } else { response = authConnection.post(PATH_REQUESTTOKEN, requestPayload); } if (response.getResponseCode() != HttpURLConnection.HTTP_OK) { throw new ETSdkException("error obtaining access token " + "(" + response.getResponseCode() + " " + response.getResponseMessage() + ")"); } String responsePayload = response.getResponsePayload(); JsonParser jsonParser = new JsonParser(); jsonObject = jsonParser.parse(responsePayload).getAsJsonObject(); logger.debug("received token:"); this.accessToken = jsonObject.get("accessToken").getAsString(); logger.debug(" accessToken: " + this.accessToken); this.expiresIn = jsonObject.get("expiresIn").getAsInt(); logger.debug(" expiresIn: " + this.expiresIn); JsonElement jsonElement = jsonObject.get("legacyToken"); if (jsonElement != null) { this.legacyToken = jsonElement.getAsString(); } logger.debug(" legacyToken: " + this.legacyToken); this.refreshToken = jsonObject.get("refreshToken").getAsString(); logger.debug(" refreshToken: " + this.refreshToken); tokenExpirationTime = System.currentTimeMillis() + (expiresIn * 1000); logger.debug("access token expires at " + new Date(tokenExpirationTime)); return accessToken; }

Target:
public synchronized String requestToken(String refreshToken) throws ETSdkException { if (clientId == null || clientSecret == null) { return null; } logger.debug("requesting access token..."); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("clientId", clientId); jsonObject.addProperty("clientSecret", clientSecret); jsonObject.addProperty("accessType", "offline"); if (refreshToken != null && !configuration.isFalse("useRefreshToken")) { jsonObject.addProperty("refreshToken", refreshToken); } String requestPayload = gson.toJson(jsonObject); ETRestConnection.Response response = null; if (configuration.isTrue("requestLegacyToken")) { response = authConnection.post(PATH_REQUESTTOKEN_LEGACY, requestPayload); } else { response = authConnection.post(PATH_REQUESTTOKEN, requestPayload); } if (response.getResponseCode() != HttpURLConnection.HTTP_OK) { throw new ETSdkException("error obtaining access token " + "(" + response.getResponseCode() + " " + response.getResponseMessage() + ")"); } String responsePayload = response.getResponsePayload(); JsonParser jsonParser = new JsonParser(); jsonObject = jsonParser.parse(responsePayload).getAsJsonObject(); logger.debug("received token:"); this.accessToken = jsonObject.get("accessToken").getAsString(); logger.debug(" accessToken: " + this.accessToken); this.expiresIn = jsonObject.get("expiresIn").getAsInt(); logger.debug(" expiresIn: " + this.expiresIn); JsonElement jsonElement = jsonObject.get("legacyToken"); if (jsonElement != null) { this.legacyToken = jsonElement.getAsString(); } logger.debug(" legacyToken: " + this.legacyToken); this.refreshToken = jsonObject.get("refreshToken").getAsString(); logger.debug(" refreshToken: " + this.refreshToken); tokenExpirationTime = System.currentTimeMillis() + (expiresIn * 1000); logger.debug("access token expires at " + new Date(tokenExpirationTime)); return accessToken; }