Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotationUseStyle does not detect all violations in EXPANDED style #6818

Closed
strkkk opened this issue Jun 13, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@strkkk
Copy link
Contributor

commented Jun 13, 2019

$ cat TestClass.java
public class TestClass {
    @MyAnnotation(@Deprecated) // violation
        class Example1 {}
        @MyAnnotation({}) // violation
        class Example2 {}
        @MyAnnotation(@Deprecated()) // violation
        class Example3 {}

        @interface MyAnnotation {
        Deprecated[] value();
        }
}

$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<module name="Checker">
    <property name="charset" value="UTF-8"/>

    <module name="TreeWalker">
<module name="FinalLocalVariable" />

<module name="AnnotationUseStyleCheck">
<property name="elementStyle" value="expanded" />
<property name="closingParens" value="ignore" />
</module>
    </module>
</module>

$ java -jar checkstyle-8.20-all.jar -c config.xml TestClass.java
Starting audit...
Audit done.

Expected: violations on lines commented with // violation

@rnveach

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

Fix was merged

@rnveach rnveach closed this Jun 15, 2019

@rnveach rnveach added this to the 8.22 milestone Jun 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.