Bug 21275 - Truncated import statements [code manipulation]
Summary: Truncated import statements [code manipulation]
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2002-07-05 18:34 EDT by Peter Burka CLA
Modified: 2002-11-14 08:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-07-05 18:34:16 EDT
2.0

Occasionally (2 or three times a week), Eclipse fails to insert a full import 
statement for a class which I've imported via contents assist.

It inserts the 'import' keyword, and part of the class name.

Here's an example:

import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widg

My import block was missing two imports:

import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
Comment 1 Peter Burka CLA 2002-07-09 14:05:58 EDT
I think that this happens most frequently when I'm using content assist to 
generate anonymous inner classes.
Comment 2 Dirk Baeumer CLA 2002-07-29 10:32:06 EDT
Peter, can you provide a reproducable case (I know ....) ?

Martin, please investigate if some comes to your mind that explains this 
behaviour. 
Comment 3 Peter Burka CLA 2002-07-29 10:56:31 EDT
When I do encounter the problem, it does seem to be repeatable. That is, if I 
undo a few steps and then repeat the insertion of the inner class, I get 
exactly the same truncated import statements. Unfortunately I haven't been 
able to come up with a simple repeatable test case which doesn't involve my 
whole workspace.
Comment 4 Peter Burka CLA 2002-07-31 17:36:20 EDT
Just happened again - here's some more information:

The problem occurs when I type something like

new IFCBResourceRefreshListener[Ctrl+Space]([Ctrl+Space]

It's important that I trigger the two code assists quickly, and that there be 
no code assist options to pick from (that is, only one suggestion, so no list 
appears).

If I do it slowly, the error doesn't occur.

It might also be relevant that IFCBResourceRefreshListener is inserted as the 
second last import, but I don't think so.

If I start undoing and redoing, I can see that the following series of 
undoable actions occurred:

1) the import was correctly added in the right place
2) the inner class declaration was added
3) the imports were truncated
Comment 5 Martin Aeschlimann CLA 2002-10-30 10:16:04 EST
fixed > 20021030
Comment 6 Dirk Baeumer CLA 2002-11-14 08:37:20 EST
Seems to be related to bug 26069 which is verified.