Bug 179210 - Exception when dealing with a feature with missing dependencies
Summary: Exception when dealing with a feature with missing dependencies
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Platform-Update-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-25 18:13 EDT by Chris Aniszczyk CLA
Modified: 2007-06-06 12:00 EDT (History)
5 users (show)

See Also:
caniszczyk: review? (dejan)


Attachments
FeaturesWithErrors.zip (26.18 KB, application/zip)
2007-03-25 18:14 EDT, Chris Aniszczyk CLA
no flags Details
Update site with defined category and which works fine (26.77 KB, application/zip)
2007-05-21 08:01 EDT, Jakub Jurkiewicz CLA
no flags Details
Patch attachement (6.30 KB, patch)
2007-05-22 08:45 EDT, Jakub Jurkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-03-25 18:13:26 EDT
1) Install the attached feature zip file
2) Select FeaturesWithErrors.zip and click on the "Finish" button
3) Check FeaturesWithErrors.zip"item in search result dialog (do not first expand it)
4) Expand "FeaturesWithErrors.zip" item fully.
5) Notice the error popup
Comment 1 Chris Aniszczyk CLA 2007-03-25 18:13:40 EDT
trace:
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.core.runtime.AssertionFailedException: assertion failed: )
at org.eclipse.swt.SWT.error(SWT.java:3499)
at org.eclipse.swt.SWT.error(SWT.java:3422)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2331)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2295)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2170)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:463)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:458)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146)
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:356)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416)
at org.eclipse.equinox.launcher.Main.run(Main.java:1141)
Caused by: org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
at org.eclipse.text.edits.TextEdit.<init>(TextEdit.java:146)
at org.eclipse.text.edits.MultiTextEdit.<init>(MultiTextEdit.java:62)
at org.eclipse.text.edits.CopySourceEdit.performSourceComputation(CopySourceEdit.java:259)
at org.eclipse.text.edits.CopySourceEdit.traverseSourceComputation(CopySourceEdit.java:254)
at org.eclipse.text.edits.TextEditProcessor.computeSources(TextEditProcessor.java:202)
at org.eclipse.text.edits.TextEditProcessor.executeDo(TextEditProcessor.java:185)
Comment 2 Chris Aniszczyk CLA 2007-03-25 18:14:23 EDT
Created attachment 61937 [details]
FeaturesWithErrors.zip
Comment 3 Philipe Mulet CLA 2007-04-05 12:12:13 EDT
Are we doing anything for 3.3 here ?
Comment 4 Steve Francisco CLA 2007-05-10 16:44:04 EDT
It doesn't look like this one's been looked at yet. Who should be monitoring this inbox?
Comment 5 Jakub Jurkiewicz CLA 2007-05-21 07:28:36 EDT
I went through the scenerio Chris had given, but I got different exception:

