JavaNCSS
  1. JavaNCSS
  2. JAVANCSS-17

JavaNCSS fails to parse calls like "super.<T>foo()".

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 30.51
    • Fix Version/s: 32.53
    • Labels:
      None
    • Number of attachments :
      2

      Description

      JavaNCSS fails to parse Class2 in the example below:

      public class Class1 {
      public <T> T foo()

      { return null; }

      }

      class Class2 extends Class1 {
      public <T> T bar()

      { return this.<T>foo(); }

      public <T> T foo()

      { return super.<T>foo(); }

      }

      Note that "this.<T>foo()" seems to be parsed correctly, but "super.<T>foo()" seems to trip the parser:

      ParseException in /home/SGLINZ03/jsa/tmp/Class1.java
      Last useful checkpoint: "Class2.foo()"
      Encountered "<" at line 12, column 18.
      Was expecting one of:
      "assert" ...
      <IDENTIFIER> ...

      1. Class1.java
        0.2 kB
        Joachim Sauer
      2. JAVANCSS-17_patch.diff
        0.9 kB
        Sébastien Reynaud

        Activity

        Joachim Sauer made changes -
        Field Original Value New Value
        Attachment Class1.java [ 42192 ]
        Sébastien Reynaud made changes -
        Attachment JAVANCSS-17_patch.diff [ 42272 ]
        Herve Boutemy made changes -
        Fix Version/s 31.53 [ 15310 ]
        Assignee Herve Boutemy [ hboutemy ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Herve Boutemy
            Reporter:
            Joachim Sauer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: