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 236422

Summary: [JDK8] Ensure Move/Copy refactoring handle receiver parameters
Product: java Reporter: Svata Dedic <sdedic>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: NEW ---    
Severity: normal CC: dstrupl
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:

Description Svata Dedic 2013-09-26 12:11:21 UTC
When moving a method with a receiver parameter to another class, the parameter that corresponds to the former 'this' instance should receive type use annotations originally present on the receiver parameter.

The refactoring should understand and remove the receiver parameter from the moved/copied declaration.


e.g. consider

 class MyClass {
    ...
    public boolean doSomething(@ReadOnly MyClass this, Object other) { ... }
  }

and doSomething is about to be moved.

if we don't specifically handle the 'this' parameter, a compilation error occurs after move (the 'this' parameter must be of the same type as enclosing class).
Comment 1 Svata Dedic 2013-09-26 12:22:33 UTC
Correction: the receiver parameter does not appear in the traditional parameters tree, so it won't be copied by current code. So just the type annotations should be copied over to the generated instance parameter.