maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Lauritsen Khodabocus (JIRA)" <j...@codehaus.org>
Subject [jira] (MPMD-139) Cannot parse "super.<SomeType> someMethod()" syntax
Date Mon, 16 Jan 2012 10:21:02 GMT
Morten Lauritsen Khodabocus created MPMD-139:
------------------------------------------------

             Summary: 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

        

Mime
View raw message