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

CheckStyle does not accept @NonNull... #5371

Closed
duesentrieb17 opened this issue Dec 20, 2017 · 1 comment
Closed

CheckStyle does not accept @NonNull... #5371

duesentrieb17 opened this issue Dec 20, 2017 · 1 comment

Comments

@duesentrieb17
Copy link

/var/tmp $ javac Test.java:

/var/tmp $ cat Test.java:

import static java.lang.annotation.ElementType.TYPE_USE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

public class Test {

	@Retention(RetentionPolicy.CLASS)
	@Target({TYPE_USE})
	public @interface NonNull {
	}

	public void test(final Object @NonNull... args) {
	}
}

/var/tmp $ cat config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="TreeWalker">
    <module name="UpperEll"/>
  </module>
</module>

/var/tmp $ java -Duser.language=en -Duser.country=US -jar checkstyle-8.5-all.jar -c config.xml Test.java:

Starting audit...
/var/tmp/Test.java:14:40: unexpected token: ...
Audit done.

The "@nonnull..." is valid but CheckStyle stumbles over it.


@rnveach
Copy link
Member

rnveach commented Dec 20, 2017

Closing as a duplicate of #3238

@rnveach rnveach closed this as completed Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants