|
23 | 23 |
|
24 | 24 | import com.google.common.base.Throwables;
|
25 | 25 | import com.google.common.collect.ImmutableList;
|
26 |
| -import com.google.gson.Gson; |
27 |
| -import com.google.gson.JsonObject; |
28 |
| -import com.google.gson.JsonPrimitive; |
29 | 26 |
|
30 | 27 | import org.openqa.selenium.WebDriverException;
|
31 | 28 | import org.openqa.selenium.remote.BeanToJsonConverter;
|
@@ -74,18 +71,18 @@ public void execute(HttpRequest req, HttpResponse resp) {
|
74 | 71 |
|
75 | 72 | // JSON Wire Protocol
|
76 | 73 | toSerialise.put("status", code);
|
77 |
| - value.put( |
78 |
| - "stackTrace", |
79 |
| - Stream.of(exception.getStackTrace()) |
80 |
| - .map(ste -> { |
81 |
| - JsonObject line = new JsonObject(); |
82 |
| - line.add("fileName", new JsonPrimitive(ste.getFileName())); |
83 |
| - line.add("lineNumber", new JsonPrimitive(ste.getLineNumber())); |
84 |
| - line.add("className", new JsonPrimitive(ste.getClassName())); |
85 |
| - line.add("methodName", new JsonPrimitive(ste.getMethodName())); |
86 |
| - return ste; |
87 |
| - }) |
88 |
| - .collect(ImmutableList.toImmutableList())); |
| 74 | + value.put( |
| 75 | + "stackTrace", |
| 76 | + Stream.of(exception.getStackTrace()) |
| 77 | + .map(ste -> { |
| 78 | + HashMap<String, Object> line = new HashMap<>(); |
| 79 | + line.put("fileName", ste.getFileName()); |
| 80 | + line.put("lineNumber", ste.getLineNumber()); |
| 81 | + line.put("className", ste.getClassName()); |
| 82 | + line.put("methodName", ste.getMethodName()); |
| 83 | + return line; |
| 84 | + }) |
| 85 | + .collect(ImmutableList.toImmutableList())); |
89 | 86 |
|
90 | 87 | toSerialise.put("value", value);
|
91 | 88 |
|
|
0 commit comments