I have to prepare another val before using in while statement :
// translated from java code.
public fun compute(){
var patternString = path
patternString = customRegexPattern.replacer(“{<[^/]+>$1}”)?.replace(patternString)!!
val matcher = argsPattern.matcher(patternString)
// assign it to a val first
var b = matcher?.find()!!
// now it’s ok
while(b) {
args.put(matcher?.group(2)!!, null)
b = matcher?.find()!!
}
patternString = argsPattern.replacer(“({$2}$1)”)?.replace(patternString)!!
pattern = Pattern(patternString)
}
It’s not a big problem , just a little unconvenient!
outersky