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: false positive on annotation with default nested annotation inside #6540

Closed
rnveach opened this issue Mar 10, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@rnveach
Copy link
Member

commented Mar 10, 2019

Moved from #6446 (comment).

$ cat TestClass.java
@Anno(@Value) // violation , but no violation is expected
public class Example {
}

@interface Anno {
    Value value();
}

@interface Value {
}

$ cat TestConfig.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "https://checkstyle.org/dtds/configuration_1_3.dtd">

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

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

$ java -jar checkstyle-8.10-all.jar -c TestConfig.xml TestClass.java
Starting audit...
[ERROR] TestClass.java:1: Annotation cannot have closing parenthesis. [AnnotationUseStyle]
Audit done.
Checkstyle ends with 1 errors.

Expecting no violation.

@rnveach rnveach added the approved label Mar 30, 2019

strkkk added a commit to strkkk/checkstyle that referenced this issue Apr 6, 2019

strkkk added a commit to strkkk/checkstyle that referenced this issue Apr 6, 2019

romani added a commit that referenced this issue Apr 17, 2019

@romani romani added the bug label Apr 17, 2019

@romani romani added this to the 8.20 milestone Apr 17, 2019

@rnveach

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

Fix was merged

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.