-
Notifications
You must be signed in to change notification settings - Fork 874
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
Fixing pattern matching for binding patterns #5121
Fixing pattern matching for binding patterns #5121
Conversation
…ng pattern. Originally provided as: apache#3342 Manually ported to current state of (nb)javac. Closes: apache#3342
- JavaHintsAnnotationProcessorTest makes assumptions about the error messages. On non-english locales this fails, so ensure an english locale is configured. - Elements#getPackageElement in modular projects is to specific as it suppresses results where an empty package is found. To work around this fallback to Elements#getAllPackageElements, which misses this check. - The golden analyser pattern in UtilitiesTest needs to be adjusted to reality: The $expr is reported twice: once as JCConstantLabel and once as JCIdent
a04a6cf
to
56d4ab4
Compare
@jlahoda this is an updated version of your PR #3342. The fix was pending and began to bitrot. As I think I triggered it and it was already reviewed by @jtulach I had a look and checked if I could fix the problems. I think I succeeded. Could you please double check? @mbien you touched the tests so would be nice if you could also have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thanks!
assertPositions(result, positions[0], code, "$expr", "$stmts$", "$stmts$;", "case $expr: foo bar $stmts$;", "foo", "foo bar "); | ||
assertPositions(result, positions[0], code, "$expr", "$expr", "$stmts$", "$stmts$;", "case $expr: foo bar $stmts$;", "foo", "foo bar "); | ||
} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome. Good to see this test case enabled.
I wanted to do that in:
#5107 (comment)
when we enabled tests for this module (and many others) which was completely turned off till now.
but I wasn't sure if the result was actually correct. So I commented it out instead of running the risk to commit a wrong test assumption.
Thank you for the review. Lets get this in. |
^Add meaningful description above
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log
) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.