Freitag, 16. November 2007

It's working!!!!

After lots of disappointing hours I have made a great progress tonight.
Rename refactorings work now with descriptors.
The problem was the following line:
renameJavaElementDescriptor.setJavaElement(typeToRename.getCompilationUnit());

If I don't get the compilation unit of the type the refactoring processor does not get initialized and the checkFinalConditions crashed with a NPE.

After this I tried to implement the move refactoring.
The move seems not to work fine yet:

java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.refactoring.reorg.DeleteChangeCreator.createDeleteChange(DeleteChangeCreator.java:83)
at org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory$MoveSubCuElementsPolicy.createChange(ReorgPolicyFactory.java:1812)
at org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor.createChange(JavaMoveProcessor.java:158)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:234)
at org.moreunit.refactoring.MoveClassParticipant.createChange(MoveClassParticipant.java:115)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:250)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

But some more time for coding and this will be solved hopefully.

Keine Kommentare: