Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Problem testing ConvertAnonymousToNestedRefactoring patch

Hello,

I have a fix for ConvertAnonymousToNestedRefactoring so it will transform the following:

package bugs;

class ToNested {
    interface Callable<T> {
        public T call() throws Exception;
    }

    Callable<String> c = new Callable<>() {
        @Override
        public String call() throws Exception {
            return null;
        }
    };
}

to make the anonymous Callable instance into a nested class that implements Callable<String>.  The fix works fine in a child Eclipse.

When I attempt to add a new test for this in ConvertAnonymousToNestedTests1d8.java, there is always a failure in the ConvertAnonymousToNestedRefactoring.checkInitialConditions() which fails due to a null being returned by getSuperConstructorBinding().  This last call invokes resolveConstructorBinding() for the selected ClassCreationInstance.

Is there some additional flag/call I can add to the test framework to make it resolve the constructor binding?

-- Jeff J.

Back to the top