Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java

Issue 596893002: Rework launch data (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated Java side Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java
index 3833f46aff60c4d40be221f72562a8aa08720bd0..bd3f74f17c4ea3eb83142ad0af29192c64de6e32 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/NotificationExecutionLaunchDataProcessor.java
@@ -14,17 +14,10 @@
package com.google.dart.server.internal.remote.processor;
import com.google.dart.server.AnalysisServerListener;
-import com.google.dart.server.generated.types.ExecutableFile;
-import com.google.dart.server.utilities.general.JsonUtilities;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
/**
* Instances of the class {@code NotificationExecutionLaunchDataProcessor} process
* "execution.launchData" notifications.
@@ -44,29 +37,11 @@ public class NotificationExecutionLaunchDataProcessor extends NotificationProces
@Override
public void process(JsonObject response) throws Exception {
JsonObject paramsObject = response.get("params").getAsJsonObject();
- JsonArray executables = paramsObject.get("executables").getAsJsonArray();
- JsonObject dartToHtml = paramsObject.get("dartToHtml").getAsJsonObject();
- JsonObject htmlToDart = paramsObject.get("htmlToDart").getAsJsonObject();
- getListener().computedLaunchData(
- ExecutableFile.fromJsonArray(executables),
- toMap(dartToHtml),
- toMap(htmlToDart));
- }
-
- /**
- * Convert the given JSON object to a map of strings to lists of strings.
- *
- * @param object the object to be converted
- * @return the result of converting the given JSON object to a map of strings to lists of strings
- */
- private Map<String, List<String>> toMap(JsonObject object) {
- Map<String, List<String>> map = new HashMap<String, List<String>>();
- for (Entry<String, JsonElement> entry : object.entrySet()) {
- JsonElement value = entry.getValue();
- if (value instanceof JsonArray) {
- map.put(entry.getKey(), JsonUtilities.decodeStringList((JsonArray) value));
- }
- }
- return map;
+ String file = paramsObject.get("file").getAsString();
+ JsonElement jsonKind = paramsObject.get("kind");
+ String kind = jsonKind == null ? null : jsonKind.getAsString();
+ JsonElement jsonFiles = paramsObject.get("referencedFiles");
+ JsonArray referencedFiles = jsonFiles == null ? null : jsonFiles.getAsJsonArray();
+ getListener().computedLaunchData(file, kind, constructStringArray(referencedFiles));
}
}

Powered by Google App Engine
This is Rietveld 408576698