-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] More parser edge cases #3643
Comments
About the last code sample here (Qualified Constructor Parameter), this is not valid Java code according to the JLS. The JLS is very clear that the receiver parameter can only be preceded by a simple name: https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-ReceiverParameter
While Javac accepts this without complaining, this will probably never be found in the wild, and I don't think we should try to support it. |
Yes, I agree. It could even be seen as a bug in javac. |
Affects PMD Version: 6.40.0
Description: Found in checkstyle sources in #3640
There are a couple of samples - we might want to split these into separate issues when solving them. But for now, I collect all cases in one issue.
Annotated Array Type
Error while type resolution
This stacktrace only appears with type resolution. Didn't dig deeper into this, but here's the stacktrace
// From https://github.com/checkstyle/checkstyle/blob/checkstyle-9.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/avoidnoargumentsuperconstructorcall/InputAvoidNoArgumentSuperConstructorCall.java
Type Annotations
Generic Constructor call
Generic super call
Annotation Comma Array Initializer
Qualified Constructor Parameter
From https://github.com/checkstyle/checkstyle/blob/checkstyle-9.1/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/antlr4/InputAntlr4AstRegressionQualifiedConstructorParameter.java
The text was updated successfully, but these errors were encountered: