Skip to content

Commit

Permalink
[java] fixed the characteristics of the collector
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Oct 12, 2023
1 parent 2de505e commit 8fc8ce6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions java/src/org/openqa/selenium/json/JsonTypeCoercer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.openqa.selenium.json;

import static java.util.stream.Collector.Characteristics.CONCURRENT;
import static java.util.stream.Collector.Characteristics.UNORDERED;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toSet;
Expand Down Expand Up @@ -127,9 +126,7 @@ private JsonTypeCoercer(Stream<TypeCoercer<?>> coercers) {
(l, r) -> {
l.putAll(r);
return l;
},
UNORDERED,
CONCURRENT)));
})));

// If the requested type is exactly "Object", do some guess work
builder.add(new ObjectCoercer(this));
Expand Down

1 comment on commit 8fc8ce6

@joerg1985
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LinkedHashMap does commit to save the order of elements added, the UNORDERED flag was incorrect.
The implementation of LinkedHashMap is not synchronized (see javadoc), the CONCURRENT flag was incorrect.

Please sign in to comment.