Project: JDT
Bug 170239 [extract superclass] IllegalArgumentException during Extract Superclass refactor
Reported: 2007-01-11 12:47:41 | Status: verified fixed

This class will produce an IllegalArgumentException after selecting methods to be removed from the subclass: import java.io.FilterReader; import java.io.IOException; import java.io.Reader; public class ClassA extends FilterReader { public ClassA(Reader in) { super(in); } @Override public int read(char[] cbuf, int off, int len) throws IOException { return super.read(cbuf, off, len); } } Steps to Reproduce: 1- Select the class "ClassA" 2- Choose "Refactor|Extract Superclass..." from the menus. 3- Enter a superclass name, i.e., "SuperClass" 4- Check the "read" method under "Specify actions for members:" 5- Set the action to "extract" 6- Click "Next". 7- Ensure the "read" method is checked. 8- Click "Next". Results: An error is displayed: "A fatal error occured while performing the refactoring.", "An unexpected exception occured while creating a change object. See the error log for details." If the "read" method does not exist (e.g. substitute "toString") then the exception does not occur.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java