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.

Bug 173943 - Unable to refactor a JavaFX class
Summary: Unable to refactor a JavaFX class
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks: 173077
  Show dependency tree
 
Reported: 2009-10-07 10:06 UTC by Alexandr Scherbatiy
Modified: 2009-10-28 10:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
JavaFX project (8.83 KB, application/octet-stream)
2009-10-07 10:26 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-10-07 10:06:22 UTC
Product Version         = NetBeans IDE Dev (Build 200910061401) (#941078cbc4d4)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun Microsystems Inc.


Steps to reproduce:

- Create a JavaFX project with the Main file
- Create 'A' JavaFX class
- Right-click the 'A' class in the project tree and select Refactor->Rename
  The Rename dialog appears with message 'Cannot refactor library class "javafxapplication.A"'
Comment 1 J Bachorik 2009-10-07 10:17:09 UTC
Could you, plz, attach a project exhibiting this problem? I've followed your instructions but was not able to reproduce it.
Comment 2 Alexandr Scherbatiy 2009-10-07 10:26:45 UTC
Created attachment 88984 [details]
JavaFX project
Comment 3 Alexandr Scherbatiy 2009-10-07 10:31:47 UTC
I have attached the JavaFX project.

What I see is:

1. I opened the attached project and renamed the JavaFX class. It works.
2. I deleted the NB userdir and started the IDE.
 I am able to rename a JavaFX class.

3. I crated a JavaFX project and tried renaming the Stage class from the Main file.
  It said that "cannot refactor library class"
  I tried it with the Stage declaration and the stage importing:
--------------------------------------- 
import javafx.stage.Stage;
Stage {
}
--------------------------------------- 

Than I created 'A' JavaFX class. Now I am not able to refactor the 'A' class because it says 
'Cannot refactor library class "javafxapplication.A"'
Comment 4 Alexandr Scherbatiy 2009-10-08 10:38:51 UTC
One more case:

- Copy the code to the editor:
---------------------------------------------------
import javafx.scene.*;

 class MyCustomNode extends CustomNode {
    public override function create(): Node {
        Group { };
    }
}

Scene{
    content: MyCustomNode{}
}
---------------------------------------------------

- Refactor->Rename the MyCustomNode class to MyCustomNode2
- Refactor->Rename the MyCustomNode2 class to MyCustomNode3

The Rename dialog appears with message 'Cannot refactor library class "javafxapplication.Main.MyCustomNode2"'
Comment 5 J Bachorik 2009-10-12 10:11:51 UTC
I am still not able to reproduce it reliably. I get the message in 1 case out of cca. 20 - mostly when there is
background scanning active. However, when I close the dialog and retry the action everything works fine.

SourceForBinaryQuery is used to determine whether a certain element is eligible for refactoring or not. It seems that
the result of the query depends on the background scanning state. If we are able to come up with a 100% reproducible
test case we should probably file an issue on Parsing API. Until then, I am lowering the priority as it doesn't seem to
occur frequently and the workaround seems to be quite easy - just try the action again after few seconds.
Comment 6 J Bachorik 2009-10-14 09:37:14 UTC
This seems to be fixed as a side effect of changes in http://hg.netbeans.org/javafx/rev/83520bd3960f
Comment 7 Alexandr Scherbatiy 2009-10-28 10:42:50 UTC
It seems that the issue is not reproduced in Build 200910271401