Skip to content

Commit

Permalink
Remove unused parameters from JsonpWriter (#8979)
Browse files Browse the repository at this point in the history
  • Loading branch information
Captain1653 authored Jul 29, 2024
1 parent da4e729 commit 4df94f1
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,29 +57,29 @@ public void write(GenericType<T> type,
Optional<String> charset = acceptedType.charset();
if (charset.isPresent()) {
Charset characterSet = Charset.forName(charset.get());
write(type, object, new OutputStreamWriter(outputStream, characterSet));
write(object, new OutputStreamWriter(outputStream, characterSet));
} else {
write(type, object, outputStream);
write(object, outputStream);
}
return;
}
}

write(type, object, outputStream);
write(object, outputStream);
}

@Override
public void write(GenericType<T> type, T object, OutputStream outputStream, WritableHeaders<?> headers) {
headers.setIfAbsent(HeaderValues.CONTENT_TYPE_JSON);
write(type, object, outputStream);
write(object, outputStream);
}

private void write(GenericType<T> type, T object, Writer out) {
private void write(T object, Writer out) {
JsonWriter writer = writerFactory.createWriter(out);
writer.write(object);
}

private void write(GenericType<T> type, T object, OutputStream out) {
private void write(T object, OutputStream out) {
try (out) {
writerFactory.createWriter(out).write(object);
} catch (IOException e) {
Expand Down

0 comments on commit 4df94f1

Please sign in to comment.