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 133107 - [Rename] incorrect import-statement after renaming a package
Summary: [Rename] incorrect import-statement after renaming a package
Status: RESOLVED DUPLICATE of bug 128830
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-17 14:07 UTC by hurby
Modified: 2008-04-21 09:27 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 hurby 2008-04-17 14:07:01 UTC
after renaming a package, the sourcecode contains a import-statment with the old packagename...
the error occurs only sometimes
Comment 1 Jiri Prox 2008-04-17 14:20:29 UTC
Can you provide build number you're using and fragment of code, please? 

Comment 2 hurby 2008-04-17 14:37:35 UTC
no problem, here some infos about versions:

Product Version: NetBeans IDE 6.0.1 (Build 200801291616)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06
System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)

and here the sourcecode (after renaming -> includes the wrong statement yet in line 5):

package de.cbg.streams;

//@author MH

import de.cbg.datenströme.*;
import java.io.File;

public class DateiBeobachter implements Runnable {
    String filename;
    File file;
    Runnable info;
    
    DateiBeobachter(String Filename, Runnable r){
        this.filename = Filename;
        file = new File(Filename);
        info = r;
    }
    
    DateiBeobachter(File mFile, Runnable r){
        this.file = mFile;
        info = r;
    }
    
    @Override public void run(){
        long last = file.lastModified();
        
        while(true){
            if(last < file.lastModified()){
                info.run();
                last = file.lastModified();
            }else
                System.out.println(file.getName());
            
            try{
                Thread.sleep(1000);
            }
            catch(InterruptedException e){}
        }
    }
    
    public static void main(String[] args) {
        Thread db = new Thread(new DateiBeobachter("c:/test.txt", new InfoMe()));
        db.start();
    }
}

class InfoMe implements Runnable{
    @Override public void run(){
        System.out.println("Datei geändert");
    }
}
Comment 3 Jiri Prox 2008-04-21 09:27:47 UTC
Thanks for info, it's duplicate of issue 128830, which should be already fixed in the upcoming version

*** This issue has been marked as a duplicate of 128830 ***