Refactor record to class and vice versa #7762
Labels
hints
Java
[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
kind:feature
A feature request
Description
NetBeans should assist in changing records to classes and classes to records.
It already provides a hint to convert some classes to an interface, for example an empty class like
can be converted to
with two clicks.
A record like
should be converted to something like
and a class
to
Unfortunately classes and records have different naming conventions for getters, but that can be addressed in further refactoring steps.
Use case/motivation
Sometimes I start with a class or a record and later the other type seems to be more appropriate, but it is tedious to do the conversion by hand.
Related issues
Currently the refactoring action „Move inner to outer level“ converts records to classes, but I don’t think it should do that and it’s broken anyway (#7044, #6139).
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: