This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[Build 200406021800] Rename does not work in Form's guarded block, but it proceeds elsewhere. This creates non compilable code. Output window correctly marks lines in quarded block with red error message, but I will still expect that Refactoring works inside guarded blocks.
It is as designed. Were are unable to peform refactoring in guarded blocks, because they are regenerated from .form files, which are out of our control. I'm changing type of this issue to FEATURE.
I expect that guarded blocks are there for user typing modifications and that you could modify this in cooperation with Form Editor. It looks like a design flaw in refactoring and editor together if refactoring cannot change guarded blocks for user.
The guarded block *can* be changed by the refactoring. But even if it would change it, the text would be regenerated (i.e. the changes would be reverted) by the form editor as soon as the file would be open in it since the real data are not in Java files. Changing guarded blocks is actually much easier for us than detecting that they are there and forbidding the change. But we had to choose the second option since right now we are not finding usages in non-java files. This feature is planned for the next release. So, to sum up, guarded blocks usually signal that the data contained in them are generated from the other source (which is unknown to the refactoring module), thus changing the text in the guarded block is of no help since the guarded block can be regenerated from the real source anytime by its parent module.
I know this. I just would expect that Refactoring can ask *that* module to perform rename in its real source. Ok, it is probably complicated for version 1.
This should be addressed in 4.1.
*** Issue 51855 has been marked as a duplicate of this issue. ***
Issue 49294 is fixed. Reassigning to Form module.
*** This issue has been marked as a duplicate of 48288 ***