Java 8 Grammar: annotation on throws types #3237

Closed
rnveach opened this Issue Jun 2, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@rnveach
Member

rnveach commented Jun 2, 2016

Taken from PR #3230 when working on Issue #3033 from a run on OpenJDK 8/9.

$ cat TestClass.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

public class TestClass {
    public void m3() throws NullPointerException, @Nullable ArrayIndexOutOfBoundsException {}
}

@Target(ElementType.TYPE_USE)
@interface Nullable {
}

$ cat TestConfig.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>
</module>

$ java -jar checkstyle-6.19-all.jar -c TestConfig.xml TestClass.java
Starting audit...
TestClass.java:5:51: expecting IDENT, found '@'
Audit done.

Input is compilable with java 8 javac.

@romani romani changed the title from Java 8 Grammar: missing annotation 1 to Java 8 Grammar: annotation on throws types Jun 2, 2016

rnveach added a commit to rnveach/checkstyle that referenced this issue Jun 2, 2016

@romani romani added the bug label Jun 3, 2016

romani added a commit that referenced this issue Jun 3, 2016

@romani romani added this to the 7.0 milestone Jun 3, 2016

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jun 3, 2016

Member

fix is merged.

Member

romani commented Jun 3, 2016

fix is merged.

@romani romani closed this Jun 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment