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 248866 - Rename or move of type can lead to change of behavior or compile error
Summary: Rename or move of type can lead to change of behavior or compile error
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 15:31 UTC by Jachym_Vojtek
Modified: 2016-07-11 06:36 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 Jachym_Vojtek 2014-11-24 15:31:46 UTC
a.X() (class X with default constructor in package 'a') 
a.X1(String) 

b.Y() 

c.Z(JPanel) 
c.Y(Exception) 


import b.*; 
public class X { 
  Y y = new Y(); 
} 


1) rename a.X1->a.Y 

2) move c.Y->a.Y 

3) move a.X->c.X 

-- 

a.X() 
a.X1(String) 

b.Y() 

c.Z(JPanel) 


import b.*; 
import c.Z; 

public class X { 
  Y y = new Y(); 
} 

4) rename c.Z->c.Y 

-- 

import b.Y; 
import c.Z; 

public class X { 
  Y y = new Y(); 
} 

5) rename c.Z->c.Y 

-- 

import b.*; 
import c.*; 

public class X { 
  Y y = new Y(); 
} 

6) rename c.Z->c.Y 

-- 

a.Y(Exception) 
a.X() 
a.X1(String) 

b.Y() 

c.Z(JPanel) 

public class X { 
  Y y = new Y(); 
} 

7) rename c.Z->c.Y
Comment 1 Jachym_Vojtek 2014-11-27 07:58:32 UTC
Once more the example 7, type Y is imported from current package)

package a; 

import c.Z; 

public class X { 
    Y y = 
        new Y(); 
} 

-- 
package a; 

public class Y { 
    public Y() { 
        super(); 
    } 
} 
-- 
package c; 

public class Z { 
    public Z(Exception e) { 
    } 
} 
-- 
rename c.Z->c.Y
Comment 2 Martin Balin 2016-07-07 07:15:45 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 3 Jachym_Vojtek 2016-07-11 06:36:23 UTC
I was able to reproduce at least #1 in NetBeans IDE Dev (Build 201607110002)

Enclosed sources:
package nb248866.a;

import nb248866.b.*;

public class X {

    Y y = new Y();
}
--
package nb248866.a;

public class X1 {

    public X1(String s) {
    }
}
--
package nb248866.b;

public class Y {
    
}
--
package nb248866.c;

public class Y {
    public Y(Exception e) {
    }
}
--
package nb248866.c;

import javax.swing.JPanel;

public class Z {
    public Z(JPanel pnl) {}
}