[ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=299829#comment-299829 ]
Andreas Dangel edited comment on MPMD-139 at 5/27/12 1:22 PM: -------------------------------------------------------------- -I can confirm that this problem is solved with PMD 4.3, which is used by maven-pmd-plugin 2.7.1.- Sorry, I was too optimistic. It works with "this.<SomeClass> someMethod(someArgument)" but not with "super". I created a bug in PMD: https://sourceforge.net/tracker/?func=detail&aid=3530124&group_id=56262&atid=479921 was (Author: adangel): I can confirm that this problem is solved with PMD 4.3, which is used by maven-pmd-plugin 2.7.1. > Cannot parse "super.<SomeType> someMethod()" syntax > --------------------------------------------------- > > Key: MPMD-139 > URL: https://jira.codehaus.org/browse/MPMD-139 > Project: Maven 2.x PMD Plugin > Issue Type: Bug > Components: PMD > Affects Versions: 2.6 > Environment: $ mvn --version > Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) > Maven home: xxx\apache-maven-3.0.3 > Java version: 1.6.0_17, vendor: Sun Microsystems Inc. > Java home: xxx\jdk1.6.0_17\jre > Default locale: de_CH, platform encoding: Cp1252 > OS name: "windows xp", version: "5.1", arch: "x86", family: "windows" > PMD plugin configuration: > <artifactId>maven-pmd-plugin</artifactId> > <version>2.6</version> > <configuration> > <linkXRef>false</linkXRef> > <verbose>true</verbose> > <targetJdk>1.5</targetJdk> > <sourceEncoding>UTF-8</sourceEncoding> > </configuration> > Reporter: Morten Lauritsen Khodabocus > > The description has been anonymized, but AFAIK, all important details remain. > :-) > On the following code: > Line 155: return super.<SomeClass> someMethod(someArgument); > PMD reports the following problem: > [WARNING] Error while parsing xxx\MyClass.java: Encountered " "<" "< "" at > line 155, column 22. > Was expecting: > <IDENTIFIER> ... > I tried the following: > 1) Updated PMD maven plugin to 2.6 (I was using 2.5) > 2) Verified that the targetJdk setting is taking effect (I get an error when > setting it to "xxx") > 3) I set the source encoding to UTF-8 (My default is Cp1252) > 4) When changing line 155 to "return (Iterable<SomeClass>) > super.someMethod(someArgument);", no error is reported > So it seems that Java 5 mode is enabled, but the particular syntax of > parameterizing the method call on invocation is not supported. > This is valid syntax, the code is running in production. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira