Glowman554 / BetterNudel

Private method is never called JAVA-W0324
Anti-pattern
Minor
2 years ago2 years old
Private method encode is never called in this file
254            arrayField(key, value.get());
255        }
256
257        private static <A> JsonNode encode(JsonCodec<A> codec, A obj, String key) {258            try {259                return codec.encode(obj);260            } catch (JsonException exc) {261                throw new JsonCodecException(key + " > " + exc.getMessage(), exc);262            }263        }264
265        @Override
266        public <A> void field(String key, JsonCodec<A> codec, A value) {
Private method encode is never called in this file
221            return json;
222        }
223
224        private static <A extends JsonRepresentable> JsonNode encode(A obj, String key) {225            try {226                return obj.toJson();227            } catch (JsonException exc) {228                throw new JsonCodecException(key + " > " + exc.getMessage(), exc);229            }230        }231
232        @Override
233        public void field(String key, JsonRepresentable value) {
Private method decode is never called in this file
167            applyField(key, json -> applier.accept(decode(codec, json, key)));
168        }
169
170        private static <A extends JsonEncodable> A decode(Function<JsonNode, A> factory, JsonNode node, String key) {171            try {172                A obj = factory.apply(node);173                obj.fromJson(node);174                return obj;175            } catch (JsonException exc) {176                throw new JsonCodecException(key + " > " + exc.getMessage(), exc);177            }178        }179
180        @Override
181        public <A extends JsonEncodable> A field(String key, Function<JsonNode, A> factory) {
Private method decode is never called in this file
143            }
144        }
145
146        private static <A> A decode(JsonCodec<A> codec, JsonNode node, String key) {147            try {148                return codec.decode(node);149            } catch (JsonException exc) {150                throw new JsonCodecException(key + " > " + exc.getMessage(), exc);151            }152        }153
154        @Override
155        public <A> A field(String key, JsonCodec<A> codec) {