You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Morten Lauritsen Khodabocus (JIRA)" <ji...@codehaus.org> on 2012/01/16 11:21:02 UTC

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Andreas Dangel (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=299829#comment-299829 ] 

Andreas Dangel commented on MPMD-139:
-------------------------------------

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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy closed MPMD-139.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 3.0
         Assignee: Olivier Lamy
    
> 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
>            Assignee: Olivier Lamy
>             Fix For: 3.0
>
>
> 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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=288422#comment-288422 ] 

Robert Scholte commented on MPMD-139:
-------------------------------------

Maybe it's already fixed with MPMD-134
                
> 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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Andreas Dangel (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=314689#comment-314689 ] 

Andreas Dangel commented on MPMD-139:
-------------------------------------

This bug is definitively fixed with PMD 5.0.1.
See the corresponding bug: https://sourceforge.net/p/pmd/bugs/1010/
                
> 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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Morten Lauritsen Khodabocus (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=288403#comment-288403 ] 

Morten Lauritsen Khodabocus commented on MPMD-139:
--------------------------------------------------

This problem does not occur when running the same check in Eclipse, which might suggest the problem is in the maven plugin (not sure).

I could try to provide a patch, but I'm not sure where to begin.

                
> 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

        

[jira] (MPMD-139) Cannot parse "super. someMethod()" syntax

Posted by "Andreas Dangel (JIRA)" <ji...@codehaus.org>.
    [ 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