Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2018-05-02 10:29:39 +0000
committerWim Jongman2018-05-02 14:23:13 +0000
commit4cc458e26f2358e0cd2287277f570b93210ab9fa (patch)
treef5583fbe5a03ec49e2bff4c1ebb56225259173d7
parent49e67cbb69a6deeaa7d97cb5f81dc39467ac5621 (diff)
downloadeclipse.platform.ua-4cc458e26f2358e0cd2287277f570b93210ab9fa.tar.gz
eclipse.platform.ua-4cc458e26f2358e0cd2287277f570b93210ab9fa.tar.xz
eclipse.platform.ua-4cc458e26f2358e0cd2287277f570b93210ab9fa.zip
Bug 534252: [Tips] Api break in Google gson cause compile failureI20180502-2000
I am using JsonObject.keySet() In one Eclipse I have com.google.gson 2.8.2 which has this method. In another Eclipse I have com.google.gson 2.7.0 which does not have this method. It looks like an API violation on googles part which would break Tips using any (2.0.0 2.8.2] installation of the gson library. Change-Id: Iea24acac2f6b1446154456d0d157416b4267b404 Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
-rw-r--r--org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java b/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java
index a998a4dfb..af7ae80ee 100644
--- a/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java
+++ b/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java
@@ -4,6 +4,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.util.Map.Entry;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -90,10 +91,10 @@ public class Util {
private static String doReplace(JsonObject object, String input) {
String result = input;
- for (String key : object.keySet()) {
- JsonElement jsonElement = object.get(key);
+ for (Entry<String, JsonElement> entry : object.entrySet()) {
+ JsonElement jsonElement = entry.getValue();
if (jsonElement.isJsonPrimitive()) {
- String search = "${" + key + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ String search = "${" + entry.getKey() + "}"; //$NON-NLS-1$ //$NON-NLS-2$
String replace = jsonElement.getAsString();
int index = result.indexOf(search);
while (index > -1) {

Back to the top