Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-139

Cannot parse "super.<SomeType> someMethod()" syntax

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6
    • 3.0
    • PMD
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              olamy Olivier Lamy
              mlauritse Morten Lauritsen Khodabocus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: