Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 283835 - Not all items in a Combobox are shown, if one item is null
Summary: Not all items in a Combobox are shown, if one item is null
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 1.2.0.M2   Edit
Assignee: Elias Volanakis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-17 08:22 EDT by Steffen Kriese CLA
Modified: 2009-08-26 18:09 EDT (History)
2 users (show)

See Also:


Attachments
throw NullPointerException in ComboRidget (1.03 KB, patch)
2009-07-17 08:23 EDT, Steffen Kriese CLA
no flags Details | Diff
Added improved Patch + Testcase (4.52 KB, patch)
2009-08-04 08:28 EDT, Steffen Kriese CLA
elias: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Kriese CLA 2009-07-17 08:22:07 EDT
A ComboRidget gets bound to a model. If no rendering-Method is provided, the toString-Methode will be used for rendering the items. If one of the items in the model is null, all following items will not be displayed. 
In this case the ComboRidget should throw a NullPointerException, otherwise the developer might be confused.
Comment 1 Steffen Kriese CLA 2009-07-17 08:23:55 EDT
Created attachment 141874 [details]
throw NullPointerException in ComboRidget
Comment 3 Christian Campo CLA 2009-07-20 08:40:14 EDT
please ignore previous url. it points to a private bugzilla and was added by error
Comment 4 Christian Campo CLA 2009-07-22 03:02:36 EDT
patch is committed, thanks Steffen
Comment 5 Christian Campo CLA 2009-07-22 03:03:00 EDT
closing bug
Comment 6 Elias Volanakis CLA 2009-08-03 18:15:48 EDT
Reopening, because there is a problem with the patch:

String.valueOf(valueObject) never returns null. If value object is null it will return "null", so the NullPointerException in the added code will never be thrown:

+		String returnValue = String.valueOf(valueObject);
+
+		if (null == returnValue) {
+			throw new NullPointerException("Value in model is null");
+		}

It would also be nice to have a test case or snippet reproducing the issue described in the bugzilla.
Comment 7 Steffen Kriese CLA 2009-08-04 08:28:59 EDT
Created attachment 143384 [details]
Added improved Patch + Testcase
Comment 8 Elias Volanakis CLA 2009-08-26 17:27:26 EDT
Steffen, thanks for the updated patch! I've committed it.

Steffen+Thorsten: one thing to be aware of is that on 'production' conditions the exception will be written straight into the log, but to be shown on the console. This happens when launching _without_ -consolelog in the 'program arguments' and _with_ -Driena.development=false in the 'VM Arguments'. If this is a problem please reopen.