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 108482 - [push down method] PushDown a method that references a field returns an error message
Summary: [push down method] PushDown a method that references a field returns an error...
Status: RESOLVED DUPLICATE of bug 90196
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 108480 108481 108484 108485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-29 00:46 UTC by kely_garcia
Modified: 2007-08-21 10:13 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 kely_garcia 2007-06-29 00:46:18 UTC
Build ID: Netbeans 6.0 M9 (070502)

Steps To Reproduce:
Push down method m on the following returns an erroneous message: "Cannot push down any members. The selected type has 
no subtypes". It should be possible to push down method m in this case. 

public class A {
    public Object theField;
    public void m(){
        A.this.theField=null;
    }
}
class B extends A {
    void mPrime(){
        m();
    }
}
Comment 1 Jan Becicka 2007-06-29 10:14:03 UTC
Valid issue.
Comment 2 Jan Becicka 2007-06-29 11:10:52 UTC
*** Issue 108485 has been marked as a duplicate of this issue. ***
Comment 3 Jan Becicka 2007-06-29 11:11:21 UTC
*** Issue 108484 has been marked as a duplicate of this issue. ***
Comment 4 Jan Becicka 2007-06-29 11:11:48 UTC
*** Issue 108480 has been marked as a duplicate of this issue. ***
Comment 5 Jan Becicka 2007-06-29 11:12:05 UTC
*** Issue 108481 has been marked as a duplicate of this issue. ***
Comment 6 Jiri Prox 2007-07-02 13:40:04 UTC
Find All Subtypes for class A returns empty result, exception mentioning issue 90196 is thrown.
So I suppose this is duplicate of 90196, am I right?


java.lang.AssertionError: issue 90196, Cannot find file for ElementHandle[kind=OTHER; sigs=test.B ].
cpInfo=ClasspathInfo boot:[ClassPath[Entry[file:/space/u5/var/cache/index/0.3/s3/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/rt.jar!/], Entry[file:/space/u5/var/cache/index/0.3/s4/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/i18n.jar!/], Entry[file:/space/u5/var/cache/index/0.3/s5/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/sunrsasign.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s6/classes/], Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/jsse.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s7/classes/], Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/jce.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s8/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/charsets.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s9/classes/], Entry[file:/space/jdk/jdk1.5.0_12.b04/jre/classes/],
Entry[file:/space/u5/var/cache/index/0.3/s10/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/ext/sunjce_provider.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s11/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/ext/sunpkcs11.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s12/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/ext/dnsns.jar!/],
Entry[file:/space/u5/var/cache/index/0.3/s13/classes/],
Entry[jar:file:/space/jdk/jdk1.5.0_12.b04/jre/lib/ext/localedata.jar!/]]],compile:[ClassPath[Entry[file:/space/u5/var/cache/index/0.3/s18/classes/],
Entry[jar:file:/space/builds/netbeans-6.0-200707012149/platform7/modules/ext/swing-layout-1.0.2.jar!/]]],src:[ClassPath[Entry[file:/home/jp159440/NetBeansProjects/JavaApplication48/src/],
Entry[file:/home/jp159440/NetBeansProjects/JavaApplication48/test/]]]
        at
org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.getImplementorsRecursive(JavaWhereUsedQueryPlugin.java:172)
Comment 7 kely_garcia 2007-08-09 21:41:59 UTC
If we perform Push down method A.m() in the following program (A and B declared in different java files), we get this 
compilation error: 'not an enclosing class: p.A'. Push down did return an error message when classes A and B are 
declared in the same java file but the refactoring was performed when they are declared in separate java files.  

A.java
package p;
public class A {
    public Object theField;
    public void m(){
        A.this.theField=null;
    }
}

B.java
package p;
class B extends A {
    void mPrime(){
        m();
    }
}
Comment 8 Jan Becicka 2007-08-21 10:13:29 UTC

*** This issue has been marked as a duplicate of 90196 ***