Project: JDT
Bug 83187 IntroduceFactory and J2SE 5.0
Reported: 2005-01-19 09:17:40 | Status: resolved fixed

Consider the following cases public class IntroduceFactory<T> { public IntroduceFactory(T t) { } public IntroduceFactory(String ... args) { } } Problems: - creating a factory method for IntroduceFactory(T t) outside of IntroduceFactory class shouldn't be support due to the reference to the type parameter - creating a factory method for IntroduceFactory(String ... args) creates an array based signature. ====================================================================== public enum E { A(1), B(2), C(3); public E(int i) { } } We should disable Introduce factory for constructors on enums. Creating a factory for them doesn't make sense anyway. Annotation shouldn't be affected by introduce factory. Bob, can you fix this for M5, add the corresponding test case and try to come up with other scenarios that might be broken.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/negative/Enum_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation1.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation1_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation2.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation2_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation3.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/Annotation3_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/BoundedTypeParam.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/BoundedTypeParam_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TwoBoundedTypeParams.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TwoBoundedTypeParams_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TwoTypeParams.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TwoTypeParams_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TypeParam.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TypeParam2.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TypeParam2_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/TypeParam_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/VarArgsCtor.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/VarArgsCtor_in.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/WildcardParam.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/WildcardParam_in.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceFactoryTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java