jackson-coreutils
jackson-coreutils copied to clipboard
Remove IOException from JsonLoader.fromString()
Here's the relevant code:
/**
* Read a {@link JsonNode} from a string input
*
* @param json the JSON as a string
* @return the document
* @throws IOException could not read from string
*/
public static JsonNode fromString(final String json)
throws IOException
{
return fromReader(new StringReader(json));
}
I can't think of any reason why a String
operation would throw an IO Exception and the JavaDoc doesn't clarify it either.
If I jump back to the JsonNodeReader.fromReeader
there's a hint that an IO Exception could be thrown for malformed input. Perhaps a custom exception would be better suited?