commit | e994ad486b698e9bbbaecfd0e2db1eb458338774 | [log] [tgz] |
---|---|---|
author | David Ostrovsky <david@ostrovsky.org> | Mon Jun 20 11:52:16 2022 +0200 |
committer | David Ostrovsky <david@ostrovsky.org> | Mon Jun 20 14:19:43 2022 +0200 |
tree | 412ed5aa7a6a29a6d3f00e8b5c62f61220806c92 | |
parent | 2c7ef6be0914cfc94d2ea1e67671da74b9a63255 [diff] |
RateLimiterProcessing: Adapt to older gson version Gerrit 3.5 is using older gson version 2.8.5, without this commit: [1]. Adapt the code correspondingly. Note, that this change should be reverted when merged up to master branch. [1] https://github.com/google/gson/commit/c5a3f21fbad3828deba1deb88168e1f76829f807 Depends-On: https://gerrit-review.googlesource.com/c/zuul/jobs/+/339536 Change-Id: I5ae5a88fc4f48296424001732938b4ccf42e9975
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimiterProcessing.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimiterProcessing.java index 8f23613..8e11de9 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimiterProcessing.java +++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimiterProcessing.java
@@ -67,7 +67,7 @@ .sorted(Map.Entry.comparingByValue()) .map(this::getJsonObjectString) .forEach(permitList::add); - return gson.toJson(JsonParser.parseString(permitList.toString())); + return gson.toJson(new JsonParser().parse(permitList.toString())); } private String getJsonObjectString(Map.Entry<String, RateLimiter> entry) {