Bug 189577 - [Sync View] NPE exception when creating CVS synchronization for Window working set
Summary: [Sync View] NPE exception when creating CVS synchronization for Window workin...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-28 23:24 EDT by Eugene Kuleshov CLA
Modified: 2007-08-29 08:41 EDT (History)
4 users (show)

See Also:


Attachments
A patch (4.09 KB, patch)
2007-06-21 04:56 EDT, Tomasz Zarna CLA
no flags Details | Diff
mylar/context/zip (7.05 KB, application/octet-stream)
2007-06-21 04:56 EDT, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2007-05-28 23:24:34 EDT
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)
Comment 1 Michael Valenta CLA 2007-06-01 12:09:05 EDT
Not critical for 3.3. We'll address it in 3.3.1.
Comment 2 Tomasz Zarna CLA 2007-06-20 09:44:19 EDT
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).
Comment 3 Eugene Kuleshov CLA 2007-06-20 11:16:26 EDT
(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.
Comment 4 Michael Valenta CLA 2007-06-20 11:49:13 EDT
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.
Comment 5 Tomasz Zarna CLA 2007-06-21 04:56:34 EDT
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.
Comment 6 Tomasz Zarna CLA 2007-06-21 04:56:37 EDT
Created attachment 72004 [details]
mylar/context/zip
Comment 7 Michael Valenta CLA 2007-06-21 09:53:28 EDT
Patch released to HEAD. we will release it to 3.3.1 once Europa ships.
Comment 8 Michael Valenta CLA 2007-07-09 11:41:16 EDT
Patch released to 3.3.1
Comment 9 Krzysztof Daniel CLA 2007-08-16 10:01:58 EDT
VERIFIED
Comment 10 Krzysztof Daniel CLA 2007-08-17 10:59:14 EDT
VERIFIED in M20070815-0800,  I20070815-1600
Comment 11 Krzysztof Michalski CLA 2007-08-29 05:51:15 EDT
Fix verified but probably it's causing bug 201544.
Comment 12 Szymon Brandys CLA 2007-08-29 08:41:02 EDT
VERIFIED in M20070822-0800 and M1.