Community
Participate
Working Groups
This is multiproject issue related to Europa release NPE exception happens when creating CVS synchronization for Window working set when Window working set don't have resource working sets. For example when it has Tasks working sets contributed to platform by Mylar. -- Error Log -- Date: Mon May 28 23:21:10 EDT 2007 Message: Unhandled event loop exception Severity: Error Plugin ID: org.eclipse.ui Stack Trace: java.lang.NullPointerException at org.eclipse.team.internal.ui.Utils.getLabel(Utils.java:904) at org.eclipse.team.internal.ui.Utils.getScopeDescription(Utils.java:927) at org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant.getName(ModelSynchronizeParticipant.java:174) at org.eclipse.team.internal.ui.synchronize.SynchronizeManager.addSynchronizeParticipants(SynchronizeManager.java:350) at org.eclipse.team.internal.ccvs.ui.mappings.ModelSynchronizeWizard.createParticipant(ModelSynchronizeWizard.java:46) at org.eclipse.team.ui.synchronize.ParticipantSynchronizeWizard.performFinish(ParticipantSynchronizeWizard.java:76) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:616) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction$1.run(SynchronizePageDropDownAction.java:40) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
Not critical for 3.3. We'll address it in 3.3.1.
My proposition is to disable Finish button on the CVS Synchronization dialog when there are no resources selected (no matter what scope have we chosen). That leads to another "bug" -- IMO enablement of the Finish button doesn't work properly. I will check if it hasn't been reported already. PS. Eugene, I know that this is not what you are claiming about but don't you think that synchronizing Mylyn's Tasks working sets should be reported to Mylyn team? They could probably provide set of resources based on a Task (Tasks working set).
(In reply to comment #2) > PS. Eugene, I know that this is not what you are claiming about but don't you > think that synchronizing Mylyn's Tasks working sets should be reported to Mylyn > team? They could probably provide set of resources based on a Task (Tasks > working set). I think that Team/CVS UI should not allow user to chose working set types it won't be able proceed with, i.e. any kind of non-resource working sets. BTW same issue would happens with Breakpoint working sets contributed by Platform/Debug. So, in my view concept of working set is much broader then just some group resources, i.e. it may group tasks, user identities, database tables, recipe ingridients or any other things that could appear in any arbitrary domain.
I agree that the ideal solution to this is to only allow the user to select working sets that either contain resources directly or contain elements that adapt to IResource or ResourceMapping. I would be a bit concerned that there may be performance issues if there were a large number of working sets (or, to put it another way, we would need to make sure we didn't block the UI while determining what working sets to show or make the task cancellable). The benefit of Tomasz's solution is that we would only check working sets once they were selected. The disadvantage is that the user may be confused because it may not be obvious that working set they have chosen doesn't contain resources (i.e they would wonder why they were even allowed to select the working set in the first place). The other advantage of this solution is that we can do it without adding API or rewritting the working sets dialog creation API. What I want to do in 3.3.1 is eliminate the NPE. Given that we can't add API, I think the solution that Tomasz suggests is the way to go for now.
Created attachment 72003 [details] A patch The patch modifies the GlobalRefreshElementSelectionPage#checkWorkingSetElements which now returns true when selected working sets contain any elements. The boolean is used to set enablement of the Finish button.
Created attachment 72004 [details] mylar/context/zip
Patch released to HEAD. we will release it to 3.3.1 once Europa ships.
Patch released to 3.3.1
VERIFIED
VERIFIED in M20070815-0800, I20070815-1600
Fix verified but probably it's causing bug 201544.
VERIFIED in M20070822-0800 and M1.