homberghp commented on issue #7762:
URL: https://github.com/apache/netbeans/issues/7762#issuecomment-2624147213

   I will try my hand on this one. Functionally it seems simple enough, based 
on what I learned from issue #7043 and issue #7044.
   
   ## on the choices to make.
   
   The first version will be very basic. Froe **class to record** will only 
accept a class with final fields. 
   It will leave any method intact because code based reasoning on the 
implementations of `toString()`, `hashCode()`, and `equals(Object other) ` is 
too much effort for this little feature. Testing whether a given implementation 
of said methods deviates from the automatic in record is brittle at best, so 
best avoid it. If the user wants the records default, he can simply delete his 
own after the transformation.
   
   The implementation will simply rewrite the AST to be a record and then save 
that.
   
   Something similar will apply for **record to class** any given methods will 
be taken over to the record. Any missing methods (`hashCode()`, `equals(Object 
other)`, `toString()`) can easily be generated with the already available code 
generators in Netbeans, so I will not duplicate that here.
   The hard/new part for me will be the proper integration into the menus.
   
   I will create a branch issue7762 on my fork and create a PR when I am ready 
for preview.
   
   


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