You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@codehaus.org> on 2014/08/20 16:56:11 UTC

[jira] (MCHECKSTYLE-183) Checkstyle fails to compile assignment of anonymous class with generics

     [ https://jira.codehaus.org/browse/MCHECKSTYLE-183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MCHECKSTYLE-183.
--------------------------------------

    Resolution: Not A Bug
      Assignee: Robert Scholte

This is not a bug of the maven-checkstyle-plugin, but from [Checkstyle|http://checkstyle.sourceforge.net/] itself. The issue should be reported there.

> Checkstyle fails to compile assignment of anonymous class with generics
> -----------------------------------------------------------------------
>
>                 Key: MCHECKSTYLE-183
>                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-183
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.9.1
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
> Maven home: /home/rchen/dev/tools/apache-maven-3.0.4
> Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
> Java home: /home/rchen/dev/tools/jdk1.6.0_26/jre
> Default locale: en_CA, platform encoding: UTF-8
> OS name: "linux", version: "2.6.36-020636-generic", arch: "amd64", family: "unix"
>            Reporter: Ronald Chen
>            Assignee: Robert Scholte
>         Attachments: checkstyles-override-with-generics-fixed.tar.gz
>
>
> Attached is a repo case where checkstyles fails to compile valid code and hence fails.
> To run attached code use: mvn checkstyle:check
> The checkstyles parser doesn't like code like:
> {code}
>     CheckstylesOverrideWithGenericsBug assigned = new CheckstylesOverrideWithGenericsBug() {
>       @Overrdie
>       public <SRC> void doStuff(SRC src) {
>       }
>     };
> {code}
> The workaround is to remove the generics and use a more specific type.  In the attached file I've include two more other cases which don't reproduce the problem.
> Another problem is checkstyles fails when it fails to parse code.  This is horrible.  Checkstyles should skip over files it cannot parse unless you can guarantee the checkstyles parser is as good as all other java compilers.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)