[
https://jira.codehaus.org/browse/MCHECKSTYLE-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=341848#comment-341848
]
Dennis Lundberg commented on MCHECKSTYLE-183:
---------------------------------------------
This should be reported to the Checkstyle project at
http://checkstyle.sourceforge.net/
> 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
> 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)