mflydahl opened a new issue, #6989:
URL: https://github.com/apache/netbeans/issues/6989

   ### Apache NetBeans version
   
   Apache NetBeans 20
   
   ### What happened
   
   When opening a project in the designer with generated code from an old 
NetBeans-version, the designer will automatically change path to enums with the 
actual plain text value from the enum. This means that future updates in the 
enum will not be likewise updated in the swing component. 
   
   I've seen this behavior in setText() and setToolTipText(). See reproduction 
details.
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   1. Open class, which contains the following generated code (or equivalent):
   `avtaleKnapp.setText(ProgramEnum.AVTALEVEDL.getDescription());
    avtaleKnapp.setToolTipText(ProgramEnum.AVTALEVEDL.getTooltip());
    `
    
    2. Save the class again, and the enum reference has been replaced with the 
string value from the enum:
    `
   avtaleKnapp.setText("Agreement");
   avtaleKnapp.setToolTipText("Agreement");
   `
   
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 16 or earlier
   
   ### Operating System
   
   Ubuntu 20.04
   
   ### JDK
   
   11
   
   ### Apache NetBeans packaging
   
   Apache NetBeans Snap Package
   
   ### Anything else
   
   Probably everytime, but I have not been able to try more than once. This 
happened when opening an old project in the designer to remove deprecations. 
Didn't notice that the enum references had been replaced with the plain text 
value until I created a pull request.
   
   ### Are you willing to submit a pull request?
   
   No


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