revapi/src/main/java/org/revapi/configuration/JSONUtil.java
/**
     * @param json the JSON-encoded data
     * @return a String with comments stripped from the provided json data.
     */
@param json the JSON-encoded data
@return a String with comments stripped from the provided json data.
@param json the JSON - encoded data @return a String with comments stripped from the provided json data .
public static String stripComments(String json) {
        try {
            try (Reader rdr = stripComments(new StringReader(json))) {
                StringBuilder bld = new StringBuilder();
                char[] buf = new char[1024];
                int cnt;
                while ((cnt = rdr.read(buf)) != -1) {
                    bld.append(buf, 0, cnt);
                }
                return bld.toString();
            }
        } catch (IOException e) {
            throw new AssertionError("IOException in StringReader? I thought that was impossible!", e);
        }
    }
public static String stripComments ( String json ) { try { try ( Reader rdr = stripComments ( new StringReader ( json ) ) ) { StringBuilder bld = new StringBuilder ( ) ; char [ ] buf = new char [ 1024 ] ; int cnt ; while ( ( cnt = rdr . read ( buf ) ) != - 1 ) { bld . append ( buf , 0 , cnt ) ; } return bld . toString ( ) ; } } catch ( IOException e ) { throw new AssertionError ( "IOException in StringReader? I thought that was impossible!" , e ) ; } }
@param json the JSON-encoded data
 @return a String with comments stripped from the provided json data.
@param json the JSON - encoded data @return a String with comments stripped from the provided json data .
//doesn't happen with strings