New issue 16 by b.muskalla: Refactoring should not use UI components for
code changes
http://code.google.com/p/constants-to-enum-eclipse-plugin/issues/detail?id=16
Currently we reuse the NewEnumTypeWizard page as part of the refactoring.
The refactoring must not have any dependencies to UI components as this can
lead to problematic code pathes.
Eg. running the refactoring in another thread than the UI thread leads to
major refactoring failures.
Caused by: java.lang.NullPointerException
at
org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:207)
at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:152)
at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:124)
at
org.eclipse.jdt.internal.ui.JavaPluginImages.getImageRegistry(JavaPluginImages.java:534)
at
org.eclipse.jdt.internal.ui.JavaPluginImages.get(JavaPluginImages.java:491)
at
org.eclipse.jdt.ui.wizards.NewTypeWizardPage$InterfacesListLabelProvider.<init>(NewTypeWizardPage.java:305)
at
org.eclipse.jdt.ui.wizards.NewTypeWizardPage.<init>(NewTypeWizardPage.java:442)
at
org.eclipse.jdt.ui.wizards.NewEnumWizardPage.<init>(NewEnumWizardPage.java:49)
at
edu.ohio_state.khatchad.refactoring.ConvertConstantsToEnumRefactoring.insertNewEnumType(ConvertConstantsToEnumRefactoring.java:622)
at
edu.ohio_state.khatchad.refactoring.ConvertConstantsToEnumRefactoring.checkFinalConditions(ConvertConstantsToEnumRefactoring.java:351)
at
org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
at
org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at
org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
just for the record: I was talking about
ConvertConstantsToEnumRefactoring#insertNewEnumType with reference to the
NewEnumTypePage
Comment #2 on issue 16 by raffi.t.khatchadourian: Refactoring should not
use UI components for code changes
http://code.google.com/p/constants-to-enum-eclipse-plugin/issues/detail?id=16
Right, this is obviously a code-reuse hack. Getting this issue fixed may
involve some work; we may need to
replicate code found in the new enum type page functionality.