Skip to content
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

Syntax error on annotated type parameter #182

Open
eskatos opened this issue Nov 12, 2023 · 2 comments
Open

Syntax error on annotated type parameter #182

eskatos opened this issue Nov 12, 2023 · 2 comments

Comments

@eskatos
Copy link

eskatos commented Nov 12, 2023

When parsing the following code:

public interface Example<T extends @Nullable Object> {}

or any annotated type parameter,
qdox 2.0.3 fails with:

Caused by: com.thoughtworks.qdox.parser.ParseException: syntax error @[26,42] in file:/path/to/Example.java
        at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:1963)
        at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:2085)
        at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:1944)
        at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:232)
        at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:209)
        at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:159)

Context

Parsing Java code from the https://github.com/gradle/gradle codebase for its own build.

Two examples:

https://github.com/gradle/gradle/blob/13c9f3d7a3e7d7a6180fd6bd5c52f35c5d068680/subprojects/core-api/src/main/java/org/gradle/api/Transformer.java#L26

https://github.com/gradle/gradle/blob/13c9f3d7a3e7d7a6180fd6bd5c52f35c5d068680/subprojects/core-api/src/main/java/org/gradle/api/provider/Provider.java#L127

@eskatos
Copy link
Author

eskatos commented Nov 12, 2023

@paul-hammant
Copy link
Owner

Can you make an integration test -> https://github.com/paul-hammant/qdox/tree/master/src/it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants