| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/FixesProcessor.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/FixesProcessor.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/FixesProcessor.java
|
| index 626ab7fd82ce5412fd5481c30df401ef84efd17f..0db48b0e3a098dbc6baeeea1c362950312bcff27 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/FixesProcessor.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/remote/processor/FixesProcessor.java
|
| @@ -13,14 +13,11 @@
|
| */
|
| package com.google.dart.server.internal.remote.processor;
|
|
|
| -import com.google.dart.server.ErrorFixes;
|
| import com.google.dart.server.GetFixesConsumer;
|
| -import com.google.dart.server.internal.ErrorFixesImpl;
|
| -import com.google.gson.JsonArray;
|
| -import com.google.gson.JsonElement;
|
| +import com.google.dart.server.generated.types.ErrorFixes;
|
| import com.google.gson.JsonObject;
|
|
|
| -import java.util.Iterator;
|
| +import java.util.List;
|
|
|
| /**
|
| * Instances of {@code FixesProcessor} translate JSON result objects for a given
|
| @@ -37,27 +34,7 @@ public class FixesProcessor extends ResultProcessor {
|
| }
|
|
|
| public void process(JsonObject resultObject) {
|
| - ErrorFixes[] errorFixesArray = constructErrorFixesArray(resultObject.get("fixes").getAsJsonArray());
|
| + List<ErrorFixes> errorFixesArray = ErrorFixes.fromJsonArray(resultObject.get("fixes").getAsJsonArray());
|
| consumer.computedFixes(errorFixesArray);
|
| }
|
| -
|
| - private ErrorFixes constructErrorFixes(JsonObject jsonObject) {
|
| - return new ErrorFixesImpl(
|
| - constructAnalysisError(jsonObject.get("error").getAsJsonObject()),
|
| - constructSourceChangeArray(jsonObject.get("fixes").getAsJsonArray()));
|
| - }
|
| -
|
| - private ErrorFixes[] constructErrorFixesArray(JsonArray jsonArray) {
|
| - if (jsonArray == null) {
|
| - return ErrorFixes.EMPTY_ARRAY;
|
| - }
|
| - int i = 0;
|
| - ErrorFixes[] errorFixesArray = new ErrorFixes[jsonArray.size()];
|
| - Iterator<JsonElement> iterator = jsonArray.iterator();
|
| - while (iterator.hasNext()) {
|
| - errorFixesArray[i] = constructErrorFixes(iterator.next().getAsJsonObject());
|
| - ++i;
|
| - }
|
| - return errorFixesArray;
|
| - }
|
| }
|
|
|