Skip to content

Commit 5f08b0a

Browse files
committed
Revert "fixed setting field in jsonInput class"
This reverts commit d428f31.
1 parent 4773b32 commit 5f08b0a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

java/src/org/openqa/selenium/json/JsonInput.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
public class JsonInput implements Closeable {
4040

4141
private final Reader source;
42-
private boolean readPerformed = false; // Changed from final
42+
// FIXME: This flag is never set
43+
private final boolean readPerformed = false;
4344
private JsonTypeCoercer coercer;
4445
private PropertySetting setter;
4546
private final Input input;
@@ -48,7 +49,6 @@ public class JsonInput implements Closeable {
4849
private final Deque<Container> stack = new ArrayDeque<>();
4950

5051
JsonInput(Reader source, JsonTypeCoercer coercer, PropertySetting setter) {
51-
5252
this.source = Require.nonNull("Source", source);
5353
this.coercer = Require.nonNull("Coercer", coercer);
5454
this.input = new Input(source);
@@ -402,10 +402,6 @@ public void skipValue() {
402402
}
403403
}
404404

405-
private void markReadPerformed() {
406-
readPerformed = true;
407-
}
408-
409405
/**
410406
* Read the next element from the JSON input stream as the specified type.
411407
*
@@ -417,16 +413,15 @@ private void markReadPerformed() {
417413
* @throws UncheckedIOException if an I/O exception is encountered
418414
*/
419415
public <T> T read(Type type) {
420-
markReadPerformed();
421416
skipWhitespace(input);
422417

418+
// Guard against reading an empty stream
423419
if (input.peek() == Input.EOF) {
424420
return null;
425421
}
426422

427423
return coercer.coerce(this, type, setter);
428424
}
429-
}
430425

431426
/**
432427
* Read an array of elements from the JSON input stream with elements as the specified type.

0 commit comments

Comments
 (0)