Repository navigation
NETBEANS-9798 Fix PullUp/Move refactoring when a not initialized field is moved to an interface - #9802
NETBEANS-9798 Fix PullUp/Move refactoring when a not initialized field is moved to an interface#9802jherkel wants to merge 1 commit into
Conversation
mbien
left a comment
There was a problem hiding this comment.
please mention in the commit msg and PR header what refactoring this is about since this becomes the title in the release notes.
e.g "Fix PullUp/Move refactoring when (...)"
thanks for working on this fix!
…d is moved to an interface
afaed07 to
34bab3f
Compare
| ERR_CannotPullupDuplicateMembers=Cannot pull up two members with the same signature. | ||
| ERR_PullupNonPublicToInterface=Member "{0}" is being moved to interface, but is not public. | ||
| ERR_PullupStaticToInterface=Member "{0}" cannot be pulled up to interface, it is static. | ||
| ERR_PullupNonNotInitializedToInterface=Member "{0}" cannot be pulled up to interface, it is not initialized. |
There was a problem hiding this comment.
IMO, this buries the lede here. Yes, the resulting syntax error is that the pulled-up field is not initialized, but that's because the refactoring has moved a non-static member field into an interface, which makes it implicitly public static final.
Making the moved field static is a much more significant change. If the proposal is to block the refactor operation then this (non-final non-static to static final) is the more important reason to surface. Suggesting to add an initializer avoids the syntax error but the developer may miss the larger semantic difference it creates.
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
LLMs, Commit messages and PR description:
git log) that all commits have a valid name and email address for you in the Author field.Assisted-by: MODEL_NAME MODEL_VERSIONline appended to the commit message.Assisted-byline from above)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.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)