From 57d408a0f086f0bcb356f6e79998c9c47452fb16 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Tue, 3 Oct 2023 22:45:12 +0000 Subject: [PATCH] Removing commented code Signed-off-by: Vacha Shah --- CHANGELOG.md | 2 +- .../client/json/JsonpDeserializerBase.java | 5 ----- .../client/json/ObjectDeserializer.java | 22 ------------------- .../client/json/UnionDeserializer.java | 4 ---- 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46d3de35a5..03a5a898d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Dependencies ### Changed -- Migrated from checkstyle to spotless ([#645](https://github.com/opensearch-project/opensearch-java/pull/645)) +- Migrated from checkstyle to spotless ([#648](https://github.com/opensearch-project/opensearch-java/pull/648)) ### Deprecated diff --git a/java-client/src/main/java/org/opensearch/client/json/JsonpDeserializerBase.java b/java-client/src/main/java/org/opensearch/client/json/JsonpDeserializerBase.java index a7d0d4b285..df405110eb 100644 --- a/java-client/src/main/java/org/opensearch/client/json/JsonpDeserializerBase.java +++ b/java-client/src/main/java/org/opensearch/client/json/JsonpDeserializerBase.java @@ -67,11 +67,6 @@ protected static EnumSet allAcceptedEvents(JsonpDeserializer... deseri for (JsonpDeserializer deserializer : deserializers) { EnumSet set = deserializer.acceptedEvents(); - // Disabled for now. Only happens with the experimental Union2 and is caused by string and number - // parsers leniency. Need to be replaced with a check on a preferred event type. - // if (!Collections.disjoint(result, set)) { - // throw new IllegalArgumentException("Deserializer accepted events are not disjoint"); - // } result.addAll(set); } diff --git a/java-client/src/main/java/org/opensearch/client/json/ObjectDeserializer.java b/java-client/src/main/java/org/opensearch/client/json/ObjectDeserializer.java index bee38fc0a0..316b0239e3 100644 --- a/java-client/src/main/java/org/opensearch/client/json/ObjectDeserializer.java +++ b/java-client/src/main/java/org/opensearch/client/json/ObjectDeserializer.java @@ -278,26 +278,4 @@ public void add(ObjIntConsumer setter, String name, String... deprec add(setter::accept, JsonpDeserializer.integerDeserializer(), name, deprecatedNames); } - // Experiment: avoid boxing, allow multiple primitive parsers (e.g. int as number & string) - // public void add( - // ObjIntConsumer setter, - // JsonpIntParser vp, - // String name, String... deprecatedNames - // ) { - // this.fieldDeserializers.put(name, new FieldDeserializer(name, deprecatedNames) { - // @Override - // public void deserialize(JsonParser parser, JsonpMapper mapper, String fieldName, ObjectType object) { - // JsonpUtils.expectNextEvent(parser, Event.VALUE_NUMBER); - // setter.accept(object, vp.parse(parser)); - // } - // }); - // } - // - // public static class JsonpIntParser { - // public int parse(JsonParser parser) { - // JsonpUtils.expectNextEvent(parser, Event.VALUE_NUMBER); - // return parser.getInt(); - // } - // } - } diff --git a/java-client/src/main/java/org/opensearch/client/json/UnionDeserializer.java b/java-client/src/main/java/org/opensearch/client/json/UnionDeserializer.java index 8d46539b6d..55527cefc0 100644 --- a/java-client/src/main/java/org/opensearch/client/json/UnionDeserializer.java +++ b/java-client/src/main/java/org/opensearch/client/json/UnionDeserializer.java @@ -218,10 +218,6 @@ public JsonpDeserializer build() { otherMembers.put(Event.START_OBJECT, objectMembers.remove(0)); } - // if (objectMembers.size() > 1) { - // System.out.println("multiple objects in " + buildFn); - // } - return new UnionDeserializer<>(objectMembers, otherMembers, buildFn); } }