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 103592

Summary: [Push Down Field] Push down field should return a warning
Product: java Reporter: kely_garcia <kely_garcia>
Component: RefactoringAssignee: Jan Becicka <jbecicka>
Status: RESOLVED FIXED    
Severity: blocker CC: MackSix
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description kely_garcia 2007-05-09 20:57:53 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

When a push down field is referenced by another field in the same class, it 
should return a warning message like "push down field A.f is referenced by A.g"

Steps to reproduce: apply Push Down Field refactoring to A.f on the following 
program:

public class A {
 int f, g =f;
}
class B extends A {
}

PushDownField refactoring produces the uncompilable code below:
public class A {
 int g =f;
}
class B extends A {
    int f;
}

Note: The error message is: "cannot find variable f in class A"
Comment 1 Jiri Prox 2008-04-11 01:47:23 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 2 ssazonov 2013-10-23 09:32:12 UTC
Same problem with methods:

1. Assume following classes:

class ClassA{
  public void m1(){
  }
  public void m2{
    m1();
  }
}

class ClassB extends ClassA{
}

2. Push Down m1() and you'll get without any warning broken code:

class ClassA{
  public void m2{
    m1();
  }
}

class ClassB extends ClassA{
  public void m1(){
  }
}

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 3 Ralph Ruijs 2015-01-28 15:14:12 UTC
changeset:   44661b24fe34
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Wed Jan 28 13:41:23 2015 +0100
summary:     #103592 - [Push Down Field] Push down field should return a warning
Comment 4 Quality Engineering 2015-01-29 04:15:20 UTC
Integrated into 'main-silver', will be available in build *201501290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/44661b24fe34
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #103592 - [Push Down Field] Push down field should return a warning