Bug 242240 - import package declarations get broken after refactor moving classes between different projects
import package declarations get broken after refactor moving classes between ...
Status: RESOLVED DUPLICATE of bug 236885
Product: java
Classification: Unclassified
Component: Refactoring
7.4
PC Linux
: P2 with 1 vote (vote)
: 8.0.1
Assigned To: Ralph Ruijs
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-23 08:12 UTC by andrzejo
Modified: 2014-03-22 09:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
IDE log (497.64 KB, text/plain)
2014-02-23 08:13 UTC, andrzejo
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo