Bug 4973 - Rename package removes first letter of import statements
Summary: Rename package removes first letter of import statements
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-15 05:05 EDT by Martin Aeschlimann CLA
Modified: 2002-01-11 09:08 EST (History)
0 users

See Also:


Attachments
test case (19.10 KB, text/plain)
2001-10-15 08:40 EDT, Adam Kiezun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2001-10-15 05:05:02 EDT
203
1. Rename org.eclipse.jdt.internal.ui.wizards.dialogfields to
   org.eclipse.jdt.internal.ui.wizards.dialogfields1
2. Look at ListDialogField.java
   Half of the imports are corrupted. (i missing)

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.jdt.internal.ui.wizards.dialogfields1;


import java.util.ArrayList;
mport java.util.Iterator;
mport java.util.List;
import org.eclipse.swt.SWT;
mport org.eclipse.swt.events.SelectionEvent;
mport org.eclipse.swt.events.SelectionListener;
mport org.eclipse.swt.graphics.Image;
mport org.eclipse.swt.widgets.Button;
mport org.eclipse.swt.widgets.Composite;
mport org.eclipse.swt.widgets.Control;
mport org.eclipse.swt.widgets.Display;
...
Comment 1 Adam Kiezun CLA 2001-10-15 08:40:26 EDT
Created attachment 5 [details]
test case
Comment 2 Adam Kiezun CLA 2001-10-15 08:41:56 EDT
reproduced - it has sth to do with line delimiters.
see the attached file - line delims are unusual.
refactoring forwards the call to IPackageFragment::rename

moving to jcore.
Comment 3 Olivier Thomann CLA 2001-10-23 16:28:23 EDT
I wonder why this file contains \r\n and \r line delimiters. The problem seems 
to come from the normalizeCRs in the Buffer class. I'll investigate more as 
soon as I can debug again.
Is it normal that a file contains two different line delimiters?
Comment 4 Olivier Thomann CLA 2001-10-23 18:07:37 EDT
I found the problem. It was located in the normalizeCRs(char[]) in the Buffer 
class. When we got '\r' even if the next character was not '\n', we increment 
the lineStart by two. This is why we missed the 'i' character at the beginning 
of the import statements.
Fixed and released in HEAD. All tests are green.
Comment 5 Martin Aeschlimann CLA 2001-10-24 03:41:40 EDT
Files are allowed to have more than one kind of line delimiter. This is 
handeled correctly by the editor. Anyhow,  all our operations try to not 
introduce new line delimiters.