JavaNCSS

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
  • Component/s: None
  • 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.
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

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: