Bug 27291

Summary: [Dialogs] Error dialog looks bad if status message is null
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.