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

Fix adding null annotation to qualified type of parameter #1463

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

jjohnstn
Copy link
Contributor

What it does

Fixes the quick fix to change a parameter to add nullable annotation so that if the parameter type is qualified, it creates or modifies a NameQualifiedType reference and adds the annotation before the simple name (e.g. int foo(java.io @Nullable PrintStream) {...

How to test

See original issue or new tests.

Author checklist

- fix
  NullAnnotationsRewriteOperations.ParameterAnnotationRewriteOperation
  to check for a SimpleType with qualified name or a NameQualifiedType
  and end up with a NameQualifiedType with the new annotation added
- add new tests to NullAnnotationsQuickFixTest
- fixes eclipse-jdt#1462
@jjohnstn jjohnstn self-assigned this Jun 17, 2024
@jjohnstn jjohnstn added bug Something isn't working null relating to (annotation-based) null analysis labels Jun 17, 2024
@jjohnstn jjohnstn added this to the 4.33 M1 milestone Jun 17, 2024
@jjohnstn jjohnstn merged commit b57eccf into eclipse-jdt:master Jun 19, 2024
9 checks passed
@jjohnstn jjohnstn deleted the nullannotation branch June 19, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working null relating to (annotation-based) null analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug 513423 - Quick Fix provides incorrect placement of @Nullable
1 participant