File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed
core/src/main/java/org/everit/json/schema Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -417,25 +417,14 @@ private boolean definesSchemaProperty(String field) {
417
417
}
418
418
419
419
private boolean definesPatternProperty (String field ) {
420
- for (Entry <Pattern , Schema > entry : patternProperties .entrySet ()) {
421
- if (entry .getKey ().matcher (field ).matches ()) {
422
- return true ;
423
- }
424
- }
425
- return false ;
420
+ return patternProperties .keySet ().stream ().filter (pattern -> pattern .matcher (field ).matches ())
421
+ .findAny ().isPresent ();
426
422
}
427
423
428
424
private boolean definesSchemaDependencyProperty (String field ) {
429
- if (schemaDependencies .containsKey (field )) {
430
- return true ;
431
- }
432
-
433
- for (Schema schema : schemaDependencies .values ()) {
434
- if (schema .definesProperty (field )) {
435
- return true ;
436
- }
437
- }
438
- return false ;
425
+ return schemaDependencies .containsKey (field )
426
+ || schemaDependencies .values ().stream ().filter (schema -> schema .definesProperty (field ))
427
+ .findAny ().isPresent ();
439
428
}
440
429
441
430
}
You can’t perform that action at this time.
0 commit comments