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

Bug 364632

Summary: remove invocations to StatusHandler.fail()
Product: z_Archived Reporter: annoynimouse <the_Arioch>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: robert.munteanu
Version: unspecified   
Target Milestone: 3.7   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
window resize is only handled in Width
none
mylyn/context/zip none

Description annoynimouse CLA 2011-11-23 12:46:25 EST
Screenshot shows error working with beta Mantis.

The very error is probably okay, but how the dialog reported it is not nice.
Comment 1 annoynimouse CLA 2011-11-23 12:47:49 EST
Created attachment 207436 [details]
window resize is only handled in Width
Comment 2 Steffen Pingel CLA 2011-11-24 06:09:19 EST
That error dialog should not be used anymore. I would recommend replacing that with the standard JFace error manager handling. Robert, are there calls to StatusHandler.fail() in the Mantis code?
Comment 3 Robert Munteanu CLA 2011-11-24 06:23:43 EST
(In reply to comment #2)
> That error dialog should not be used anymore. I would recommend replacing that
> with the standard JFace error manager handling. Robert, are there calls to
> StatusHandler.fail() in the Mantis code?

There are no such calls in the Mantis connector plugin. The error most likely originates from MantisAttachmentHandler(extends AbstractTaskAttachmentHandler).getContent , which is invoked from Mylyn itself only and which throws a CoreException on error.

annoynimouse, how did you try to download the attachment?
Comment 4 annoynimouse CLA 2011-11-24 06:52:40 EST
http://issuetracker.delphi-jedi.org/view.php?id=5716

i opened that ticket inside Mylin, r-clicked on attachment, choosen Save To, selected folder, then Mylin tryed to get file from server and then broken.
Comment 5 Robert Munteanu CLA 2011-11-24 06:58:08 EST
(In reply to comment #4)
> http://issuetracker.delphi-jedi.org/view.php?id=5716
> 
> i opened that ticket inside Mylin, r-clicked on attachment, choosen Save To,
> selected folder, then Mylin tryed to get file from server and then broken.

Thanks for the info. 

Steffen, the Mantis plugin does not intercept the error in any way to display it. Unless we should not throw a CoreException in case of error, I don't know what we should do.
Comment 6 Steffen Pingel CLA 2011-11-24 07:28:19 EST
There are indeed a bunch of places in the Mylyn framework that still go through this deprecated mechanism. I'll take a pass through the code to get rid of them. Thanks for looking into this and sorry for the noise.
Comment 7 Robert Munteanu CLA 2011-11-24 07:35:42 EST
No problem, thanks for confirming that there's no disfunctionality in the connector.
Comment 8 annoynimouse CLA 2011-11-27 15:30:59 EST
1) if the deprecated mechanism is not to be used - why just not remove it completely. The code that fail to compile is exactly the code you want to find and rework.

2) if it so deprecated, then you're making program that works with bugtrackers.
Make deprecated annotation inject the code, that would generate stack trace and submit it as bug. Thus you would not break compilation immediately but would have database with statistics which code and how often goes this deprecated pathway
Comment 9 annoynimouse CLA 2011-12-08 18:00:28 EST
 bit of offtopic, if i may.
 
Eclipse shows "Steps to reproduce" field, yet this field is not shown in WWW at that Mantis.
 
Does this field exists in stable mantis default installations ?

It seems like bug either in the Mantis brigde, in given Mantis version or in given Mantis configuration.

At least i had a confusion, when i entered report, and few days later by blind chance found that half the report was not registered, as it was in the "Steps to Reproduce" field, and Eclipse gave no error to me, that the field content would be not readable by WWW readers (all the readers except for myself)
Comment 10 Robert Munteanu CLA 2011-12-08 18:10:52 EST
(In reply to comment #9)
> bit of offtopic, if i may.
> 
> Eclipse shows "Steps to reproduce" field, yet this field is not shown in WWW at
> that Mantis.
> 
> Does this field exists in stable mantis default installations ?
> 
> It seems like bug either in the Mantis brigde, in given Mantis version or in
> given Mantis configuration.
> 
> At least i had a confusion, when i entered report, and few days later by blind
> chance found that half the report was not registered, as it was in the "Steps to
> Reproduce" field, and Eclipse gave no error to me, that the field content would
> be not readable by WWW readers (all the readers except for myself)

Please follow this up on the Mylyn-Mantis forums at https://sourceforge.net/apps/phpbb/mylyn-mantis/ , there's no sense in discussing in an unrelated bug report.

Also, 'Steps to reproduce' is a core MantisBT field for which there is to setting to globally disable.
Comment 11 Steffen Pingel CLA 2011-12-10 20:57:27 EST
I have remove invocations to StatusHandler.fail() and deprecated the method.

Need to review usage of RepositoryStatus.ERROR_INTERNAL next.
Comment 12 Steffen Pingel CLA 2011-12-12 11:47:17 EST
I have decided to leave RepositoryStatus.ERROR_INTERNAL but it's no longer handled using StatusHandler.fail() but using the standard error dialog.
Comment 13 Steffen Pingel CLA 2011-12-12 11:47:20 EST
Created attachment 208270 [details]
mylyn/context/zip