protected ParseException err(String msg) { // We can't tell if EOF was hit by comparing start<=end // because the illegal char could have been the last in the buffer // or in the stream. To deal with this, the "eof" var was introduced if (!eof && start>0) start--; // backup one char String chs = "char=" + ((start>=end) ? "(EOF)" : "" + buf[start]); String pos = "position=" + (gpos+start); String tot = chs + ',' + pos + getContext(); if (msg==null) { if (start>=end) msg = "Unexpected EOF"; else msg="JSON Parse Error"; } return new ParseException(msg + ": " + tot); }
protected ParseException err(String msg) { // We can't tell if EOF was hit by comparing start<=end // because the illegal char could have been the last in the buffer // or in the stream. To deal with this, the "eof" var was introduced if (!eof && start>0) start--; // backup one char String chs = "char=" + ((start>=end) ? "(EOF)" : "" + buf[start]); String pos = "position=" + (gpos+start); String tot = chs + ',' + pos + getContext(); if (msg==null) { if (start>=end) msg = "Unexpected EOF"; else msg="JSON Parse Error"; } return new ParseException(msg + ": " + tot); }