Project: JDT
Bug 85465 [refactoring] introduce factory fails for varag constructor
Reported: 2005-02-16 12:08:00 | Status: resolved fixed

I20050215-2300 (m5 test pass) - Introduce factory for the ctor invocation in 'method'. Accept the default settings. Expected: ctor invocation gets replaces by static method invocation with the same arguments. Actual: only the first argument is reused. package refactoring; public class IntroduceFactory { public IntroduceFactory(int... es) { } void method() { IntroduceFactory one= new IntroduceFactory(1, 2, 3); } } --> public class IntroduceFactory { public static IntroduceFactory createIntroduceFactory(int... es) { return new IntroduceFactory(es); } private IntroduceFactory(int... es) { } void method() { IntroduceFactory one= createIntroduceFactory(1); // should be 1, 2, 3 } }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/85465/Varargs1.java org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/85465/Varargs1_out.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