mbien commented on PR #8407:
URL: https://github.com/apache/netbeans/pull/8407#issuecomment-3261408287

   not sure what to do here, Changing a value is also something to consider. 
This may break applications which compare it with equals.
   
   ```java
       /** Return value if YES is chosen. */
       public static final Object YES_OPTION = JOptionPane.YES_OPTION;
   
       /** Return value if NO is chosen. */
       public static final Object NO_OPTION = JOptionPane.NO_OPTION;
   
       /** Return value if CANCEL is chosen. */
       public static final Object CANCEL_OPTION = JOptionPane.CANCEL_OPTION;
   
       /** Return value if OK is chosen. */
       public static final Object OK_OPTION = 3; // was new 
Integer(JOptionPane.OK_OPTION) but must be distinct from YES_OPTION
   
       /** Return value if user closes the window without pressing any button. 
*/
       public static final Object CLOSED_OPTION = JOptionPane.CLOSED_OPTION;
   ```
   It has similar issues to using an `Enum` or `new Object()`, but would allow 
Integer casts.
   
   If we want to `assertEquals(YES_OPTION, OK_OPTION)` while both having 
distinct identity for `==` to not break (`NbPresenter` and possibly apps), we 
have to go the `ReturnValue` with custom `equals` etc.


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