Skip to content

Commit 8a05cce

Browse files
committed
removing more dead code
* ObjectSchema: #ifFails() #matchesAnyPattern() * BooleanSchema#hashCode() * SchemaLoader Builder#rootSchemaJson() and the ctor using it
1 parent 0729b1e commit 8a05cce

File tree

4 files changed

+3
-46
lines changed

4 files changed

+3
-46
lines changed

core/src/main/java/org/everit/json/schema/BooleanSchema.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ public boolean equals(final Object o) {
5252
visitor.visitBooleanSchema(this);
5353
}
5454

55-
@Override
56-
public int hashCode() {
57-
return super.hashCode();
58-
}
59-
6055
@Override
6156
protected boolean canEqual(final Object other) {
6257
return other instanceof BooleanSchema;

core/src/main/java/org/everit/json/schema/ObjectSchema.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.util.List;
1010
import java.util.Map;
1111
import java.util.Objects;
12-
import java.util.Optional;
1312
import java.util.Set;
1413
import java.util.regex.Pattern;
1514

@@ -234,28 +233,10 @@ public Schema getPropertyNameSchema() {
234233
return propertyNameSchema;
235234
}
236235

237-
private Optional<ValidationException> ifFails(Schema schema, Object input) {
238-
try {
239-
schema.validate(input);
240-
return Optional.empty();
241-
} catch (ValidationException e) {
242-
return Optional.of(e);
243-
}
244-
}
245-
246236
@Override void accept(Visitor visitor) {
247237
visitor.visitObjectSchema(this);
248238
}
249239

250-
private boolean matchesAnyPattern(String key) {
251-
for (Pattern pattern : patternProperties.keySet()) {
252-
if (pattern.matcher(key).find()) {
253-
return true;
254-
}
255-
}
256-
return false;
257-
}
258-
259240
public boolean permitsAdditionalProperties() {
260241
return additionalProperties;
261242
}

core/src/main/java/org/everit/json/schema/Schema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public abstract static class Builder<S extends Schema> {
2828
private String id;
2929

3030
private String schemaLocation;
31-
31+
3232
private Object defaultValue;
3333

3434
public Builder<S> title(String title) {

core/src/main/java/org/everit/json/schema/loader/SchemaLoader.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,6 @@ SchemaLoaderBuilder pointerSchemas(Map<String, ReferenceSchema.Builder> pointerS
148148
return this;
149149
}
150150

151-
@Deprecated
152-
SchemaLoaderBuilder rootSchemaJson(JSONObject rootSchemaJson) {
153-
return rootSchemaJson(rootSchemaJson.toMap());
154-
}
155-
156151
SchemaLoaderBuilder rootSchemaJson(Object rootSchemaJson) {
157152
this.rootSchemaJson = rootSchemaJson;
158153
return this;
@@ -184,7 +179,8 @@ SchemaLoaderBuilder pointerToCurrentObj(List<String> pointerToCurrentObj) {
184179
* With this flag set to false, the validator ignores the default keyword inside the json schema.
185180
* If is true, validator applies default values when it's needed
186181
*
187-
* @param useDefaults if true, validator doesn't ignore default values
182+
* @param useDefaults
183+
* if true, validator doesn't ignore default values
188184
* @return {@code this}
189185
*/
190186
public SchemaLoaderBuilder useDefaults(boolean useDefaults) {
@@ -286,21 +282,6 @@ public SchemaLoader(SchemaLoaderBuilder builder) {
286282
this.exclusiveLimitHandler = ExclusiveLimitHandler.ofSpecVersion(ls.specVersion());
287283
}
288284

289-
/**
290-
* Constructor.
291-
*
292-
* @deprecated use {@link SchemaLoader#SchemaLoader(SchemaLoaderBuilder)} instead.
293-
*/
294-
@Deprecated SchemaLoader(final String id, final JSONObject schemaJson,
295-
final JSONObject rootSchemaJson, final Map<String, ReferenceSchema.Builder> pointerSchemas,
296-
final SchemaClient httpClient) {
297-
this(builder().schemaJson(schemaJson)
298-
.rootSchemaJson(rootSchemaJson)
299-
.resolutionScope(id)
300-
.httpClient(httpClient)
301-
.pointerSchemas(pointerSchemas));
302-
}
303-
304285
private CombinedSchema.Builder buildAnyOfSchemaForMultipleTypes() {
305286
JsonArray subtypeJsons = ls.schemaJson().require("type").requireArray();
306287
Collection<Schema> subschemas = new ArrayList<>(subtypeJsons.length());

0 commit comments

Comments
 (0)