CPD Results

The following document contains the results of PMD's CPD 6.55.0.

Duplications

File Project Line
org/apache/johnzon/core/util/ArrayUtil.java Johnzon :: Core 32
org/apache/johnzon/mapper/util/ArrayUtil.java Johnzon :: Mapper 77
}


    public static List<Integer> asList(final int[] vals) {
        return new AbstractList<Integer>() {
            @Override
            public Integer get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Short> asList(final short[] vals) {
        return new AbstractList<Short>() {
            @Override
            public Short get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Long> asList(final long[] vals) {
        return new AbstractList<Long>() {
            @Override
            public Long get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Character> asList(final char[] vals) {
        return new AbstractList<Character>() {
            @Override
            public Character get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Byte> asList(final byte[] vals) {
        return new AbstractList<Byte>() {
            @Override
            public Byte get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Float> asList(final float[] vals) {
        return new AbstractList<Float>() {
            @Override
            public Float get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Double> asList(final double[] vals) {
        return new AbstractList<Double>() {
            @Override
            public Double get(int index) {
                return vals[index];
            }

            @Override
            public int size() {
                return vals.length;
            }
        };
    }

    public static List<Object> asList(final Object[] vals) {
File Project Line
org/apache/johnzon/jaxrs/ConfigurableJohnzonProvider.java Johnzon :: JAX-RS 56
org/apache/johnzon/jaxrs/WildcardConfigurableJohnzonProvider.java Johnzon :: JAX-RS 57
public class ConfigurableJohnzonProvider<T> implements MessageBodyWriter<T>, MessageBodyReader<T> {
    // build/configuration
    private MapperBuilder builder = new MapperBuilder();
    private List<String> ignores;

    // runtime
    private AtomicReference<JohnzonProvider<T>> delegate = new AtomicReference<JohnzonProvider<T>>();

    private JohnzonProvider<T> instance() {
        JohnzonProvider<T> instance;
        do {
            instance = delegate.get();
            if (builder != null && delegate.compareAndSet(null, new JohnzonProvider<T>(builder.build(), ignores))) {
                // reset build instances
                builder = null;
                ignores = null;
            }
        } while (instance == null);
        return instance;
    }

    @Override
    public boolean isReadable(final Class<?> rawType, final Type genericType,
                              final Annotation[] annotations, final MediaType mediaType) {
        return instance().isReadable(rawType, genericType, annotations, mediaType);
    }

    @Override
    public T readFrom(final Class<T> rawType, final Type genericType,
                      final Annotation[] annotations, final MediaType mediaType,
                      final MultivaluedMap<String, String> httpHeaders,
                      final InputStream entityStream) throws IOException {
        return instance().readFrom(rawType, genericType, annotations, mediaType, httpHeaders, entityStream);
    }

    @Override
    public long getSize(final T t, final Class<?> rawType, final Type genericType,
                        final Annotation[] annotations, final MediaType mediaType) {
        return instance().getSize(t, rawType, genericType, annotations, mediaType);
    }

    @Override
    public boolean isWriteable(final Class<?> rawType, final Type genericType,
                               final Annotation[] annotations, final MediaType mediaType) {
        return instance().isWriteable(rawType, genericType, annotations, mediaType);
    }

    @Override
    public void writeTo(final T t, final Class<?> rawType, final Type genericType,
                        final Annotation[] annotations, final MediaType mediaType,
                        final MultivaluedMap<String, Object> httpHeaders,
                        final OutputStream entityStream) throws IOException {
        instance().writeTo(t, rawType, genericType, annotations, mediaType, httpHeaders, entityStream);
    }

    public void setSnippetMaxLength(final int value) {
File Project Line
org/apache/johnzon/core/Types.java Johnzon :: Core 80
org/apache/johnzon/jsonb/reflect/Types.java Johnzon :: JSON-B Implementation 79
Type[] types = resolveArgumentTypes(rawType, parameterizedClass);
        for (int i = 0; i < types.length; i++) {
            if (types[i] instanceof TypeVariable<?>) {
                TypeVariable<?> typeVariable = (TypeVariable<?>) types[i];
                for (int j = 0; j < typeVariables.length; j++) {
                    if (typeVariables[j].getName().equals(typeVariable.getName())) {
                        types[i] = type.getActualTypeArguments()[j];
                    }
                }
            }
        }
        return types;
    }

    private static class ParameterizedTypeImpl implements ParameterizedType {

        private final Type rawType;
        private final Type[] arguments;

        private ParameterizedTypeImpl(final Type rawType, final Type... arguments) {
            this.rawType = rawType;
            this.arguments = arguments;
        }

        @Override
        public Type getRawType() {
            return rawType;
        }

        @Override
        public Type getOwnerType() {
            return null;
        }

        @Override
        public Type[] getActualTypeArguments() {
            return arguments;
        }

        @Override
        public int hashCode() {
            return Arrays.hashCode(arguments) ^ (rawType == null ? 0 : rawType.hashCode());
        }

        @Override
        public boolean equals(final Object obj) {
            if (this == obj) {
                return true;
            } else if (obj instanceof ParameterizedType) {
File Project Line
org/apache/johnzon/websocket/internal/TypeAwareDecoder.java Johnzon :: WebSocket 42
org/apache/johnzon/websocket/mapper/JohnzonTextDecoder.java Johnzon :: WebSocket 64
if (type != null) {
            return;
        }

        if (ServerEndpointConfig.class.isInstance(endpointConfig)) {
            final Class<?> endpointClass = ServerEndpointConfig.class.cast(endpointConfig).getEndpointClass();
            for (final Method m : endpointClass.getMethods()) {
                if (Object.class == m.getDeclaringClass()) {
                    continue;
                }
                if (m.getAnnotation(OnMessage.class) != null) {
                    final Type[] genericParameterTypes = m.getGenericParameterTypes();
                    for (int i = 0; i < genericParameterTypes.length; i++) {
                        if (genericParameterTypes[i] == Session.class) {
                            continue;
                        }
                        boolean param = false;
                        for (final Annotation a : m.getParameterAnnotations()[i]) {
                            if (PathParam.class == a.annotationType()) {
                                param = true;
                                break;
                            }
                        }
                        if (!param) {
                            this.type = genericParameterTypes[i];
                            break;
                        }
                    }
                    break;
                }
            }
            if (type == null) {
                throw new IllegalArgumentException("didn't find @OnMessage in " + endpointClass);
            }
        } else {
            type = Type.class.cast(endpointConfig.getUserProperties().get("johnzon.websocket.message.type"));
            if (type == null) {
                throw new IllegalArgumentException("didn't find johnzon.websocket.message.type");
            }
        }
    }
File Project Line
org/apache/johnzon/jaxrs/ConfigurableJohnzonProvider.java Johnzon :: JAX-RS 226
org/apache/johnzon/jaxrs/WildcardConfigurableJohnzonProvider.java Johnzon :: JAX-RS 166
.collect(toMap(it -> load.apply(it.getKey()), it -> load.apply(it.getValue()))));
    }

    public void setAccessModeFieldFilteringStrategyName(final String mode) {
        builder.setAccessModeFieldFilteringStrategyName(mode);
    }

    public void setSupportHiddenAccess(final boolean supportHiddenAccess) {
        builder.setSupportHiddenAccess(supportHiddenAccess);
    }

    public void setAttributeOrder(final Comparator<String> attributeOrder) {
        builder.setAttributeOrder(attributeOrder);
    }

    public void setReaderFactory(final JsonReaderFactory readerFactory) {
        builder.setReaderFactory(readerFactory);
    }

    public void setGeneratorFactory(final JsonGeneratorFactory generatorFactory) {
        builder.setGeneratorFactory(generatorFactory);
    }

    public void setDoCloseOnStreams(final boolean doCloseOnStreams) {
        builder.setDoCloseOnStreams(doCloseOnStreams);
    }

    public void setVersion(final int version) {
        builder.setVersion(version);
    }

    public void setSkipNull(final boolean skipNull) {
        builder.setSkipNull(skipNull);
    }

    public void setSkipEmptyArray(final boolean skipEmptyArray) {
        builder.setSkipEmptyArray(skipEmptyArray);
    }

    public void setBufferSize(final int bufferSize) {
        builder.setBufferSize(bufferSize);
    }

    public void setBufferStrategy(final String bufferStrategy) {
        builder.setBufferStrategy(bufferStrategy);
    }

    public void setMaxSize(final int size) {
        builder.setMaxSize(size);
    }

    public void setTreatByteArrayAsBase64(final boolean treatByteArrayAsBase64) {
        builder.setTreatByteArrayAsBase64(treatByteArrayAsBase64);
    }

    public void setEncoding(final String encoding) {
File Project Line
org/apache/johnzon/mapper/MapperConfig.java Johnzon :: Mapper 105
org/apache/johnzon/mapper/MapperConfig.java Johnzon :: Mapper 140
public MapperConfig(final LazyConverterMap adapters,
                        final Map<Class<?>, ObjectConverter.Writer<?>> objectConverterWriters,
                        final Map<Class<?>, ObjectConverter.Reader<?>> objectConverterReaders,
                        final int version, final boolean close,
                        final boolean skipNull, final boolean skipEmptyArray,
                        final boolean treatByteArrayAsBase64, final boolean treatByteArrayAsBase64URL,
                        final boolean readAttributeBeforeWrite,
                        final AccessMode accessMode, final Charset encoding,
                        final Comparator<String> attributeOrder,
                        final boolean failOnUnknown,
                        final SerializeValueFilter serializeValueFilter,
                        final boolean useBigDecimalForFloats,
                        final Boolean deduplicateObjects,
                        final Map<Class<?>, Class<?>> interfaceImplementationMapping,
                        final boolean useJsRange,
                        final boolean useBigDecimalForObjectNumbers,
                        final int maxBigDecimalScale,
                        final boolean supportEnumMapDeserialization,
                        final Function<String, Class<?>> typeLoader,
                        final Function<Class<?>, String> discriminatorMapper,
                        final String discriminator,
                        final Predicate<Class<?>> deserializationPredicate,
                        final Predicate<Class<?>> serializationPredicate,
                        final Function<Class<?>, CustomEnumConverter<?>> enumConverterFactory) {
File Project Line
org/apache/johnzon/core/Types.java Johnzon :: Core 58
org/apache/johnzon/jsonb/reflect/Types.java Johnzon :: JSON-B Implementation 57
private Type[] resolveArgumentTypes(Class<?> type, Class<?> parameterizedClass) {
        if (parameterizedClass.equals(type)) {
            // May return Class[] instead of Type[], so copy it as a Type[] to avoid
            // problems in visit(ParameterizedType)
            return Arrays.copyOf(type.getTypeParameters(), parameterizedClass.getTypeParameters().length, Type[].class);
        }
        if (type.getSuperclass() != null && parameterizedClass.isAssignableFrom(type.getSuperclass())) {
            return resolveArgumentTypes(type.getGenericSuperclass(), parameterizedClass);
        }
        Class<?>[] interfaces = type.getInterfaces();
        Type[] genericInterfaces = type.getGenericInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            if (parameterizedClass.isAssignableFrom(interfaces[i])) {
                return resolveArgumentTypes(genericInterfaces[i], parameterizedClass);
            }
        }
        throw new IllegalArgumentException(String.format("%s is not assignable from %s", type, parameterizedClass));
    }

    private Type[] resolveArgumentTypes(ParameterizedType type, Class<?> parameterizedClass) {
File Project Line
org/apache/johnzon/jsonschema/generator/SchemaProcessor.java Johnzon :: JSON Schema 432
org/apache/johnzon/mapper/reflection/Generics.java Johnzon :: Mapper 40
if (ParameterizedType.class.isInstance(clazz)) {
            final ParameterizedType parameterizedType = ParameterizedType.class.cast(clazz);
            if (!Class.class.isInstance(parameterizedType.getRawType())) {
                return emptyMap(); // not yet supported
            }
            final Class<?> raw = Class.class.cast(parameterizedType.getRawType());
            final Type[] arguments = parameterizedType.getActualTypeArguments();
            if (arguments.length > 0) {
                final TypeVariable<? extends Class<?>>[] parameters = raw.getTypeParameters();
                final Map<Type, Type> map = new HashMap<>(parameters.length);
                for (int i = 0; i < parameters.length && i < arguments.length; i++) {
                    map.put(parameters[i], arguments[i]);
                }
                return Stream.concat(map.entrySet().stream(), toResolvedTypes(raw, maxIt + 1).entrySet().stream())
File Project Line
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 316
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 1113
JsonbAccessMode.this.types.asClass(parameterizedType.getRawType())) ? toSet() : toList();
                                                    fn = (json, mp) -> json.asJsonArray().stream()
                                                                           .map(i -> mapItem(i, paramType, mp, jsonbDeserializer))
                                                                           .collect(collector);
                                                }
                                            }
                                        }
                                        if (fn == null) {
                                            fn = (json, mp) -> mapItem(json, targetType, mp, jsonbDeserializer);
                                        }
                                        impl.putIfAbsent(targetType, fn);
                                    }
                                    return fn.apply(value, parser);
                                }

                                private Object mapItem(final JsonValue jsonValue, final Type targetType,
                                                       final MappingParser parser, final JsonbDeserializer jsonbDeserializer) {
                                    return jsonbDeserializer.deserialize(
                                        JsonValueParserAdapter.createFor(jsonValue, parserFactory),
                                        new JohnzonDeserializationContext(parser, builderFactoryInstance, jsonProvider),
                                        targetType);
                                }
File Project Line
org/apache/johnzon/jaxrs/ConfigurableJohnzonProvider.java Johnzon :: JAX-RS 181
org/apache/johnzon/jaxrs/WildcardConfigurableJohnzonProvider.java Johnzon :: JAX-RS 134
builder.setPolymorphicDiscriminator(value);
    }

    public void setSupportConstructors(final boolean supportConstructors) {
        builder.setSupportConstructors(supportConstructors);
    }

    public void setPretty(final boolean pretty) {
        builder.setPretty(pretty);
    }

    public void setSupportGetterForCollections(final boolean supportGetterForCollections) {
        builder.setSupportGetterForCollections(supportGetterForCollections);
    }

    public void setSupportsComments(final boolean supportsComments) {
        builder.setSupportsComments(supportsComments);
    }

    public void setIgnores(final String ignores) {
        this.ignores = ignores == null ? null : asList(ignores.split(" *, *"));
    }

    public void setAccessMode(final AccessMode mode) {
        builder.setAccessMode(mode);
    }

    public void setAccessModeName(final String mode) {
        builder.setAccessModeName(mode);
    }

    public void setAccessModeFieldFilteringStrategy(final BaseAccessMode.FieldFilteringStrategy strategy) {
        builder.setAccessModeFieldFilteringStrategy(strategy);
    }

    public void setInterfaceImplementationMapping(final Map<String, String> interfaceImplementationMapping) {
File Project Line
org/apache/johnzon/jsonschema/spi/builtin/MaxItemsValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MinItemsValidation.java Johnzon :: JSON Schema 36
return Optional.ofNullable(model.getSchema().get("maxItems"))
                .filter(it -> it.getValueType() == JsonValue.ValueType.NUMBER)
                .map(it -> JsonNumber.class.cast(it).intValue())
                .filter(it -> it >= 0)
                .map(max -> new Impl(model.toPointer(), model.getValueProvider(), max));
    }

    private static class Impl extends BaseValidation {
        private final int bound;

        private Impl(final String pointer,
                     final Function<JsonValue, JsonValue> extractor,
                     final int bound) {
            super(pointer, extractor, JsonValue.ValueType.ARRAY);
            this.bound = bound;
        }

        @Override
        protected Stream<ValidationResult.ValidationError> onArray(final JsonArray array) {
            if (array.size() > bound) {
File Project Line
org/apache/johnzon/jsonschema/spi/builtin/MaxPropertiesValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MinPropertiesValidation.java Johnzon :: JSON Schema 36
return Optional.ofNullable(model.getSchema().get("maxProperties"))
                .filter(it -> it.getValueType() == JsonValue.ValueType.NUMBER)
                .map(it -> JsonNumber.class.cast(it).intValue())
                .filter(it -> it >= 0)
                .map(max -> new Impl(model.toPointer(), model.getValueProvider(), max));
    }

    private static class Impl extends BaseValidation {
        private final int bound;

        private Impl(final String pointer,
                     final Function<JsonValue, JsonValue> extractor,
                     final int bound) {
            super(pointer, extractor, JsonValue.ValueType.OBJECT);
            this.bound = bound;
        }

        @Override
        protected Stream<ValidationResult.ValidationError> onObject(final JsonObject object) {
            if (object.size() > bound) {
File Project Line
org/apache/johnzon/core/Types.java Johnzon :: Core 133
org/apache/johnzon/mapper/reflection/JohnzonParameterizedType.java Johnzon :: Mapper 84
&& Arrays.equals(arguments, that.getActualTypeArguments());
            } else {
                return false;
            }
        }

        @Override
        public String toString() {
            final StringBuilder buffer = new StringBuilder();
            buffer.append(((Class<?>) rawType).getSimpleName());
            final Type[] actualTypes = getActualTypeArguments();
            if (actualTypes.length > 0) {
                buffer.append("<");
                int length = actualTypes.length;
                for (int i = 0; i < length; i++) {
                    buffer.append(actualTypes[i].toString());
                    if (i != actualTypes.length - 1) {
                        buffer.append(",");
                    }
                }

                buffer.append(">");
            }
            return buffer.toString();
        }
    }
File Project Line
org/apache/johnzon/jsonschema/spi/builtin/MaxLengthValidation.java Johnzon :: JSON Schema 37
org/apache/johnzon/jsonschema/spi/builtin/MinLengthValidation.java Johnzon :: JSON Schema 37
return Optional.ofNullable(model.getSchema().get("maxLength"))
                    .filter(v -> v.getValueType() == JsonValue.ValueType.NUMBER)
                    .map(m -> new Impl(model.toPointer(), model.getValueProvider(), JsonNumber.class.cast(m).intValue()));
        }
        return Optional.empty();
    }

    private static class Impl extends BaseValidation {
        private final int bound;

        private Impl(final String pointer, final Function<JsonValue, JsonValue> valueProvider, final int bound) {
            super(pointer, valueProvider, JsonValue.ValueType.STRING);
            this.bound = bound;
        }

        @Override
        protected Stream<ValidationResult.ValidationError> onString(final JsonString val) {
            if (val.getString().length() > bound) {
File Project Line
org/apache/johnzon/core/Types.java Johnzon :: Core 137
org/apache/johnzon/jsonb/reflect/Types.java Johnzon :: JSON-B Implementation 135
}

        @Override
        public String toString() {
            final StringBuilder buffer = new StringBuilder();
            buffer.append(((Class<?>) rawType).getSimpleName());
            final Type[] actualTypes = getActualTypeArguments();
            if (actualTypes.length > 0) {
                buffer.append("<");
                int length = actualTypes.length;
                for (int i = 0; i < length; i++) {
                    buffer.append(actualTypes[i].toString());
                    if (i != actualTypes.length - 1) {
                        buffer.append(",");
                    }
                }

                buffer.append(">");
            }
            return buffer.toString();
        }
    }
}
File Project Line
org/apache/johnzon/core/Types.java Johnzon :: Core 137
org/apache/johnzon/jsonb/reflect/Types.java Johnzon :: JSON-B Implementation 135
org/apache/johnzon/jsonschema/generator/SchemaProcessor.java Johnzon :: JSON Schema 496
org/apache/johnzon/mapper/reflection/JohnzonParameterizedType.java Johnzon :: Mapper 88
}

        @Override
        public String toString() {
            final StringBuilder buffer = new StringBuilder();
            buffer.append(((Class<?>) rawType).getSimpleName());
            final Type[] actualTypes = getActualTypeArguments();
            if (actualTypes.length > 0) {
                buffer.append("<");
                int length = actualTypes.length;
                for (int i = 0; i < length; i++) {
                    buffer.append(actualTypes[i].toString());
                    if (i != actualTypes.length - 1) {
                        buffer.append(",");
                    }
                }

                buffer.append(">");
            }
            return buffer.toString();
        }
    }
File Project Line
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 300
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 1095
@Override
                                public Object fromJson(final JsonValue value, final Type targetType, final MappingParser parser) {
                                    final JsonbDeserializer jsonbDeserializer = instance.getValue();
                                    if (global || targetType == mappedType) { // fast test and matches most cases
                                        return mapItem(value, targetType, parser, jsonbDeserializer);
                                    }

                                    BiFunction<JsonValue, MappingParser, Object> fn = impl.get(targetType);
                                    if (fn == null) {
                                        if (value.getValueType() == JsonValue.ValueType.ARRAY) {
                                            if (ParameterizedType.class.isInstance(targetType)) {
                                                final ParameterizedType parameterizedType = ParameterizedType.class.cast(targetType);
                                                final Class<?> paramType = JsonbAccessMode.this.types.findParamType(parameterizedType, Collection.class);
File Project Line
org/apache/johnzon/jaxrs/ConfigurableJohnzonProvider.java Johnzon :: JAX-RS 120
org/apache/johnzon/jaxrs/WildcardConfigurableJohnzonProvider.java Johnzon :: JAX-RS 109
builder.setUseBigDecimalForObjectNumbers(value);
    }

    // type=a,b,c|type2=d,e
    public void setIgnoreFieldsForType(final String mapping) {
        for (final String config : mapping.split(" *| *")) {
            final String[] parts = config.split(" *= *");
            try {
                final Class<?> type = Thread.currentThread().getContextClassLoader().loadClass(parts[0]);
                if (parts.length == 1) {
                    builder.setIgnoreFieldsForType(type);
                } else {
                    builder.setIgnoreFieldsForType(type, parts[1].split(" *, *"));
                }
            } catch (final ClassNotFoundException e) {
                throw new IllegalArgumentException(e);
            }
        }
    }

    public void setFailOnUnknownProperties(final boolean active) {
File Project Line
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 418
org/apache/johnzon/jsonb/JsonbAccessMode.java Johnzon :: JSON-B Implementation 473
} catch (final IllegalAccessException e) {
                    throw new IllegalStateException(e);
                } catch (final InvocationTargetException e) {
                    throw new IllegalStateException(e.getCause());
                }
            }

            @Override
            public Type[] getParameterTypes() {
                return types;
            }

            @Override
            public String[] getParameterNames() {
                return params;
            }

            @Override
            public Adapter<?, ?>[] getParameterConverter() {
                return converters;
            }

            @Override
            public Adapter<?, ?>[] getParameterItemConverter() {
                return itemConverters;
            }

            @Override
            public ObjectConverter.Codec<?>[] getObjectConverter() {
                return objectConverters;
            }
        };
    }

    private Object tryToCreateInstance(final Class<?> declaringClass) {
File Project Line
org/apache/johnzon/jsonschema/spi/builtin/MaxItemsValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MaxPropertiesValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MinItemsValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MinPropertiesValidation.java Johnzon :: JSON Schema 36
return Optional.ofNullable(model.getSchema().get("maxItems"))
                .filter(it -> it.getValueType() == JsonValue.ValueType.NUMBER)
                .map(it -> JsonNumber.class.cast(it).intValue())
                .filter(it -> it >= 0)
                .map(max -> new Impl(model.toPointer(), model.getValueProvider(), max));
    }

    private static class Impl extends BaseValidation {
        private final int bound;

        private Impl(final String pointer,
                     final Function<JsonValue, JsonValue> extractor,
                     final int bound) {
            super(pointer, extractor, JsonValue.ValueType.ARRAY);
File Project Line
org/apache/johnzon/jsonschema/spi/builtin/ExclusiveMaximumValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/ExclusiveMinimumValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MaximumValidation.java Johnzon :: JSON Schema 36
org/apache/johnzon/jsonschema/spi/builtin/MinimumValidation.java Johnzon :: JSON Schema 36
return Optional.ofNullable(model.getSchema().get("exclusiveMaximum"))
                    .filter(v -> v.getValueType() == JsonValue.ValueType.NUMBER)
                    .map(m -> new Impl(model.toPointer(), model.getValueProvider(), JsonNumber.class.cast(m).doubleValue()));
        }
        return Optional.empty();
    }

    private static class Impl extends BaseNumberValidation {
        private Impl(final String pointer, final Function<JsonValue, JsonValue> valueProvider, final double bound) {
            super(pointer, valueProvider, bound);
        }

        @Override
        protected boolean isValid(final double val) {
            return val < this.bound;
File Project Line
org/apache/johnzon/jsonb/JsonbMappings.java Johnzon :: JSON-B Implementation 61
org/apache/johnzon/mapper/Mappings.java Johnzon :: Mapper 95
protected ClassMapping(final Class<?> clazz, final AccessMode.Factory factory,
                               final Map<String, Getter> getters, final Map<String, Setter> setters,
                               final Adapter<?, ?> adapter,
                               final ObjectConverter.Reader<?> reader, final ObjectConverter.Writer<?> writer,
                               final Getter anyGetter, final Method anySetter, final Field anyField,
                               final Method mapAdder,
                               final Map.Entry<String, String>[] serializedPolymorphicProperties,
                               final BiFunction<JsonObject, Class<?>, Class<?>> polymorphicDeserializedTypeResolver) {