diff --git a/src/main/java/es/elixir/bsc/json/schema/ParsingError.java b/src/main/java/es/elixir/bsc/json/schema/ParsingError.java index f7a3e1f..bc8bf24 100644 --- a/src/main/java/es/elixir/bsc/json/schema/ParsingError.java +++ b/src/main/java/es/elixir/bsc/json/schema/ParsingError.java @@ -43,7 +43,7 @@ public ParsingError(ParsingMessage message) { this.message = message.VALUE; } - public ParsingError(ParsingMessage message, Object args) { + public ParsingError(ParsingMessage message, Object... args) { this.code = message.CODE; this.message = String.format(message.VALUE, args); } diff --git a/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaReader.java b/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaReader.java index 1b594eb..0385748 100644 --- a/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaReader.java +++ b/src/main/java/es/elixir/bsc/json/schema/impl/DefaultJsonSchemaReader.java @@ -79,10 +79,10 @@ public JsonSchema read(JsonSchemaLocator locator) throws JsonSchemaException { obj = locator.getSchema("/"); } catch (IOException ex) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.UNRESOLVABLE_SCHEMA, new Object[] {locator.uri})); + new ParsingError(ParsingMessage.UNRESOLVABLE_SCHEMA, locator.uri)); } catch (JsonException ex) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.JSON_PARSING_ERROR, new Object[] {ex.getMessage()})); + new ParsingError(ParsingMessage.JSON_PARSING_ERROR, ex.getMessage())); } schema = new DefaultJsonSchemaParser(properties).parse(locator, obj); schemas.put(locator.uri, schema); diff --git a/src/main/java/es/elixir/bsc/json/schema/model/JsonSchemaElement.java b/src/main/java/es/elixir/bsc/json/schema/model/JsonSchemaElement.java index be46b7d..4a12fc8 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/JsonSchemaElement.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/JsonSchemaElement.java @@ -1,6 +1,6 @@ /** * ***************************************************************************** - * Copyright (C) 2022 ELIXIR ES, Spanish National Bioinformatics Institute (INB) + * Copyright (C) 2023 ELIXIR ES, Spanish National Bioinformatics Institute (INB) * and Barcelona Supercomputing Center (BSC) * * Modifications to the initial code base are copyright of their respective diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java index 8b8bdf7..13239b6 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonAnyOfImpl.java @@ -89,7 +89,7 @@ public JsonAnyOfImpl read(final JsonSubschemaParser parser, add(parser.parse(getScope(), parent, getJsonPointer(), value, t)); } catch(IllegalArgumentException ex) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.UNKNOWN_OBJECT_TYPE, new Object[] {val})); + new ParsingError(ParsingMessage.UNKNOWN_OBJECT_TYPE, val)); } } } diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java index 118e82b..55db172 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonRecursiveReferenceImpl.java @@ -97,7 +97,7 @@ public JsonRecursiveReferenceImpl read(final JsonSubschemaParser parser, final JsonString jrecursive_ref = JsonSchemaUtil.check(object.get(RECURSIVE_REF), JsonValue.ValueType.STRING); if (!"#".equals(jrecursive_ref.getString())) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.INVALID_REFERENCE, new Object[] {jrecursive_ref.getString()})); + new ParsingError(ParsingMessage.INVALID_REFERENCE, jrecursive_ref.getString())); } return this; diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java index 826aee9..060bb86 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/JsonReferenceImpl.java @@ -87,13 +87,13 @@ public JsonSchemaElement getSchema() throws JsonSchemaException { JsonValue jsubschema = ref_locator.getSchema(ref_pointer); if (jsubschema == null) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.UNRESOLVABLE_REFERENCE, new Object[] {ref})); + new ParsingError(ParsingMessage.UNRESOLVABLE_REFERENCE, ref)); } schema = parser.parse(ref_locator, getParent(), ref_pointer, jsubschema, null); } catch(IOException | JsonException | IllegalArgumentException ex) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.INVALID_REFERENCE, new Object[] {ref})); + new ParsingError(ParsingMessage.INVALID_REFERENCE, ref)); } } return schema; @@ -132,7 +132,7 @@ public JsonReferenceImpl read(final JsonSubschemaParser parser, } } catch(JsonException | IllegalArgumentException | URISyntaxException ex) { throw new JsonSchemaException( - new ParsingError(ParsingMessage.INVALID_REFERENCE, new Object[] {ref})); + new ParsingError(ParsingMessage.INVALID_REFERENCE, ref)); } return this;