wrprice commented on code in PR #9802:
URL: https://github.com/apache/netbeans/pull/9802#discussion_r4575031628


##########
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/Bundle.properties:
##########
@@ -79,6 +79,7 @@ ERR_PullUp_MemberAlreadyExists=Member "{0}" already exists in 
the target type.
 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.

Review 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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to