| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
|
| index a2a3699cd88c0b0520657a731e005b7b7c84ab44..d7141c38fd9462fe67d3fa8a1d908d6e127d9f4b 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/SourceEdit.java
|
| @@ -20,6 +20,9 @@ import java.util.Arrays;
|
| import java.util.List;
|
| import java.util.Map;
|
| import com.google.dart.server.utilities.general.ObjectUtilities;
|
| +import com.google.gson.JsonArray;
|
| +import com.google.gson.JsonObject;
|
| +import com.google.gson.JsonPrimitive;
|
| import org.apache.commons.lang3.StringUtils;
|
|
|
| /**
|
| @@ -38,12 +41,12 @@ public class SourceEdit {
|
| /**
|
| * The offset of the region to be modified.
|
| */
|
| - private final int offset;
|
| + private final Integer offset;
|
|
|
| /**
|
| * The length of the region to be modified.
|
| */
|
| - private final int length;
|
| + private final Integer length;
|
|
|
| /**
|
| * The code that is to replace the specified region in the original code.
|
| @@ -64,7 +67,7 @@ public class SourceEdit {
|
| /**
|
| * Constructor for {@link SourceEdit}.
|
| */
|
| - public SourceEdit(int offset, int length, String replacement, String id) {
|
| + public SourceEdit(Integer offset, Integer length, String replacement, String id) {
|
| this.offset = offset;
|
| this.length = length;
|
| this.replacement = replacement;
|
| @@ -100,14 +103,14 @@ public class SourceEdit {
|
| /**
|
| * The length of the region to be modified.
|
| */
|
| - public int getLength() {
|
| + public Integer getLength() {
|
| return length;
|
| }
|
|
|
| /**
|
| * The offset of the region to be modified.
|
| */
|
| - public int getOffset() {
|
| + public Integer getOffset() {
|
| return offset;
|
| }
|
|
|
| @@ -118,6 +121,28 @@ public class SourceEdit {
|
| return replacement;
|
| }
|
|
|
| + public JsonObject toJson() {
|
| + // Create a JsonObject
|
| + JsonObject jsonObject = new JsonObject();
|
| +
|
| + // offset
|
| + jsonObject.addProperty("offset", offset);
|
| +
|
| + // length
|
| + jsonObject.addProperty("length", length);
|
| +
|
| + // replacement
|
| + jsonObject.addProperty("replacement", replacement);
|
| +
|
| + // id
|
| + if (id != null) {
|
| + jsonObject.addProperty("id", id);
|
| + }
|
| +
|
| + // Return the JsonObject
|
| + return jsonObject;
|
| + }
|
| +
|
| @Override
|
| public String toString() {
|
| StringBuilder builder = new StringBuilder();
|
|
|