Bug 49772 Change method signature: remove unused imports [refactoring]
M6 package org.eclipse.jdt.internal.corext.refactoring.base; import org.eclipse.core.runtime.IAdaptable; /** * A <code>RefactoringStatusContext<code> can be used to annotate a * {@link RefactoringStatusEntry} with additional information * typically presented in the UI. * * @since 3.0 */ public class RefactoringStatusContext { /** * Returns the element that corresponds directly to this context, * or <code>null</code> if there is no corresponding element. * <p> * For example, the corresponding element of a context for a problem * detected in an <code>IResource</code> would the the resource itself. * <p> * * @return the corresponding element, or <code>null</code> if none */ public IAdaptable getCorrespondingElement() { return null; } } Consider the code from above and change the signature of getCorrespondingElement to return Object. If you press preview you get an refactoring error telling me that the import isn't used. Since we already detect this case we should remove the import. I know that this might introduce inconsistencies with other refactorings but getting this error message is even worse.
org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAll60_out.java
package p;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
class A {
	/**
	 * @param tho {@link #getList}
	 * @param tho
	 * @param l TODO
	 * @param to 1st param of {@link A#getList(long, List, int) me}
	 * @param to 2nd
	 * @version throwaway
	 * @throws Exception TODO
	 * @see #getList(long, List, int)
	 * @see #getList(long tho, List l, int to)
	 * @return the list
	 */
	public List getList(long tho, List l, int to) throws Exception {
		
		
		return new ArrayList((int)tho-to);
	}
}
interface I {