Community
Participate
Working Groups
At the moment it is not possible to create an implementation of JavaRefactoringDescriptor that does not yield in a StackOverflow if the implementation of org.eclipse.ltk.core.refactoring.RefactoringContribution.createDescriptor(String, String, String, String, Map, int) returns a non JDTRefactoringDescriptor. The problem is caused by the fact that JavaRefactoringDescriptor.createRefactoring(RefactoringStatus) does not have the possibility to invoke the JDTRefactoringContribution.createRefactoring(RefactoringDescriptor) method. Instead a indirection is performed by first calling JDTRefactoringContribution.createDescriptor(String, String, String, String, Map, int) which always returns a JDTRefactoringDescriptor which then invokes the JDTRefactoringContribution.createRefactoring(RefactoringDescriptor). At first, JDTRefactoringContribution.createDescriptor(String, String, String, String, Map, int) is meant to return a specialized Descriptor as documented in org.eclipse.jdt.core.refactoring.IJavaRefactorings.CHANGE_METHOD_SIGNATURE for example. At second the transformation of the specialized descriptor into the general one (JDTRefactoringDescriptor) and then passed to the refactoring as RefactoringArguments loses a lot of useful information. In a later step one might discuss to remove the IScriptableRefactoring interface as the Contribution has all information at hand to initialize the refactoring using the descriptor. Or even better, the refactoring is only invokeable using a descriptor. Using a descriptor in the constructor of a refactoring does not mean to perform all initializations in the constructor. I will attach a patch for the move.
Created attachment 71900 [details] Move of method One might think about narrowing the RefactoringDescriptor to JavaRefactoringDescriptor
patch released > 20070620
reverted patch as rename tests are failing
Created attachment 72076 [details] Updated Patch Updated all Contributions to adapt descriptors to IScriptableRefactoring
Created attachment 72189 [details] Updated Version +Removed most uses of JDTRefactoringDescriptor +Specialized Descriptors are used in most places -Most Descriptors need a full implementation, I did what it took to make it run, but the descriptors are far from being perfect. -Move/Copy stuff will be tricky to solve and is untouched by now. Propably another Bug for that would be useful.
the attached patch is incomplete will create a new one
Created attachment 72577 [details] Descriptor updates In this patch JDTRefactoringDescriptor has been completly eliminated. Only specialized descriptors are returned in any case. Some functionality which was basically utility methods have been moved to a new class JavaRefactoringDescriptorUtility. This is the place where further helper methods should go to.
Created attachment 72580 [details] Missed some processors
patch released > 20070627
fixed