Bug 565499

Summary: StatusDialog shows nonsense "OK" error messages
Product: [Eclipse Project] Platform Reporter: Mattias Bertilsson <mattias>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: loskutov
Version: 4.16   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=560667
Whiteboard:
Attachments:
Description Flags
StatusDialog snippet
none
AddRepository dialog with "OK" (instead of empty error message) none

Description Mattias Bertilsson CLA 2020-07-23 13:55:21 EDT
Testing with 4.16 I notice the text "OK" in several StatusDialogs, where the error message would be if the dialogs had errors. Looks like the fix for bug 560667 is to blame, that removed the check for IStatus.isOK().

Since StatusDialog.updateStatus() does not accept null, I think providing Status.OK_STATUS is how the status message should be cleared, but it has its message set to (the localized equivalent of) "ok", not null, which means it will now be printed.
Comment 1 Andrey Loskutov CLA 2020-07-23 15:07:59 EDT
Could you provide steps to reproduce, or some screen shots? Of if you have a patch in mind, please push to gerrit.
Comment 2 Mattias Bertilsson CLA 2020-07-24 05:40:29 EDT
It doesn't show in platform's own StatusDialogs as they all seem to create new StatusInfos (which do have a null message by default), rather than reusing Status.OK_STATUS.

Anyway, the attached snippet shows the issue. In previous platform versions it has produced an empty dialog with OK / Cancel buttons. In 4.16 it produces a dialog with the text OK.

Not sure about the patch. If compatibility matters, both StatusDialog and SelectionStatusDialog need to keep their original behavior, so either they should not share the same MessageLine implementation, or MessageLine needs some flag to signal which behavior for OK status should be used.
Comment 3 Mattias Bertilsson CLA 2020-07-24 05:42:00 EDT
Created attachment 283691 [details]
StatusDialog snippet
Comment 4 Mattias Bertilsson CLA 2020-08-17 06:20:14 EDT
Created attachment 283882 [details]
AddRepository dialog with "OK" (instead of empty error message)

Looks like the AddRepository dialog (org.eclipse.equinox.internal.p2.ui.dialogs) uses Status.OK_STATUS to clear the StatusDialog error message and now gets "OK" instead.
Comment 5 Mattias Bertilsson CLA 2020-09-07 05:28:14 EDT
Same thing with the DependencyPropertiesDialog of the PDE.