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 184432 - Broken import lines
Summary: Broken import lines
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-19 10:42 UTC by Alexandr Scherbatiy
Modified: 2010-05-18 09:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (41.50 KB, application/octet-stream)
2010-04-23 10:21 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2010-04-19 10:42:16 UTC
NB 6.9 Beta

  Product Version         = NetBeans IDE 6.9 Beta (Build 201004182356) (#af87cb4b7e48)
  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.



I see this issue from time to time but do not have exact steps to reproduce it.

After the 'Fix Imports' action the imports looks like:
----------------------------------------------
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
i
import javafx.scene.text.Font;
import javafx.scene.text.Text;mport javafx.scene.text.Text;
----------------------------------------------

It seems that Font and Text imports are inserted instead of the Text one.
Comment 1 J Bachorik 2010-04-20 08:04:34 UTC
Do you have a sample source code where this happens?
From the symptoms it would seem as a race condition somewhere but can't tell for sure till I have something to debug the problem :(
Comment 2 Alexandr Scherbatiy 2010-04-20 08:12:42 UTC
The code was like bellow:
---------------------------------------------
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.scene.text.Font;

class MyNode extends CustomNode {

    public override function create(): Node {
        Group {
            content: [
                Rectangle{
                    fill: Color.GREEN
                }
                Text{
                    font: Font{ size: 20 }
                }
            ]
        }
    }
}
---------------------------------------------


Where I changed the 'Group' to 'Stack' in the create() function 
and invoked Fix Imports.
Comment 3 J Bachorik 2010-04-20 08:47:08 UTC
I am not able to reproduce it :( Next time you see this problem could you attach the IDE messages.log file as well? I might be able to get some indices from those (hopefully). 
Till then I would lower the priority to P3 since the issue is highly random with the tendency not to happen.
Comment 4 Alexandr Scherbatiy 2010-04-23 10:20:09 UTC
Steps to reproduce.

 - Check that the issue 184799 is not fixed

- Create a JavaFX file
- Create aaa.bbb pakage
- Create A class under the package
---------------  A.fx -----------------
package aaa.bbb;

public class A {}

public class B{}
-----------------------------------

- Copy the code to the Main file
-----------------------------------
package javafxapplication1;

var a= A{};
var b = B{};
-----------------------------------

- Invoke Fix Imports several times

The line 'import aaa.bbb.A.B;' is added, removed, added, removed and then broken:

-----------------------------------
package javafxapplication1;
i
import aaa.bbb.A.B;mport aaa.bbb.A;

var a= A{};
var b = B{};
-----------------------------------
Comment 5 Alexandr Scherbatiy 2010-04-23 10:21:01 UTC
Created attachment 97906 [details]
IDE log file
Comment 6 J Bachorik 2010-04-23 11:58:27 UTC
hopefuly fixed by http://hg.netbeans.org/javafx/rev/2a7beebf951d
Comment 7 Alexandr Scherbatiy 2010-05-18 09:59:31 UTC
unable to reproduce in build netbeans-trunk-nightly-201005170932-javafx-windows.exe