-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
[Bug] Unable to parse TryWithResourcesStatement when the resource list contains a VariableAccess #4368
Comments
Seems like this was missed when adding Java 9 support. I think the best solution here would be to introduce a It would be possible but a bit ugly to keep |
I totally agree with this solution. When I tried to add a class like As a workaround, I replaced the type of the |
I think that something being broken is a valid reason to break the API. The model is incorrect and it needs to be amended. I personally would favor breaking the API over doing some strange backwards compatible workaround, because the latter is likely to just stick around forever. And then the reason for it will be forgotten, and it will just be a weird quirk of Spoon. |
Yes, there are a few pitfalls when modifying the model. If a test in
You'll likely also need to add an entry (I think something like
and also add the interface to the Metamodel here
and you'll also need to modify some methods in |
Describe the bug
In Java language specification, the resource list of a try with resource expression can be either a variable declaration or a variable access (JLS15).
However, the
VariableAccess
is missing if parsed with spoon.To Reproduce
Input:
Processing with Spoon:
Output:
The parsing result for the code snippet above will be
Operating system, JDK and Spoon version used
The text was updated successfully, but these errors were encountered: