Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 103592 - [Push Down Field] Push down field should return a warning
[Push Down Field] Push down field should return a warning
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Refactoring
6.x
All All
: P3 (vote)
: 8.1
Assigned To: Jan Becicka
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-09 20:57 UTC by kely_garcia
Modified: 2015-01-29 04:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

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


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