Issue 16 in constants-to-enum-eclipse-plugin: Refactoring should not use UI components for code changes

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 28, 2009, 11:54:38 AM8/28/09
to convert_constant...@googlegroups.com
Status: Accepted
Owner: b.muskalla
Labels: Type-Defect Priority-High Usability Milestone-Release1.0

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

codesite...@google.com

unread,
Aug 28, 2009, 11:58:43 AM8/28/09
to convert_constant...@googlegroups.com

Comment #1 on issue 16 by b.muskalla: Refactoring should not use UI

just for the record: I was talking about
ConvertConstantsToEnumRefactoring#insertNewEnumType with reference to the
NewEnumTypePage

codesite...@google.com

unread,
Aug 31, 2009, 8:34:37 PM8/31/09
to convert_constant...@googlegroups.com
Updates:
Cc: raffi.t.khatchadourian

Comment #2 on issue 16 by raffi.t.khatchadourian: Refactoring should not

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.

Reply all
Reply to author
Forward
0 new messages