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 - [JDK8] Ensure Move/Copy refactoring handle receiver parameters
Summary: [JDK8] Ensure Move/Copy refactoring handle receiver parameters
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-26 12:11 UTC by Svata Dedic
Modified: 2013-09-26 12:22 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

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