JavaNCSS
  1. JavaNCSS
  2. JAVANCSS-9

cannot parse extending an inner class when generics are involved

    Details

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

      Description

      The following code:

      ParentTree.java:
      package org.example;

      public class ParentTree<K, V> {

      public class Node {

      }
      }

      ChildTree.java:
      package org.example;

      public class ChildTree<K, V> extends ParentTree<K, V> {

      protected class Node extends ParentTree<K,V>.Node {

      }

      }

      fails to parse with the error:
      ParseException in ...\src\java\org\example\ChildTree.java
      Last useful checkpoint: "org.example.ChildTree.Node"
      Encountered "." at line 5, column 48.
      Was expecting one of:
      "implements" ...
      "{" ...
      ">>" ...
      ">>>" ...

      While this code is not likely to be encountered much, it is valid java code compiled with javac (JDK6 in my case - though it should be valid Java 5 code as well).

        Activity

        Hide
        Joshua McKinnon added a comment -

        attached source in zip to make things easier.

        Show
        Joshua McKinnon added a comment - attached source in zip to make things easier.
        Joshua McKinnon made changes -
        Field Original Value New Value
        Attachment javancss-9-example.zip [ 36508 ]
        Hide
        Herve Boutemy added a comment -

        fixed in r166
        thanks to a patch submitted by Sébastien Reynaud

        Show
        Herve Boutemy added a comment - fixed in r166 thanks to a patch submitted by Sébastien Reynaud
        Herve Boutemy made changes -
        Resolution Fixed [ 1 ]
        Assignee Herve Boutemy [ hboutemy ]
        Fix Version/s 31.53 [ 15310 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Herve Boutemy
            Reporter:
            Joshua McKinnon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: