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 150359 - Fix imports changes imports order
Summary: Fix imports changes imports order
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks: 158720
  Show dependency tree
 
Reported: 2008-10-16 11:19 UTC by Alexandr Scherbatiy
Modified: 2009-04-28 13:25 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2008-10-16 11:19:10 UTC
JavaFX_NB_Plugin_NB65_daily: #309 2008-10-16_02-01-26.zip

  Product Version         = NetBeans IDE Dev (Build 200810150101)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11; Sun Microsystems Inc.

Steps to reproduce:

- Copy the code to the editor
---------------------------------------
import javafx.scene.Node;
import javafx.scene.Group;
import javafx.scene.CustomNode;


class MyNode extends CustomNode{
    public override function create ():Node {
        return Group{
        }
    }
}

---------------------------------------

- Fix imports
  The order of imports is reverted
--------------------------------------------------
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;


class MyNode extends CustomNode{
    public override function create ():Node {
        return Group{
        }
    }
}
--------------------------------------------------
Comment 1 Rastislav Komara 2008-10-16 15:55:59 UTC
There is no defined order of imports. Imports are always ordered by alphabet order of FQCN. Different behavior should by
implemented in next version.
Comment 2 Alexandr Scherbatiy 2008-10-17 10:14:25 UTC
It changes user's order of imports.
New imports are added at the end of existed in Java editor.

Just check:
-------------------  Main.java  --------------------------------------
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JButton;

public class Main {
    public static void main(String[] args) {
        // TODO code application logic here
        JTable table = null;
        JButton button  = null;
        JLabel label = null;

        JList list;

    }

}

---------------------------------------------------------

- Fix imports
Comment 3 kolotyluk 2008-12-10 21:55:33 UTC
I've also noticed that because I have 

import java.util.ArrayList;
import java.util.Map;

in my code, these imports often get deleted when I "fix" other imports,
forcing me to again "fix imports" for these two over and over again.
Comment 4 Rastislav Komara 2009-03-02 10:18:28 UTC
reassigning to new owner.
Comment 5 J Bachorik 2009-04-07 14:48:57 UTC
it should be fixed in http://hg.netbeans.org/javafx/rev/43957e2c6f7a
Comment 6 Alexandr Scherbatiy 2009-04-22 13:37:06 UTC
verified in   marina-netbeans-plugin: #92
JavaFX NetBeans Plugin with promoted SDK build b05 
Comment 7 Alexandr Scherbatiy 2009-04-28 13:25:36 UTC
verified in marina-netbeans-plugin ยป #113