Skip to content

Commit 9528d56

Browse files
committed
removing some unnecessary final modifiers
1 parent 24306a2 commit 9528d56

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static class Builder extends Schema.Builder<ObjectSchema> {
5151

5252
private Schema propertyNameSchema;
5353

54-
public Builder additionalProperties(final boolean additionalProperties) {
54+
public Builder additionalProperties(boolean additionalProperties) {
5555
this.additionalProperties = additionalProperties;
5656
return this;
5757
}
@@ -66,14 +66,14 @@ public Builder additionalProperties(final boolean additionalProperties) {
6666
* value will be validated using this {@code schema}
6767
* @return {@code this}
6868
*/
69-
public Builder addPropertySchema(final String propName, final Schema schema) {
69+
public Builder addPropertySchema(String propName, Schema schema) {
7070
requireNonNull(propName, "propName cannot be null");
7171
requireNonNull(schema, "schema cannot be null");
7272
propertySchemas.put(propName, schema);
7373
return this;
7474
}
7575

76-
public Builder addRequiredProperty(final String propertyName) {
76+
public Builder addRequiredProperty(String propertyName) {
7777
requiredProperties.add(propertyName);
7878
return this;
7979
}
@@ -83,22 +83,22 @@ public ObjectSchema build() {
8383
return new ObjectSchema(this);
8484
}
8585

86-
public Builder maxProperties(final Integer maxProperties) {
86+
public Builder maxProperties(Integer maxProperties) {
8787
this.maxProperties = maxProperties;
8888
return this;
8989
}
9090

91-
public Builder minProperties(final Integer minProperties) {
91+
public Builder minProperties(Integer minProperties) {
9292
this.minProperties = minProperties;
9393
return this;
9494
}
9595

96-
public Builder patternProperty(final Pattern pattern, final Schema schema) {
96+
public Builder patternProperty(Pattern pattern, Schema schema) {
9797
this.patternProperties.put(pattern, schema);
9898
return this;
9999
}
100100

101-
public Builder patternProperty(final String pattern, final Schema schema) {
101+
public Builder patternProperty(String pattern, Schema schema) {
102102
return patternProperty(Pattern.compile(pattern), schema);
103103
}
104104

@@ -113,7 +113,7 @@ public Builder patternProperty(final String pattern, final Schema schema) {
113113
* named {@code ifPresent} exists
114114
* @return {@code this}
115115
*/
116-
public Builder propertyDependency(final String ifPresent, final String mustBePresent) {
116+
public Builder propertyDependency(String ifPresent, String mustBePresent) {
117117
Set<String> dependencies = propertyDependencies.get(ifPresent);
118118
if (dependencies == null) {
119119
dependencies = new HashSet<String>(1);
@@ -123,17 +123,17 @@ public Builder propertyDependency(final String ifPresent, final String mustBePre
123123
return this;
124124
}
125125

126-
public Builder requiresObject(final boolean requiresObject) {
126+
public Builder requiresObject(boolean requiresObject) {
127127
this.requiresObject = requiresObject;
128128
return this;
129129
}
130130

131-
public Builder schemaDependency(final String ifPresent, final Schema expectedSchema) {
131+
public Builder schemaDependency(String ifPresent, Schema expectedSchema) {
132132
schemaDependencies.put(ifPresent, expectedSchema);
133133
return this;
134134
}
135135

136-
public Builder schemaOfAdditionalProperties(final Schema schemaOfAdditionalProperties) {
136+
public Builder schemaOfAdditionalProperties(Schema schemaOfAdditionalProperties) {
137137
this.schemaOfAdditionalProperties = schemaOfAdditionalProperties;
138138
return this;
139139
}
@@ -149,7 +149,7 @@ public static Builder builder() {
149149
return new Builder();
150150
}
151151

152-
private static <K, V> Map<K, V> copyMap(final Map<K, V> original) {
152+
private static <K, V> Map<K, V> copyMap(Map<K, V> original) {
153153
return Collections.unmodifiableMap(new HashMap<>(original));
154154
}
155155

@@ -181,7 +181,7 @@ private static <K, V> Map<K, V> copyMap(final Map<K, V> original) {
181181
* @param builder
182182
* the builder object containing validation criteria
183183
*/
184-
public ObjectSchema(final Builder builder) {
184+
public ObjectSchema(Builder builder) {
185185
super(builder);
186186
this.propertySchemas = builder.propertySchemas == null ? null
187187
: Collections.unmodifiableMap(builder.propertySchemas);
@@ -202,7 +202,7 @@ public ObjectSchema(final Builder builder) {
202202
this.propertyNameSchema = builder.propertyNameSchema;
203203
}
204204

205-
private List<String> getAdditionalProperties(final JSONObject subject) {
205+
private List<String> getAdditionalProperties(JSONObject subject) {
206206
String[] names = JSONObject.getNames(subject);
207207
if (names == null) {
208208
return new ArrayList<>();
@@ -253,7 +253,7 @@ public Schema getPropertyNameSchema() {
253253
return propertyNameSchema;
254254
}
255255

256-
private Optional<ValidationException> ifFails(final Schema schema, final Object input) {
256+
private Optional<ValidationException> ifFails(Schema schema, Object input) {
257257
try {
258258
schema.validate(input);
259259
return Optional.empty();
@@ -266,7 +266,7 @@ private Optional<ValidationException> ifFails(final Schema schema, final Object
266266
throw new UnsupportedOperationException("not yet implemented");
267267
}
268268

269-
private boolean matchesAnyPattern(final String key) {
269+
private boolean matchesAnyPattern(String key) {
270270
for (Pattern pattern : patternProperties.keySet()) {
271271
if (pattern.matcher(key).find()) {
272272
return true;
@@ -283,7 +283,7 @@ public boolean requiresObject() {
283283
return requiresObject;
284284
}
285285

286-
private void testAdditionalProperties(final JSONObject subject, List<ValidationException> validationExceptions) {
286+
private void testAdditionalProperties(JSONObject subject, List<ValidationException> validationExceptions) {
287287
if (!additionalProperties) {
288288
List<String> additionalProperties = getAdditionalProperties(subject);
289289
if (null == additionalProperties || additionalProperties.isEmpty()) {
@@ -305,7 +305,7 @@ private void testAdditionalProperties(final JSONObject subject, List<ValidationE
305305
}
306306
}
307307

308-
private void testPatternProperties(final JSONObject subject, List<ValidationException> validationExceptions) {
308+
private void testPatternProperties(JSONObject subject, List<ValidationException> validationExceptions) {
309309
String[] propNames = JSONObject.getNames(subject);
310310
if (propNames == null || propNames.length == 0) {
311311
return;
@@ -322,7 +322,7 @@ private void testPatternProperties(final JSONObject subject, List<ValidationExce
322322
}
323323
}
324324

325-
private void testProperties(final JSONObject subject, List<ValidationException> validationExceptions) {
325+
private void testProperties(JSONObject subject, List<ValidationException> validationExceptions) {
326326
if (propertySchemas != null) {
327327
for (Entry<String, Schema> entry : propertySchemas.entrySet()) {
328328
String key = entry.getKey();
@@ -338,7 +338,7 @@ private void testProperties(final JSONObject subject, List<ValidationException>
338338
}
339339
}
340340

341-
private void testPropertyDependencies(final JSONObject subject, List<ValidationException> validationExceptions) {
341+
private void testPropertyDependencies(JSONObject subject, List<ValidationException> validationExceptions) {
342342
for (String property : propertyDependencies.keySet()) {
343343
if (subject.has(property)) {
344344
for (String mustBePresent : propertyDependencies.get(property)) {
@@ -351,7 +351,7 @@ private void testPropertyDependencies(final JSONObject subject, List<ValidationE
351351
}
352352
}
353353

354-
private void testRequiredProperties(final JSONObject subject, List<ValidationException> validationExceptions) {
354+
private void testRequiredProperties(JSONObject subject, List<ValidationException> validationExceptions) {
355355
for (String required : requiredProperties) {
356356
if (!subject.has(required)) {
357357
validationExceptions.add(
@@ -360,7 +360,7 @@ private void testRequiredProperties(final JSONObject subject, List<ValidationExc
360360
}
361361
}
362362

363-
private void testSchemaDependencies(final JSONObject subject, List<ValidationException> validationExceptions) {
363+
private void testSchemaDependencies(JSONObject subject, List<ValidationException> validationExceptions) {
364364
for (Map.Entry<String, Schema> schemaDep : schemaDependencies.entrySet()) {
365365
String propName = schemaDep.getKey();
366366
if (subject.has(propName)) {
@@ -369,7 +369,7 @@ private void testSchemaDependencies(final JSONObject subject, List<ValidationExc
369369
}
370370
}
371371

372-
private void testSize(final JSONObject subject, List<ValidationException> validationExceptions) {
372+
private void testSize(JSONObject subject, List<ValidationException> validationExceptions) {
373373
int actualSize = subject.length();
374374
if (minProperties != null && actualSize < minProperties.intValue()) {
375375
validationExceptions.addAll(
@@ -385,7 +385,7 @@ private void testSize(final JSONObject subject, List<ValidationException> valida
385385
}
386386

387387
@Override
388-
public void validate(final Object subject) {
388+
public void validate(Object subject) {
389389
if (!(subject instanceof JSONObject)) {
390390
if (requiresObject) {
391391
throw failure(JSONObject.class, subject);
@@ -438,7 +438,7 @@ public boolean definesProperty(String field) {
438438
|| definesSchemaDependencyProperty(field));
439439
}
440440

441-
private boolean definesSchemaProperty(String current, final String remaining) {
441+
private boolean definesSchemaProperty(String current, String remaining) {
442442
current = unescape(current);
443443
boolean hasSuffix = !(remaining == null);
444444
if (propertySchemas.containsKey(current)) {
@@ -451,7 +451,7 @@ private boolean definesSchemaProperty(String current, final String remaining) {
451451
return false;
452452
}
453453

454-
private boolean definesPatternProperty(final String current, final String remaining) {
454+
private boolean definesPatternProperty(String current, String remaining) {
455455
for (Pattern pattern : patternProperties.keySet()) {
456456
if (pattern.matcher(current).matches()) {
457457
if (remaining == null || patternProperties.get(pattern).definesProperty(remaining)) {
@@ -462,7 +462,7 @@ private boolean definesPatternProperty(final String current, final String remain
462462
return false;
463463
}
464464

465-
private boolean definesSchemaDependencyProperty(final String field) {
465+
private boolean definesSchemaDependencyProperty(String field) {
466466
if (schemaDependencies.containsKey(field)) {
467467
return true;
468468
}
@@ -474,7 +474,7 @@ private boolean definesSchemaDependencyProperty(final String field) {
474474
return false;
475475
}
476476

477-
private String unescape(final String value) {
477+
private String unescape(String value) {
478478
return value.replace("~1", "/").replace("~0", "~");
479479
}
480480

0 commit comments

Comments
 (0)