@@ -821,8 +821,8 @@ public boolean matches(Property property) {
821821 */
822822 static class PropertyMatch {
823823
824- private final @ Nullable Pattern namePatternRegex ;
825- private final @ Nullable String typeName ;
824+ private final @ Nullable Pattern namePatternRegex ;
825+ private final @ Nullable String typeName ;
826826
827827 /**
828828 * Creates a new {@link PropertyMatch} for the given name pattern and type name. At least one of the parameters
@@ -833,10 +833,10 @@ static class PropertyMatch {
833833 */
834834 public PropertyMatch (@ Nullable String namePattern , @ Nullable String typeName ) {
835835
836- Assert .isTrue (!(( namePattern == null ) && ( typeName == null )) , "Either name pattern or type name must be given" );
836+ Assert .isTrue (namePattern != null || typeName != null , "Either name pattern or type name must be given" );
837837
838- this .namePatternRegex = namePattern == null ? null : Pattern .compile (namePattern );
839- this .typeName = typeName ;
838+ this .namePatternRegex = namePattern == null ? null : Pattern .compile (namePattern );
839+ this .typeName = typeName ;
840840 }
841841
842842 /**
@@ -871,11 +871,11 @@ public boolean matches(String name, Class<?> type) {
871871 Assert .notNull (name , "Name must not be null" );
872872 Assert .notNull (type , "Type must not be null" );
873873
874- if (namePatternRegex != null && !namePatternRegex .matcher (name ).matches ()) {
875- return false ;
876- }
874+ if (namePatternRegex != null && !namePatternRegex .matcher (name ).matches ()) {
875+ return false ;
876+ }
877877
878- if (( typeName != null ) && !type .getName ().equals (typeName )) {
878+ if (typeName != null && !type .getName ().equals (typeName )) {
879879 return false ;
880880 }
881881
@@ -916,7 +916,9 @@ public boolean matches(Property property) {
916916
917917 return super .matches (property );
918918 }
919+
919920 }
921+
920922 }
921923
922924}
0 commit comments