@@ -814,8 +814,8 @@ public boolean matches(Property property) {
814814 */
815815 static class PropertyMatch {
816816
817- private final @ Nullable Pattern namePatternRegex ;
818- private final @ Nullable String typeName ;
817+ private final @ Nullable Pattern namePatternRegex ;
818+ private final @ Nullable String typeName ;
819819
820820 /**
821821 * Creates a new {@link PropertyMatch} for the given name pattern and type name. At least one of the parameters
@@ -826,10 +826,10 @@ static class PropertyMatch {
826826 */
827827 public PropertyMatch (@ Nullable String namePattern , @ Nullable String typeName ) {
828828
829- Assert .isTrue (!(( namePattern == null ) && ( typeName == null )) , "Either name pattern or type name must be given" );
829+ Assert .isTrue (namePattern != null || typeName != null , "Either name pattern or type name must be given" );
830830
831- this .namePatternRegex = namePattern == null ? null : Pattern .compile (namePattern );
832- this .typeName = typeName ;
831+ this .namePatternRegex = namePattern == null ? null : Pattern .compile (namePattern );
832+ this .typeName = typeName ;
833833 }
834834
835835 /**
@@ -864,11 +864,11 @@ public boolean matches(String name, Class<?> type) {
864864 Assert .notNull (name , "Name must not be null" );
865865 Assert .notNull (type , "Type must not be null" );
866866
867- if (namePatternRegex != null && !namePatternRegex .matcher (name ).matches ()) {
868- return false ;
869- }
867+ if (namePatternRegex != null && !namePatternRegex .matcher (name ).matches ()) {
868+ return false ;
869+ }
870870
871- if (( typeName != null ) && !type .getName ().equals (typeName )) {
871+ if (typeName != null && !type .getName ().equals (typeName )) {
872872 return false ;
873873 }
874874
@@ -909,7 +909,9 @@ public boolean matches(Property property) {
909909
910910 return super .matches (property );
911911 }
912+
912913 }
914+
913915 }
914916
915917}
0 commit comments