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.
Product Version = NetBeans IDE Dev (Build 201402120001) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.8.0 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b69 Struggling with Make controller which often appears to do nothing when it should be inserting methods or fields. (Already reported as Bug 240037) To work around that I sometimes find that modifying the controller class will cause Make Controller to work the next time it is invoked. In this case I expected two event handler methods to be added to the controller, but they would not be inserted. I saw that the controller class was being saved though, every time I invoked Make Controller. So I manually added one of the methods, saved the file, and tried again. This time Make controller *removed* my method! I was adding On Key Typed event handlers for ListViews in Scene builder 2.0 I added one method to my controller class manually: @FXML private void assetListKeyTyped(KeyEvent event) { } Invoked Make Controller and the method was removed!
I haven't been able to get Make Controller to delete methods I've entered by hand. But it does _consistently_ remove the @FXML annotation I had on them. My environment: Product Version: NetBeans IDE Dev (Build 201402120001) Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b69 Runtime: Java(TM) SE Runtime Environment 1.8.0-b129 System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)
Changing component to Editor which is the correct one for "Make Controller".
I have reproduced this in another class. It seems Make Controller will remove things annotated with @FXML in cases where Bug 240037 applies. It seems like NB is using an old version of the FXML file and is trying to sync the controller to it.
Correction: I HAVE been able to get Make Controller to delete methods I've entered by hand. Therefore UPGRADING to Priority 2 as per your email. So far it's been limited to the LAST method in the FXMLDocumentController, but there may be other cases. As documented before, it _consistently_ removes all of the @FXML annotation I had manually placed on other methods.
Can we get this whiteboarded for PATCH1. IT DELETES YOUR CODE!
*** Bug 240037 has been marked as a duplicate of this bug. ***
As for method deletion: a method is cleaned up from the source, if and only if: * it is annotated by @FXML * it is NOT referenced from the fxml file * it is NOT used (search usages query is executed) * it IS private (otherwise usage search could take ages) Such methods, are either removed, provided that their body is empty (ignoring comments), OR their just @FXML annotation is removed. So in end only unused stubs should be removed. Once you add a real code to your method, it will be preserved -> no real user code loss should happen.
correction: @FXML is removed from all symbols not referenced from the fxml file; the stricter rules only apply for actual deletion of the method. Sorry for not being precise.
(In reply to Lou Dasaro from comment #4) > Correction: I HAVE been able to get Make Controller to delete methods I've > entered by hand. Therefore UPGRADING to Priority 2 as per your email. So far > it's been limited to the LAST method in the FXMLDocumentController, but > there may be other cases. As documented before, it _consistently_ removes > all of the @FXML annotation I had manually placed on other methods. Please can you confirm that the IDE deletes your method with non-empty body ?
Fixed in jet-main#32249f0a276f
oops, mistakenly closed wrong issue, sorry.
@Svata, should I test it this weekend? Or am I waiting for a fix to propagate?
Sorry I made a mistake - the fix mentioned in comment #10 actually applies to defect #242114 (the mistake was noted in comment #11). Sorry for the confusion. As far as _this_ issue is concerned does it really delete non-empty user methods ?
Integrated into 'main-silver', will be available in build *201411300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/32249f0a276f User: Svata Dedic <sdedic@netbeans.org> Log: #241839: fx:include is processed for fx:id field binding