Resolve itest runbundles for Gson and Commons Lang upgrades and fix JsonParser deprecations (#10345)
* Resolve itest runbundles for Gson and Commons Lang upgrades * Fix JsonParser deprecations too * Fix feature verification Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -41,12 +41,10 @@ import com.google.gson.JsonSyntaxException;
|
||||
public final class RequestLogger {
|
||||
private final Logger logger = LoggerFactory.getLogger(RequestLogger.class);
|
||||
private final AtomicLong nextId = new AtomicLong();
|
||||
private final JsonParser parser;
|
||||
private final Gson gson;
|
||||
private final String prefix;
|
||||
|
||||
public RequestLogger(final String prefix, final Gson gson) {
|
||||
this.parser = new JsonParser();
|
||||
this.gson = gson;
|
||||
this.prefix = prefix;
|
||||
}
|
||||
@@ -124,7 +122,7 @@ public final class RequestLogger {
|
||||
|
||||
private String reformatJson(final String jsonString) {
|
||||
try {
|
||||
final JsonElement json = parser.parse(jsonString);
|
||||
final JsonElement json = JsonParser.parseString(jsonString);
|
||||
return gson.toJson(json);
|
||||
} catch (final JsonSyntaxException e) {
|
||||
logger.debug("Could not reformat malformed JSON due to '{}'", e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user