@@ -31,8 +31,6 @@ public class JSONTokener {
3131 private boolean usePrevious ;
3232 /** the number of characters read in the previous line. */
3333 private long characterPreviousLine ;
34- /** number of non-whitespace characters read from the source. */
35- private long contentCharCount ;
3634
3735 // access to this object is required for strict mode checking
3836 private JSONParserConfiguration jsonParserConfiguration ;
@@ -62,7 +60,6 @@ public JSONTokener(Reader reader, JSONParserConfiguration jsonParserConfiguratio
6260 this .usePrevious = false ;
6361 this .previous = 0 ;
6462 this .index = 0 ;
65- this .contentCharCount = 0 ;
6663 this .character = 1 ;
6764 this .characterPreviousLine = 0 ;
6865 this .line = 1 ;
@@ -123,17 +120,6 @@ public void setJsonParserConfiguration(JSONParserConfiguration jsonParserConfigu
123120 this .jsonParserConfiguration = jsonParserConfiguration ;
124121 }
125122
126- /**
127- * Returns whether the tokener is positioned at the beginning,
128- * i.e. only whitespace characters (or no characters at all) have been read so far.
129- * Consuming and backing up over the first characters does not change the result.
130- *
131- * @return true if no non-whitespace character has been read
132- */
133- protected boolean isAtStart () {
134- return this .contentCharCount == 0 ;
135- }
136-
137123 /**
138124 * Back up one character. This provides a sort of lookahead capability,
139125 * so that you can test for a digit or letter before attempting to parse
@@ -145,9 +131,6 @@ public void back() throws JSONException {
145131 if (this .usePrevious || this .index <= 0 ) {
146132 throw new JSONException ("Stepping back two steps is not supported" );
147133 }
148- if (this .previous > ' ' ) {
149- this .contentCharCount --;
150- }
151134 this .decrementIndexes ();
152135 this .usePrevious = true ;
153136 this .eof = false ;
@@ -248,9 +231,6 @@ public char next() throws JSONException {
248231 return 0 ;
249232 }
250233 this .incrementIndexes (c );
251- if (c > ' ' ) {
252- this .contentCharCount ++;
253- }
254234 this .previous = (char ) c ;
255235 return this .previous ;
256236 }
@@ -569,7 +549,6 @@ public char skipTo(char to) throws JSONException {
569549 long startIndex = this .index ;
570550 long startCharacter = this .character ;
571551 long startLine = this .line ;
572- long startContentCharCount = this .contentCharCount ;
573552 this .reader .mark (1000000 );
574553 do {
575554 c = this .next ();
@@ -581,7 +560,6 @@ public char skipTo(char to) throws JSONException {
581560 this .index = startIndex ;
582561 this .character = startCharacter ;
583562 this .line = startLine ;
584- this .contentCharCount = startContentCharCount ;
585563 return 0 ;
586564 }
587565 } while (c != to );
0 commit comments