Apache NetBeans version
Apache NetBeans 29
What happened
Steps to Reproduce:
In a runModificationTask, create a ClassTree using make.Class where the ModifiersTree contains the RECORD flag (bit 61) or parse a record string using TreeUtilities.parseTypeDecls.
Verify tree.getKind() returns Tree.Kind.RECORD.
Verify tree.toString() incorrectly renders the keyword as class.
Commit the change using wc.rewrite(oldParent, updatedParent).
Result: The record is written to the source file as a class, losing its record semantics and converting components to fields.
Expected: The keyword record should be used if getKind() == RECORD.
Language / Project Type / NetBeans Component
Java Maven Project
How to reproduce
In a runModificationTask, create a ClassTree using make.Class where the ModifiersTree contains the RECORD flag (bit 61) or parse a record string using TreeUtilities.parseTypeDecls.
Verify tree.getKind() returns Tree.Kind.RECORD.
Verify tree.toString() incorrectly renders the keyword as class.
Commit the change using wc.rewrite(oldParent, updatedParent).
Did this work correctly in an earlier version?
No / Don't know
Operating System
ubuntu
JDK
25
Apache NetBeans packaging
Community provided installer
Anything else
No response
Are you willing to submit a pull request?
No
Apache NetBeans version
Apache NetBeans 29
What happened
Steps to Reproduce:
In a runModificationTask, create a ClassTree using make.Class where the ModifiersTree contains the RECORD flag (bit 61) or parse a record string using TreeUtilities.parseTypeDecls.
Verify tree.getKind() returns Tree.Kind.RECORD.
Verify tree.toString() incorrectly renders the keyword as class.
Commit the change using wc.rewrite(oldParent, updatedParent).
Result: The record is written to the source file as a class, losing its record semantics and converting components to fields.
Expected: The keyword record should be used if getKind() == RECORD.
Language / Project Type / NetBeans Component
Java Maven Project
How to reproduce
In a runModificationTask, create a ClassTree using make.Class where the ModifiersTree contains the RECORD flag (bit 61) or parse a record string using TreeUtilities.parseTypeDecls.
Verify tree.getKind() returns Tree.Kind.RECORD.
Verify tree.toString() incorrectly renders the keyword as class.
Commit the change using wc.rewrite(oldParent, updatedParent).
Did this work correctly in an earlier version?
No / Don't know
Operating System
ubuntu
JDK
25
Apache NetBeans packaging
Community provided installer
Anything else
No response
Are you willing to submit a pull request?
No