Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 108107

Summary: [Progress] ArithmeticException when running search job
Product: [Eclipse Project] Platform Reporter: Tom Hofmann <eclipse>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: john.arthorne, michaelvanmeekeren
Version: 3.1   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Tom Hofmann CLA 2005-08-26 09:01:47 EDT
I20050823

not sure whether this is jobs or search...

- From within a plugin.xml
- press Ctrl+H to bring up the search dlg
- choose the file search tab
- enter "org.eclipse.ui.edit.text.contentAssist.proposals" in the search
expression (no quotes)
- enter "plugin.xml, *.java" into the filter field
- press search
-> got the exception in the log

Probably has to do with the filter expression...

!ENTRY org.eclipse.ui 4 0 2005-08-26 14:56:58.824
!MESSAGE Failed to execute runnable (java.lang.ArithmeticException: / by zero)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.ArithmeticException: / by zero)
	at org.eclipse.swt.SWT.error(SWT.java:3241)
	at org.eclipse.swt.SWT.error(SWT.java:3164)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2840)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2571)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1734)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1698)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	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:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.ArithmeticException: / by zero
	at org.eclipse.ui.internal.progress.JobInfo.getPercentDone(JobInfo.java:318)
	at
org.eclipse.ui.internal.progress.ProgressInfoItem.getPercentDone(ProgressInfoItem.java:582)
	at
org.eclipse.ui.internal.progress.ProgressInfoItem.refresh(ProgressInfoItem.java:436)
	at
org.eclipse.ui.internal.progress.ProgressInfoItem.createChildren(ProgressInfoItem.java:273)
	at
org.eclipse.ui.internal.progress.ProgressInfoItem.<init>(ProgressInfoItem.java:178)
	at
org.eclipse.ui.internal.progress.DetailedProgressViewer.createNewItem(DetailedProgressViewer.java:102)
	at
org.eclipse.ui.internal.progress.DetailedProgressViewer.add(DetailedProgressViewer.java:88)
	at
org.eclipse.ui.internal.progress.ProgressViewerContentProvider.add(ProgressViewerContentProvider.java:203)
	at
org.eclipse.ui.internal.progress.ProgressViewUpdater$1.runInUIThread(ProgressViewUpdater.java:263)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:93)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	... 18 more
Comment 1 John Arthorne CLA 2005-08-26 10:00:21 EDT
This is actually a bug in JobInfo.getPercentDone.  If the task's total work is
zero, line 318 of JobInfo causes a divide by zero exception.  Since a total work
of zero is valid according to the API, this should be handled in JobInfo.
Comment 2 Douglas Pollock CLA 2005-08-31 10:00:37 EDT
*** Bug 108432 has been marked as a duplicate of this bug. ***
Comment 3 Tod Creasey CLA 2005-09-07 10:09:40 EDT
I haven't been able to replicate this but the section of code is pretty obvious.
Fixed in build >20050907
Comment 4 Tod Creasey CLA 2005-09-20 14:22:26 EDT
verified in 20050920