Skip to content

Commit 548f896

Browse files
iampopovichpujagani
authored andcommitted
[java] setter for flag JsonInput.readPerformed (SeleniumHQ#14921)
Co-authored-by: Puja Jagani <[email protected]>
1 parent d91e6c7 commit 548f896

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

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

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

5150
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,6 +402,10 @@ public void skipValue() {
402402
}
403403
}
404404

405+
private void markReadPerformed() {
406+
readPerformed = true;
407+
}
408+
405409
/**
406410
* Read the next element from the JSON input stream as the specified type.
407411
*
@@ -413,6 +417,7 @@ public void skipValue() {
413417
* @throws UncheckedIOException if an I/O exception is encountered
414418
*/
415419
public <T> T read(Type type) {
420+
markReadPerformed();
416421
skipWhitespace(input);
417422

418423
// Guard against reading an empty stream

0 commit comments

Comments
 (0)