No suitable fields found when I try to move method
I tried to move method from one class to another one. When I selected the method and press F6 (Refactoring -> Move) I receive following message: "No suitable parametrs/fields found. Would you like to make method ... static and then move?"
What is the source of problem with moving that method? It's a simple public method with 2 params and one with default value. When I search for usages (Alt-F7) I receive a list with 4 usages. If any other information is needed, let me know.
请先登录再写评论。
Moving non-static methods isn't supported. We're suggesting to make method static per https://youtrack.jetbrains.com/issue/WI-36186
I see. So all in all moving a non static method is triggering a Move instance method to another type refactoring. This is why I get information about suitable fields or parameters.
Correct. See https://youtrack.jetbrains.com/issue/WI-7523 and related issues for more info if interested