java.lang.NullPointerException
at org.eclipse.jface.viewers.CustomHashtable.hashCode(CustomHashtable.java:264)
at org.eclipse.jface.viewers.CustomHashtable.get(CustomHashtable.java:236)
at org.eclipse.jface.viewers.StructuredViewer.findItems(StructuredViewer.java:770)
at org.eclipse.jface.viewers.StructuredViewer.findItem(StructuredViewer.java:734)
at org.eclipse.jface.viewers.CheckboxTreeViewer.getChecked(CheckboxTreeViewer.java:173)
at org.eclipse.update.internal.ui.wizards.ReviewPage$TreeLabelProvider.getImage(ReviewPage.java:287)
at org.eclipse.update.internal.ui.parts.SharedLabelProvider.getColumnImage(SharedLabelProvider.java:182)
at org.eclipse.jface.viewers.TableColumnViewerLabelProvider.update(TableColumnViewerLabelProvider.java:71)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:135)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:895)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:97)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:850)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:973)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:466)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:850)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2018)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:806)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:781)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:755)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:563)
at org.eclipse.update.internal.ui.wizards.ContainerCheckedTreeViewer.createChildren(ContainerCheckedTreeViewer.java:204)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1392)
at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeViewer.java:854)
at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1403)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:125)
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.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:6875)
at org.eclipse.swt.widgets.Control.wmNotify(Control.java:4555)
at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1568)
at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4208)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3716)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4342)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2173)
at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1481)
at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:5663)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3697)
at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5232)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4355)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2259)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3282)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.update.internal.ui.wizards.ResizableInstallWizardDialog.open(ResizableInstallWizardDialog.java:59)
at org.eclipse.update.internal.ui.wizards.InstallWizardOperation$UpdateJobChangeListener.openInstallWizard2(InstallWizardOperation.java:102)
at org.eclipse.update.internal.ui.wizards.InstallWizardOperation$UpdateJobChangeListener.access$0(InstallWizardOperation.java:87)
at org.eclipse.update.internal.ui.wizards.InstallWizardOperation$3.run(InstallWizardOperation.java:79)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.update.internal.ui.wizards.InstallWizardOperation$2.run(InstallWizardOperation.java:77)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650)
Comment 6 Jakub Jurkiewicz CLA 2007-05-21 08:01:16 EDT
Created attachment 67972 [details]
Update site with defined category and which works fine

I made some investigation.
The NPE seems to occur only when the feature is in the default category ("Other").
I attach the changed Chris's example - I added some category to the update site definition and it worked!
I will try to get into details and see what can be a problem.
Comment 7 Jakub Jurkiewicz CLA 2007-05-22 08:45:56 EDT
Created attachment 68104 [details]
Patch attachement

As I wrote in Comment #5 the problem is only when there is no category defined for the feature. After applying the patch when SiteFeatureReference#getCategories() is invoked it is checked if there was any category defined for this feature, if yes we return this category (or categories), if no we return the array with the category with default values.
Not to duplicate the string constants (other label and other description) I moved these strings into the org.eclipse.update.internal.core.Messages.
Comment 8 Steve Francisco CLA 2007-05-22 12:32:43 EDT
What needs to happen to get this reviewed/approved for including in 3.3?
Comment 9 Chris Aniszczyk CLA 2007-05-22 12:55:04 EDT
I believe it needs two reviewers. I'll request Dejan to review.

Also, in the patch, why did you choose to make the messages in Messages and not UpdateUIMessages?
Comment 10 Philipe Mulet CLA 2007-05-22 13:11:25 EDT
re: comment 8
Steve, shouldn't it have been tagged as critical ? (I just marked it)
Comment 11 Jakub Jurkiewicz CLA 2007-05-22 16:12:19 EDT
(In reply to comment #9)
> Also, in the patch, why did you choose to make the messages in Messages and not
> UpdateUIMessages?
>
I didn't want to make the org.eclipse.update.core project dependent on org.eclipse.update.ui (this would lead to cyclic dependencies between projects).
Is there any better way to do this?

Comment 12 Chris Aniszczyk CLA 2007-05-22 17:23:36 EDT
fair enough, I missed that :)

Dejan?
Comment 13 Dejan Glozic CLA 2007-05-22 17:39:44 EDT
This looks good to me. Jakub, just one clarification: with the code in Core, can the null case in Update UI (when there is no category) ever be reached? It seems to me that 'Other' category will now be created in Core.
Comment 14 Dejan Glozic CLA 2007-05-22 18:57:06 EDT
Released. Please verify with the next RC2 build.
Comment 15 Jakub Jurkiewicz CLA 2007-05-23 05:42:48 EDT
(In reply to comment #13)
> This looks good to me. Jakub, just one clarification: with the code in Core,
> can the null case in Update UI (when there is no category) ever be reached? It
> seems to me that 'Other' category will now be created in Core.
> 
Yes, it seems true. Does it change something?

Comment 16 Jakub Jurkiewicz CLA 2007-05-30 07:47:49 EDT
Verified in 3.3RC2