mbien commented on code in PR #8391: URL: https://github.com/apache/netbeans/pull/8391#discussion_r2027019505
########## platform/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/children/ChildrenCache.java: ########## @@ -26,8 +26,8 @@ import java.util.Set; public interface ChildrenCache { - Integer ADDED_CHILD = new Integer(0); - Integer REMOVED_CHILD = new Integer(1); + Integer ADDED_CHILD = 0; + Integer REMOVED_CHILD = 1; Review Comment: switched all usages which compared with `==` to `equals` usages in `FolderObj` and `ChildrenSupportTest` ########## platform/openide.dialogs/src/org/openide/NotifyDescriptor.java: ########## @@ -134,19 +134,19 @@ public class NotifyDescriptor extends Object { // /** Return value if YES is chosen. */ - public static final Object YES_OPTION = new Integer(JOptionPane.YES_OPTION); + public static final Object YES_OPTION = JOptionPane.YES_OPTION; /** Return value if NO is chosen. */ - public static final Object NO_OPTION = new Integer(JOptionPane.NO_OPTION); + public static final Object NO_OPTION = JOptionPane.NO_OPTION; /** Return value if CANCEL is chosen. */ - public static final Object CANCEL_OPTION = new Integer(JOptionPane.CANCEL_OPTION); + public static final Object CANCEL_OPTION = JOptionPane.CANCEL_OPTION; /** Return value if OK is chosen. */ - public static final Object OK_OPTION = new Integer(JOptionPane.OK_OPTION); + public static final Object OK_OPTION = JOptionPane.OK_OPTION; /** Return value if user closes the window without pressing any button. */ - public static final Object CLOSED_OPTION = new Integer(JOptionPane.CLOSED_OPTION); + public static final Object CLOSED_OPTION = JOptionPane.CLOSED_OPTION; Review Comment: i think this _should_ be ok unless someone relied on the fact that `YES_OPTION` != `OK_OPTION` object identity wise (it is the same int value). Considered making everything `new Object` but this would cause problems if someone would compare the values. `BigInteger` would work but is probably not needed. -- 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: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists