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 199163 - [Push Down] Pushing down method leads to compilation error: No enclosing instance of the type T is accessible in scope
Summary: [Push Down] Pushing down method leads to compilation error: No enclosing inst...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
: 201145 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-04 14:06 UTC by gustavo_soares
Modified: 2015-09-17 11:16 UTC (History)
1 user (show)

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 gustavo_soares 2011-06-04 14:06:19 UTC
Pushing down a method that contains a method call using qualified this may lead
to compilation error: No enclosing instance of the type is accessible in scope 

Steps to Reproduce:
1. Create the classes:
public class A {
  public long m(){
      return A.this.k();
  }
  public long k( ){
    return 1;
  }
}
public class B extends A{}

2. Apply the push down refactoring to A.m():
public class A {
  public long k( ){
    return 1;
  }
}
public class B extends A{
  public long m(){
      return A.this.k();
  }
}

3. After the refactoring, there is a compilation error: No enclosing instance
of the type A is accessible in scope
Comment 1 Marian Mirilovic 2011-06-06 09:09:35 UTC
NetBeans version ?
Comment 2 gustavo_soares 2011-06-06 12:11:29 UTC
(In reply to comment #1)
> NetBeans version ?

7.0
Comment 3 Jan Becicka 2012-04-23 11:04:24 UTC
*** Bug 201145 has been marked as a duplicate of this bug. ***
Comment 4 Martin Balin 2015-09-17 11:16:17 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.