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 242240

Summary: import package declarations get broken after refactor moving classes between different projects
Product: java Reporter: andrzejo
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED DUPLICATE    
Severity: normal CC: markiewb, zolive
Priority: P2    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description andrzejo 2014-02-23 08:12:57 UTC
Product Version = NetBeans IDE 8.0 Beta (Build 201401141042)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_13
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01


When moving class files between different  projects I get the package import declarations header brokes as below:

import pl.com.bpmc.dixi.manager.core.ManagerActionFactory;
import pl.com.bpmc.util.gguiframeworkGuiAction;
import pl.cobpmcta.utilguiframeworkt.GuiAppWindow;
import pl.bpmcatta.utguiframeworkent.GuiDataField;
import pbpmc.katta.guiframeworklient.GuiSearchPanel;
importbpmcom.kattguiframeworkiclient.GuiSearchPanelToolbar;
impobpmc.com.kaguiframeworkguiclient.GuiSessionConfig;
imbpmcpl.com.guiframeworkl.guiclient.GuiToolbox;

the new and previous package names get somehow "mixed" - need manually fix in all corrupted files
Comment 1 andrzejo 2014-02-23 08:13:06 UTC
Created attachment 145506 [details]
IDE log
Comment 2 zolive 2014-03-05 10:07:27 UTC
I've the same trouble whith my installation on Linux(Ubuntu) or Windows 7 and Netbeans 7.4

I also see the same behavior with last version of eclipse. Netbeans and Eclipse may use the same corrupted librairy to do refactor.
Comment 3 zolive 2014-03-05 11:02:39 UTC
Whatever the refactor (add constructor or move file...)  action import are duplicated and mixed 
================
before refactoring:
================
package com.orange.spnp.dao;

import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import com.orange.spnp.exception.SPnpException;
import com.orange.spnp.model.Data;
import com.orange.spnp.model.SpnpStatus;
import java.io.File;
import java.sql.ResultSet;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import lombok.extern.log4j.Log4j2;
import org.junit.Assert;
import org.junit.Test;

@Log4j2

public class TraceDaoTest extends DaoTest {
....

================
after refactoring: 
================
package com.orange.spnp.dao;

import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import com.orange.spnp.exception.SPnpException;
import com.orange.spnp.model.Data;
import com.orange.spnp.model.SpnpStatus;
import java.io.File;
import java.sql.ResultSet;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import lombok.extern.log4j.Log4j2;
import org.junit.Assert;
import org.junit.Test;

@Log4j2

public class TraceDaoTest extends DaoTestpackage com.orange.spnp.dao;

import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import com.orange.spnp.exception.SPnpException;
import com.orange.spnp.model.Data;
import com.orange.spnp.model.SpnpStatus;
import java.io.File;
import java.sql.ResultSet;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import lombok.extern.log4j.Log4j2;
import org.junit.Assert;
import org.junit.Test;

    public TraceDaoTest() {
...
Comment 4 Ralph Ruijs 2014-03-05 11:26:10 UTC
@zolive, Do you have a small test project, with steps to reproduce?
Comment 5 Ralph Ruijs 2014-03-22 09:55:48 UTC

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