Community
Participate
Working Groups
Build Identifier: M20110210-1200 I want to move some functionality of class A to a new composing class B. I created a new class B, which has nothing in it. I change A.method() to take a B as a parameter, so that I can use the instance method Move refactoring to move method() to B. That fails with a NullPointerException, in the attached stack trace. Reproducible: Always Steps to Reproduce: I tried to create a new set of classes that demonstrate this problem, but haven't been able to find whatever makes this refactoring fail in this case. I can however reproduce it every time with my code, but confidentiality prohibits my posting that code here.
Created attachment 192667 [details] Stack trace
I checked 328554 and 328786 which seemed similar, but this stack trace is different so I assume the underlying cause is new.
Just to clarify: you do this in the Java editor, right?
(In reply to comment #3) > Just to clarify: you do this in the Java editor, right? That's correct. Refactor menu -> Move. Select the object I want to move the method to, and hit either preview or OK, then get the error.
Snippet to reproduce (move A#foo(B) to B): package p; import com.example.Outer.Inner; public class A { public void foo(B b) { Inner<String> i; } } package p; public class B { } package com.example; public class Outer { public static class Inner<E> {} }
Created attachment 192766 [details] Fix
Fixed in HEAD.