Avoid possible confusion caused by removing ioexception from consumer.apply
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
-import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -262,7 +261,7 @@ public JsonOutput write(Object input, int depthRemaining) {
.findFirst()
.map(Map.Entry::getValue)
.orElseThrow(() -> new JsonException("Unable to write " + input))
- .accept(input, depthRemaining);
+ .consume(input, depthRemaining);
return this;
}
@@ -416,16 +415,7 @@ public void write(String text) {
}
@FunctionalInterface
- private interface SafeBiConsumer<T, U> extends BiConsumer<T, U> {
- void consume(T t, U u) throws IOException;
-
- @Override
- default void accept(T t, U u) {
- try {
- consume(t, u);
- } catch (IOException e) {
- throw new JsonException(e);
- }
- }
+ private interface SafeBiConsumer<T, U> {
+ void consume(T t, U u);
}
}
