There is no I/O writing to a StringWriter.
This commit is contained in:
parent
2cac11b449
commit
032847976c
@ -211,9 +211,13 @@ public abstract class TypeAdapter<T> {
|
||||
* @param value the Java object to convert. May be null.
|
||||
* @since 2.2
|
||||
*/
|
||||
public final String toJson(T value) throws IOException {
|
||||
public final String toJson(T value) {
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
toJson(stringWriter, value);
|
||||
try {
|
||||
toJson(stringWriter, value);
|
||||
} catch (IOException e) {
|
||||
throw new AssertionError(e); // No I/O writing to a StringWriter.
|
||||
}
|
||||
return stringWriter.toString();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user