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 192882 - Fix imports do not fix invalid imports on first usage.
Summary: Fix imports do not fix invalid imports on first usage.
Status: RESOLVED DUPLICATE of bug 192371
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-05 05:30 UTC by Chiana
Modified: 2011-11-16 16:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2010-12-05 05:30:12 UTC
Product Version = NetBeans IDE Dev (Build 201012040001)
Operating System = Windows Vista version 6.0 running on x86
Java; VM; Vendor = 1.6.0_22
Runtime = Java HotSpot(TM) Client VM 17.1-b03

The fix import function do not remove invalid imports the first time used, for example this class;
 - - -
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ent.ServRadStructs;

import reciete.recieteLine;

/**
 * Structure for time-charge should contain an article of type service
 * @author Kent
 */
public class TimTid
        extends BaseFields {

  recieteLine art;
  @Override
  public String toString() {
    throw new UnsupportedOperationException("Not supported yet.");
  }
}
 - - -
I had the class "recieteLine" moved to an other package using "refactor->rename" but due to issue #192863 the refactoring process made some "leftover" to
be fixed by hand, if you press ctl-shi-I to fix the imports the class will look like
 - - -
*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ent.ServRadStructs;

import ent.structs.recieteLine;
import reciete.recieteLine;

/**
 * Structure for time-charge should contain an article of type service
 * @author Kent
 */
public class TimTid
        extends BaseFields {

  recieteLine art;
  @Override
  public String toString() {
    throw new UnsupportedOperationException("Not supported yet.");
  }
}
 - - -
As you can see it has not removed the second (and invalid) import line, it is however marked as an error.
I've also seen this behaviour long before #192863 showed up.

Workaround: press ctl-shi-I one more time.
Comment 1 Jan Lahoda 2010-12-06 13:13:47 UTC

*** This bug has been marked as a duplicate of bug 192371 ***