Bug 27291 - [Dialogs] Error dialog looks bad if status message is null
Summary: [Dialogs] Error dialog looks bad if status message is null
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-28 05:06 EST by Dani Megert CLA
Modified: 2003-02-07 09:32 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2002-11-28 05:06:36 EST
I20021127

Sometime the error dialogs (org.eclipse.jface.dialogs.ErrorDialog) show up like

Reason:
   null

This is because the error dialog adds the message contained in the status
without checking for null. I suggest to test for null and if it is null and the
status has an exception then use
status.getException().toString();

I agree that seeing an exception class name e.g. CharEncodingException is bad -
but I prefer it a 100 times over seeing null (or nothing except "Error") in the UI.
Comment 1 Tod Creasey CLA 2002-12-05 11:07:37 EST
It is not possible within the API for Status to create one with a null value 
(see Status setMessage() which does an assert check for null). The real issue 
here is that it is possible to create a Status with a method of null - where 
did this happen?
Comment 2 Dani Megert CLA 2002-12-05 11:32:30 EST
JavaModelStatus.getMessage returns null.
Seems that this violates the API spec.
Comment 3 Tod Creasey CLA 2002-12-05 11:41:39 EST
Marking as Worksforme as you cannot have a status with a null message.
Comment 4 Dani Megert CLA 2002-12-05 11:50:49 EST
Reopening and moving to JCore:
Platform UI correctly claims that null message is illegal according to API of
IStatus.getMessage
Comment 5 Philipe Mulet CLA 2002-12-12 17:28:00 EST
Pls investigate.
Comment 6 Jerome Lanneluc CLA 2003-01-24 09:12:47 EST
Made change suggested by Dani.
Comment 7 David Audel CLA 2003-02-07 09:32:02 EST
Verified.