Project: JDT
Bug 330241 [quick fix] 'Add unimplemented methods' adds two methods from its implementing interface when one is already there
Reported: 2010-11-15 08:43:09 | Status: resolved fixed

I20101102-0800 1. Make a new Java 5 project. 2. Make one file. import java.util.List; public interface EModelService { public <T> List<T> findElements(Class<T> clazz, List<String> tagsToMatch); public <T> List<T> findPerspectiveElements(Class<T> clazz, List<String> tagsToMatch); } 3. Make another file. This one will have errors. import java.util.List; public class ModelServiceImpl implements EModelService { public <T> List<T> findElements(Class<T> clazz, List<String> tagsToMatch) { return null; } } 4. Use Ctrl+1 to ask JDT to add the unimplemented methods. 5. Now I have three methods. import java.util.List; public class ModelServiceImpl implements EModelService { public <T> List<T> findElements(Class<T> clazz, List<String> tagsToMatch) { return null; } public <T> List<T> findElements(Class<T> clazz, List<String> tagsToMatch) { // TODO Auto-generated method stub return null; } public <T> List<T> findPerspectiveElements(Class<T> clazz, List<String> tagsToMatch) { // TODO Auto-generated method stub return null; } }

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java