Javaparser: Javadoc for LocalClassDeclarationStmt is incorrect

Created on 8 Dec 2017  路  3Comments  路  Source: javaparser/javaparser

This is a very low priority issue, just thought I'd mention it in passing.

The Javadoc for LocalClassDeclarationStmt states:

Note that JavaParser wil parse interface declarations too, but these are not valid Java code.

That may have been true at some point, but it isn't any more. I just tried it with JavaParser 3.5.4: When I parse a piece of code that tries to declare an interface within a method, JavaParser (rightfully) throws a ParseProblemException with the following message:

There is no such thing as a local interface.

This is certainly a better approach than allowing to parse invalid code, but the Javadoc of LocalClassDeclarationStmt should be updated accordingly. :smiley:

Bug report

Most helpful comment

We are so good that we can keep up with all the improvements we make :D
Thank you, we will correct it!

All 3 comments

We are so good that we can keep up with all the improvements we make :D
Thank you, we will correct it!

Interesting aside: that error is generated by the semantic validation "framework" that was built earlier this year :-) https://matozoid.github.io/2017/04/11/validations.html .

(If you turn them off, JP will happily parse local interface declarations again)

Very interesting article! :+1:

Was this page helpful?
0 / 5 - 0 ratings