@@ -62,11 +62,10 @@ data class AlignRule(val name: String?,
6262 fun ruleMatches (dep : ModuleVersionIdentifier ) = ruleMatches(dep.group, dep.name)
6363
6464 fun ruleMatches (inputGroup : String , inputName : String ): Boolean {
65- if (groupMatcher == null ) {
66- groupMatcher = safelyCreatesMatcher(group, inputGroup, " group" )
67- includesMatchers = includes.map { safelyCreatesMatcher(it, inputName, " includes" ) }
68- excludesMatchers = excludes.map { safelyCreatesMatcher(it, inputName, " excludes" ) }
69- }
65+ groupMatcher = safelyCreatesMatcher(group, inputGroup, " group" )
66+ includesMatchers = includes.map { safelyCreatesMatcher(it, inputName, " includes" ) }
67+ excludesMatchers = excludes.map { safelyCreatesMatcher(it, inputName, " excludes" ) }
68+
7069
7170 return safelyMatches(groupMatcher!! , inputGroup, " group" ) &&
7271 (includes.isEmpty() || includesMatchers.any { safelyMatches(it, inputName, " includes" ) }) &&
@@ -78,16 +77,16 @@ data class AlignRule(val name: String?,
7877 it.toPattern().matcher(input)
7978 } catch (e: Exception ) {
8079 throw java.lang.IllegalArgumentException (" Failed to use regex '$it ' from type '$type ' to create matcher for '$input '\n " +
81- " Rule: ${this } " )
80+ " Rule: ${this } " , e )
8281 }
8382 }
8483
8584 private fun safelyMatches (it : Matcher , input : String , type : String ): Boolean {
8685 return try {
87- it.matches(input )
86+ it.matches()
8887 } catch (e: Exception ) {
8988 throw java.lang.IllegalArgumentException (" Failed to use matcher '$it ' from type '$type ' to match '$input '\n " +
90- " Rule: ${this } " )
89+ " Rule: ${this } " , e )
9190 }
9291 }
9392}
0 commit comments