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 119176

Summary: [60cat] Wrong placement of import statements by editor hint
Product: java Reporter: tboerkel <tboerkel>
Component: SourceAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: blocker CC: msauer
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description tboerkel 2007-10-17 07:46:12 UTC
[ BUILD # : 200710071200 ]
[ JDK VERSION : 1.6.0_03 ]

Repro:
Create a new Java class. Add this method:
  public static void test() {
    FileInputStream fis = new FileInputStream(new File("."));
  }  

Use the editor hint to import java.io.File and then again to import
java.io.FileInputStream.

Result:

import java.io.File;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.FileInputStream;

/**
 *
 * @author TB
 */
public class Test {
  public static void test() {
    FileInputStream fis = new FileInputStream(new File("."));
  }  
}


The 2 imports should be in subsequent lines, but one is above and the
other below the comment.
Comment 1 Jiri Prox 2007-10-17 08:33:57 UTC
This happens only for classes in default package and only the first import is misplaced -> not so serious
Comment 2 Rastislav Komara 2009-02-03 10:56:44 UTC
Overtake.
Comment 3 Jiri Prox 2009-05-04 14:15:52 UTC
*** Issue 164308 has been marked as a duplicate of this issue. ***
Comment 4 Jan Lahoda 2009-08-20 10:00:12 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 5 Martin Balin 2016-07-07 07:19:15 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss