| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceChange.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceChange.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceChange.java
|
| index cc021607f9d684996164dd746653478cd88a6956..639edd5dfb3344b3c82c14bd42be9f498176138c 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceChange.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceChange.java
|
| @@ -87,8 +87,8 @@ public class SourceChange {
|
|
|
| public static SourceChange fromJson(JsonObject jsonObject) {
|
| String message = jsonObject.get("message").getAsString();
|
| - List<SourceFileEdit> edits = SourceFileEdit.fromJsonArray(jsonObject.get("edits").getAsJsonArray());
|
| - List<LinkedEditGroup> linkedEditGroups = LinkedEditGroup.fromJsonArray(jsonObject.get("linkedEditGroups").getAsJsonArray());
|
| + List<SourceFileEdit> edits = jsonObject.get("edits") == null ? null : SourceFileEdit.fromJsonArray(jsonObject.get("edits").getAsJsonArray());
|
| + List<LinkedEditGroup> linkedEditGroups = jsonObject.get("linkedEditGroups") == null ? null : LinkedEditGroup.fromJsonArray(jsonObject.get("linkedEditGroups").getAsJsonArray());
|
| Position selection = jsonObject.get("selection") == null ? null : Position.fromJson(jsonObject.get("selection").getAsJsonObject());
|
| return new SourceChange(message, edits, linkedEditGroups, selection);
|
| }
|
| @@ -136,16 +136,20 @@ public class SourceChange {
|
| public JsonObject toJson() {
|
| JsonObject jsonObject = new JsonObject();
|
| jsonObject.addProperty("message", message);
|
| - JsonArray jsonArrayEdits = new JsonArray();
|
| - for(SourceFileEdit elt : edits) {
|
| - jsonArrayEdits.add(elt.toJson());
|
| + if (edits != null) {
|
| + JsonArray jsonArrayEdits = new JsonArray();
|
| + for(SourceFileEdit elt : edits) {
|
| + jsonArrayEdits.add(elt.toJson());
|
| + }
|
| + jsonObject.add("edits", jsonArrayEdits);
|
| }
|
| - jsonObject.add("edits", jsonArrayEdits);
|
| - JsonArray jsonArrayLinkedEditGroups = new JsonArray();
|
| - for(LinkedEditGroup elt : linkedEditGroups) {
|
| - jsonArrayLinkedEditGroups.add(elt.toJson());
|
| + if (linkedEditGroups != null) {
|
| + JsonArray jsonArrayLinkedEditGroups = new JsonArray();
|
| + for(LinkedEditGroup elt : linkedEditGroups) {
|
| + jsonArrayLinkedEditGroups.add(elt.toJson());
|
| + }
|
| + jsonObject.add("linkedEditGroups", jsonArrayLinkedEditGroups);
|
| }
|
| - jsonObject.add("linkedEditGroups", jsonArrayLinkedEditGroups);
|
| if (selection != null) {
|
| jsonObject.add("selection", selection.toJson());
|
| }
|
|
|