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

   > What is the likelihood of someone needing to differentiate those two 
return values from a single dialog? There is a way to have both in one dialog, 
but not specified in the API as far as I can tell? Nor does the API state which 
values are unique?
   > This solution seems overly complex for an issue that seems hypothetical. 
Have you an example of actual usage that demonstrates where just using the 
integers will fail?
   
   thinking about hypothetical apps was too big of an unknown for me given how 
much usage this API has (I did also grep the usage within NB). What if someone 
puts those things into a `Set`, calls `contains()`? I don't know.
   
   I approached this completely differently: I tried to update it in a way to 
not break API, NB, and the tests. Then I wrote an extra test purely from the 
object identity perspective and made it pass before and after this change. From 
a API perspective this has the highest compatibility I could come up with, 
unless someone takes impl details for granted, e.g that the `Object` is an 
`Integer` as previously mentioned.
   
   `ReturnValue` is the only key I could come up with where everything was 
green.
   
   I tried: `new Object()` or enum, `Integer.valueOf()`, and `YES=OK`, possibly 
other versions in https://github.com/apache/netbeans/pull/8391. I intentionally 
did not go around and rewrite NB code since this would indicate that there is a 
certain chance that an app would break too.
   
   > This solution seems overly complex ...
   
   I would take the internal complexity hit of a record as key if it reduces 
the risk of obscure failures at application runtime.
   
   
   
   >>    As if this would be so simple.
   >
   >Well, probably!
   
   I am going to close this so that someone else can take this over, ideally 
before the build fails due to JDK api removal.


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

Reply via email to