Project: JDT
Bug 97213 Push [refactoring] Down into java14 project does not convert static imports, varargs
Reported: 2005-05-30 06:37:18 | Status: resolved fixed

3.1-RC1 test pass - have the sources below - pushdown stat() to Subtype - pushed down method uses varargs albeit in Java14 project - pushed down CU does not get the import to Math.abs --------- SuperType.java (Java 5 project) ----- package com.superclass; import static java.lang.Math.*; public class SuperType<ELEM extends Number> { int stat(Integer j) { return min(j, 42, 52, abs(32)); } int min(int head, int... tail) { int min= head; for (int i : tail) min= min(i,min); return min; } } ----------- SubType.java (Java 1.4 project) ------ package com.example; import com.superclass.SuperType; public class SubType extends SuperType { } ----------------------------------- Alternatively, push down min() along with stat(). Note that the vararg signature and new for loop are both kept in source, resulting in errors. I guess it is ok not to convert the language constructs, but we might want to issue a warning.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMemberPage.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMethodPage.java