@Test public void objectEarlyEnd() throws IOException { thrown.expect(MalformedJsonException.class); JsonParser.parse("{foo:}"); }
@SuppressWarnings("unchecked") public static Object parse(String raw) throws IOException { JsonReader jr = new JsonReader(new StringReader(raw)); try { return parseRecursive(jr); } finally { try { jr.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close", e); } } }
JsonParser { @SuppressWarnings("unchecked") public static Object parse(String raw) throws IOException { JsonReader jr = new JsonReader(new StringReader(raw)); try { return parseRecursive(jr); } finally { try { jr.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close", e); } } } }
JsonParser { @SuppressWarnings("unchecked") public static Object parse(String raw) throws IOException { JsonReader jr = new JsonReader(new StringReader(raw)); try { return parseRecursive(jr); } finally { try { jr.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close", e); } } } private  JsonParser(); }
JsonParser { @SuppressWarnings("unchecked") public static Object parse(String raw) throws IOException { JsonReader jr = new JsonReader(new StringReader(raw)); try { return parseRecursive(jr); } finally { try { jr.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close", e); } } } private  JsonParser(); @SuppressWarnings("unchecked") static Object parse(String raw); }
JsonParser { @SuppressWarnings("unchecked") public static Object parse(String raw) throws IOException { JsonReader jr = new JsonReader(new StringReader(raw)); try { return parseRecursive(jr); } finally { try { jr.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close", e); } } } private  JsonParser(); @SuppressWarnings("unchecked") static Object parse(String raw);  }