Skip to content

Commit

Permalink
[java] setter for flag JsonInput.readPerformed (#14921)
Browse files Browse the repository at this point in the history
Co-authored-by: Puja Jagani <puja.jagani93@gmail.com>
  • Loading branch information
iampopovich and pujagani authored Dec 24, 2024
1 parent 5cc56b0 commit dbe1004
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions java/src/org/openqa/selenium/json/JsonInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
public class JsonInput implements Closeable {

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

JsonInput(Reader source, JsonTypeCoercer coercer, PropertySetting setter) {

this.source = Require.nonNull("Source", source);
this.coercer = Require.nonNull("Coercer", coercer);
this.input = new Input(source);
Expand Down Expand Up @@ -402,6 +402,10 @@ public void skipValue() {
}
}

private void markReadPerformed() {
readPerformed = true;
}

/**
* Read the next element from the JSON input stream as the specified type.
*
Expand All @@ -413,6 +417,7 @@ public void skipValue() {
* @throws UncheckedIOException if an I/O exception is encountered
*/
public <T> T read(Type type) {
markReadPerformed();
skipWhitespace(input);

// Guard against reading an empty stream
Expand Down

0 comments on commit dbe1004

Please sign in to comment.