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 157144 - Fix Imports Mangles Existing Import Statements
Summary: Fix Imports Mangles Existing Import Statements
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2009-01-20 15:47 UTC by tomwheeler
Modified: 2011-06-21 21:57 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 tomwheeler 2009-01-20 15:47:23 UTC
I have encountered this a few times within the past few weeks.  I will be working on an existing Java class which has
several import statements and will add a reference to another class for the first time.  When I press Ctrl+Shift+I (fix
imports), many of my existing import statements are corrupted.  

For example, here is what it might look like before:

import com.example.mypackage.MyClassOne;
import com.example.mypackage.MyClassTwo;
import com.example.mypackage.MyClassThree;
import com.example.another.package.Foo;
import com.example.another.package.Bar;

Here is what it would look like afterwards:

impoimport com.example.mypackage.MyClassOne;
imimport com.example.mypackage.MyClassTwo;
import com.example.mypackage.MyClassThree;
import c com.example.another.package.Foo;
import com.example.another.package.BarBar;

It does not happen consistently so I can't say exactly what causes it sometimes but not others.  But it does happen
fairly often (every 2-3 days or so).

Here is the configuration I have noticed it under; I am using the Java SE IDE and have installed all updates available
through the AUC:

Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\tq232c\.netbeans\6.5
Comment 1 Jan Lahoda 2009-01-29 11:46:43 UTC
The source was probably not reparsed correctly after a modification, and so the offsets in the tree do not match the
updated source.
Comment 2 Jan Jancura 2009-02-11 09:53:34 UTC
Sorry, but I am not able to reproduce it at all.
Comment 3 tomwheeler 2011-06-21 21:57:09 UTC
I have not seen this behavior in a couple of years now, so whatever caused it must either be fixed or very well hidden by now.