Skip to content

Remove CheckerFramework 'RegexChecker' annotation processor #12567

@nrmancuso

Description

@nrmancuso

https://checkerframework.org/releases/1.9.0/tutorial/webpages/user-input-cmd.html

We do not need to validate regexp input by users, since failure message generated by Checkstyle is enough:

➜  src cat config.xml 
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
        "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="RegexpSingleline">
    <property name="format" value="..("/>
  </module>
</module>
➜  src java -jar checkstyle-10.4-all.jar -c config.xml Test.java
Starting audit...
Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed group near index 3
..(
        at java.base/java.util.regex.Pattern.error(Pattern.java:2045)
        at java.base/java.util.regex.Pattern.accept(Pattern.java:1895)

We need to remove this annotation processor and all associated suppressions.

Reasoning (from #12086 (comment)_):

having compile dependency to checker might be too much for now.
after reading documentation with example attentively, I do not think we should use this Check - Validating User Input.
We are library code, we do not know where we are configured. We throw exception to let upper level decide what to do with this exception. I think our pitest will do all required work to demand full coverage for code and validate all indexes of groups.
Again If we fail with exception - it is ok for us.

I am voting to deactivate Validating User Input.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions