Skip to content

Commit ec93865

Browse files
committed
try codeQl versioning
1 parent 8c5410a commit ec93865

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

src/main/java/com/microsoft/graph/content/BatchRequestContent.java

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ private void writeBatchRequestStepAsync(BatchRequestStep requestStep, JsonWriter
211211
writer.name(CoreConstants.BatchRequest.BODY);
212212
if(contentType.toLowerCase(Locale.US).contains(CoreConstants.MimeTypeNames.APPLICATION_JSON)){
213213
JsonObject bodyObject = getJsonRequestContent(requestBody).join();
214-
//writer.jsonValue(bodyObject.toString());
215-
writeJsonElement(writer, bodyObject);
214+
writer.jsonValue(bodyObject.toString());
216215
} else {
217216
String rawBodyContent = getRawRequestContent(requestBody).join();
218217
writer.value(rawBodyContent);
@@ -257,35 +256,6 @@ private CompletableFuture<String> getRawRequestContent(RequestBody requestBody)
257256
return exception;
258257
}
259258
}
260-
261-
262-
//Used to solve indentation issue when there are several nested jsonElements.
263-
private void writeJsonElement(JsonWriter writer, JsonElement element) throws IOException {
264-
if(element.isJsonPrimitive()) {
265-
JsonPrimitive primitive = element.getAsJsonPrimitive();
266-
if(primitive.isString()) {
267-
writer.value(primitive.getAsString());
268-
} else if(primitive.isBoolean()) {
269-
writer.value(primitive.getAsBoolean());
270-
} else if(primitive.isNumber()) {
271-
writer.value(primitive.getAsNumber());
272-
}
273-
} else if(element.isJsonArray()) {
274-
writer.beginArray();
275-
for(JsonElement arrayElement : element.getAsJsonArray()) {
276-
writeJsonElement(writer, arrayElement);
277-
}
278-
writer.endArray();
279-
} else if(element.isJsonObject()) {
280-
writer.beginObject();
281-
for(Map.Entry<String, JsonElement> entry : element.getAsJsonObject().entrySet()) {
282-
writer.name(entry.getKey());
283-
writeJsonElement(writer, entry.getValue());
284-
}
285-
writer.endObject();
286-
}
287-
}
288-
289259
private boolean containsCorrespondingRequestId(List<String> dependsOn) {
290260
return dependsOn.stream().allMatch(id -> this.batchRequestSteps.containsKey(id));
291261
}

0 commit comments

Comments
 (0)