Author: chris.laprun(a)jboss.com
Date: 2010-01-12 19:35:49 -0500 (Tue, 12 Jan 2010)
New Revision: 1242
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java
Log:
- Contract for getRendererFor is to always return a renderer.
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java 2010-01-12
22:48:45 UTC (rev 1241)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java 2010-01-13
00:35:49 UTC (rev 1242)
@@ -28,7 +28,9 @@
import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -61,7 +63,7 @@
{
if (value == null)
{
- return null;
+ return ValueRenderer.NULL_RENDERER;
}
else
{
@@ -99,7 +101,7 @@
// the type class is a super class of the valueType class
// This cast is OK
@SuppressWarnings("unchecked")
- ValueRenderer<? super V> tmp = (ValueRenderer<? super V>)
entry.getValue();
+ ValueRenderer<? super V> tmp = (ValueRenderer<? super
V>)entry.getValue();
renderer = tmp;
// OK
@@ -168,7 +170,7 @@
{
// this cast is OK
@SuppressWarnings("unchecked")
- ValueRenderer<? super V> renderer = (ValueRenderer<? super V>)
renderers.get(valueType);
+ ValueRenderer<? super V> renderer = (ValueRenderer<? super
V>)renderers.get(valueType);
return renderer;
}
}
Show replies by date