Bug 314842 - NumericTextRidget updateFromModel fails
Summary: NumericTextRidget updateFromModel fails
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 2.0.0   Edit
Assignee: Christian Campo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-28 07:18 EDT by Christian Campo CLA
Modified: 2010-05-28 13:27 EDT (History)
4 users (show)

See Also:


Attachments
patch that fixes the problem described under a) (1.55 KB, patch)
2010-05-28 07:24 EDT, Christian Campo CLA
no flags Details | Diff
patch that fixes usecase b) (961 bytes, patch)
2010-05-28 07:46 EDT, Christian Campo CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Campo CLA 2010-05-28 07:18:54 EDT
The method updateFromModel fails in certain cases:

NumericTextRidget numericText = getRidget(INumericTextRidget.class,"amount");

a) numericText.updateFromModel() and no model is bound, that should silently do nothing.....

creates NPE like this:
Caused by: java.lang.NullPointerException
 at org.eclipse.riena.internal.ui.ridgets.swt.NumericTextRidget.checkValue(NumericTextRidget.java:490)
 at org.eclipse.riena.internal.ui.ridgets.swt.NumericTextRidget.updateFromModel(NumericTextRidget.java:412)
 at org.eclipse.riena.navigation.ui.controllers.SubModuleController.updateAllRidgetsFromModel(SubModuleController.java:241)

b) numericText.bindToModel(new WritableValue());

creates NPE like this:
java.lang.NullPointerException
 at java.lang.Class.isAssignableFrom(Native Method)
 at org.eclipse.riena.ui.ridgets.swt.ToStringConverterFactory.createNumberConverter(ToStringConverterFactory.java:38)
 at org.eclipse.riena.internal.ui.ridgets.swt.NumericTextRidget.getConverter(NumericTextRidget.java:262)
 at org.eclipse.riena.internal.ui.ridgets.swt.NumericTextRidget.checkValue(NumericTextRidget.java:492)
 at org.eclipse.riena.internal.ui.ridgets.swt.NumericTextRidget.updateFromModel(NumericTextRidget.java:412)
 at org.eclipse.riena.navigation.ui.controllers.SubModuleController.updateAllRidgetsFromModel(SubModuleController.java:241)
Comment 1 Christian Campo CLA 2010-05-28 07:24:06 EDT
Created attachment 170328 [details]
patch that fixes the problem described under a)
Comment 2 Christian Campo CLA 2010-05-28 07:33:27 EDT
@Elias: can you please review the first patch (it
Comment 3 Christian Campo CLA 2010-05-28 07:34:46 EDT
@Elias can please review patch #1 which should fix usecase a)
Comment 4 Christian Campo CLA 2010-05-28 07:44:29 EDT
usecase b) is actually
numericText.bindToModel(new WritableValue());
numericText.updateFromModel();
Comment 5 Christian Campo CLA 2010-05-28 07:46:35 EDT
Created attachment 170329 [details]
patch that fixes usecase b)
Comment 6 Christian Campo CLA 2010-05-28 07:48:27 EDT
@elias can you please also review patch b). If you find both ok (they are both already in CVS), please close the bug. thanks
Comment 7 Elias Volanakis CLA 2010-05-28 13:26:45 EDT
Looks ok to me.