Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 166800 - [ErrorHandling] The Status Handling hooking into Eclipse
Summary: [ErrorHandling] The Status Handling hooking into Eclipse
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-05 11:28 EST by Szymon Brandys CLA
Modified: 2006-12-20 12:26 EST (History)
2 users (show)

See Also:


Attachments
The Handling in Jobs and JFace (9.11 KB, patch)
2006-12-05 11:30 EST, Szymon Brandys CLA
no flags Details | Diff
The Handling in Jobs, JFace and parts opening (22.55 KB, patch)
2006-12-06 07:13 EST, Szymon Brandys CLA
no flags Details | Diff
The Handling in Jobs, JFace and parts opening (39.78 KB, patch)
2006-12-06 11:13 EST, Szymon Brandys CLA
no flags Details | Diff
The Handling in Jobs, JFace and parts opening (39.79 KB, patch)
2006-12-06 11:20 EST, Szymon Brandys CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2006-12-05 11:28:58 EST
 
Comment 1 Szymon Brandys CLA 2006-12-05 11:30:34 EST
Created attachment 55048 [details]
The Handling in Jobs and JFace
Comment 2 Szymon Brandys CLA 2006-12-05 11:57:11 EST
Questions to the patch

1. The methods openWarning and openError in the MessageDialog class from jface don't show dialogs now. They create statuses and pass them to the logger from the policy. Is it ok? 

Alternative solution is that these methods can open dialogs if default logger is set, or I can have another logger used only in these two methods? What do you think?

2. In ProgressManager method crateChangeListener(). There is JobChangeAdapter and done() method. Is FinishedJobs.getInstance().remove(info) ok? Or maybe I have to remove JobInfo from FinishedJobs using commented code with iterator?
Comment 3 Szymon Brandys CLA 2006-12-06 07:13:04 EST
Created attachment 55116 [details]
The Handling in Jobs, JFace and parts opening
Comment 4 Tod Creasey CLA 2006-12-06 08:42:12 EST
1) No - the Policy class will need to open dialogs in the JFace case
2)IDEWorkbenchErrorHandler is using a UI Job. Either make this a system job or externalize the name as it will show up in the progress view. I would make it a system job.
3)You have several new methods with no comments. All methods need to be commented (see ErrorEditorPart for instance).
4) You might want to use a utility class to do handleException and handleStatus rather than the plug-in. Maybe in StatusUtil or something you have in your new code.
5)We need to remove the commented out code in the ProgressManager of course but thanks for the explanation.
We should not play with FinishedJobs with anything more than remove(info). If there is some tidying up we can do it.
6) Why did

	jobs.remove(event.getJob());
				// Only refresh if we are showing it
				removeJobInfo(info);

get moved up? I want to be sure there is not anything subtle about moving this - I wrote the code so long ago that I am always concerned about changes for no reason.
Comment 5 Szymon Brandys CLA 2006-12-06 09:11:51 EST
4) You might want to use a utility class to do handleException and handleStatus
> rather than the plug-in. Maybe in StatusUtil or something you have in your new
> code.

If we put it to the WorkbenchPlugin we can use it like log() methods
and we don't have to care about pluginId. 

> 5)We need to remove the commented out code in the ProgressManager of course but
> thanks for the explanation.
> We should not play with FinishedJobs with anything more than remove(info). If
> there is some tidying up we can do it.

ok

> 6) Why did
> 
>         jobs.remove(event.getJob());
>                                 // Only refresh if we are showing it
>                                 removeJobInfo(info);
> 
> get moved up? I want to be sure there is not anything subtle about moving this
> - I wrote the code so long ago that I am always concerned about changes for no
> reason.
>

It is because this adds jobs to the FinishedJobs. If want to remove jobs from
FinishedJobs, we have to have

jobs.remove(event.getJob());
// Only refresh if we are showing it
removeJobInfo(info);

first.
Comment 6 Tod Creasey CLA 2006-12-06 09:21:35 EST
>If we put it to the WorkbenchPlugin we can use it like log() methods
>and we don't have to care about pluginId. 

log() is API defined on Plugin. The only code that accesses the WorkbenchPlugin is workbench code so there is no need for any symettry as it is not API.

The other comments are good for me. Looks like you found a bug in the ProgressManager.
Comment 7 Szymon Brandys CLA 2006-12-06 11:13:54 EST
Created attachment 55142 [details]
The Handling in Jobs, JFace and parts opening
Comment 8 Szymon Brandys CLA 2006-12-06 11:20:48 EST
Created attachment 55143 [details]
The Handling in Jobs, JFace and parts opening
Comment 9 Tod Creasey CLA 2006-12-06 15:03:20 EST
Point 2 is an issue but otherwise this looks OK for me. Fix that up and we'll have Paul take a look.
Comment 10 Tod Creasey CLA 2006-12-06 16:18:19 EST
I took the liberty of externalizing the status string in the IDEExceptionHandler as it wasn't clear to me that the user would never see it but I have otherwise released the patch.

Szymon please find something Paul can look at as these time critical fixes always end up committed by me.
Comment 11 Michael Valenta CLA 2006-12-20 12:26:39 EST
This fix caused a major regression. See bug 168720 for the details. A temporary fix has been released to HEAD.