-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Description
i read checker documentation
The Regex Checker validates that a legal capturing group number is passed to Matcher’s group, start and end methods.
private static final @Regex(3) Pattern REFERENCE = Pattern.compile(
"^([a-z$][a-z\d$<>.])?(#(.))?$",
Pattern.CASE_INSENSITIVE
);
final Matcher matcher = REFERENCE.matcher(referenceString);
if (matcher.matches()) {
final int methodIndex = 3;
final String methodPart = matcher.group(methodIndex);
final boolean isValid = methodPart == null
|| METHOD.matcher(methodPart).matches();
if (isValid) {
validTag = Optional.of(tag);
}
}
it generate error
<checkerFrameworkError unstable="false">
<specifier>group.count.unknown</specifier>
<message>unable to verify non-literal groups parameter.</message>
<lineContent>final String methodPart = matcher.group(methodIndex);</lineContent>
</checkerFrameworkError>
Should it be handled correctly because the variable declaration is final and the range in the @Regex(3)
, or am I missing something?
Metadata
Metadata
Assignees
Labels
No labels