Update of /var/cvs/src/org/mmbase/datatypes
In directory james.mmbase.org:/tmp/cvs-serv4649
Modified Files:
BasicDataType.java
Log Message:
sometimes key-values were wrapped (because of sorting), this should however not
be reflected to outside
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/datatypes
Index: BasicDataType.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/BasicDataType.java,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- BasicDataType.java 15 Jul 2008 22:08:14 -0000 1.90
+++ BasicDataType.java 16 Jul 2008 09:33:43 -0000 1.91
@@ -40,7 +40,7 @@
* @author Pierre van Rooden
* @author Michiel Meeuwissen
* @since MMBase-1.8
- * @version $Id: BasicDataType.java,v 1.90 2008/07/15 22:08:14 michiel Exp $
+ * @version $Id: BasicDataType.java,v 1.91 2008/07/16 09:33:43 michiel Exp $
*/
public class BasicDataType<C> extends AbstractDescriptor implements
DataType<C>, Cloneable, Comparable<DataType<C>>, Descriptor {
@@ -1260,8 +1260,10 @@
protected <D> D preCast(D v, Cloud cloud) {
if (getValue() == null) return v;
try {
- return (D) value.castKey(v, cloud);
- //return v != null ? Casting.toType(v.getClass(), cloud, res)
: res;
+ if (v == null) return null;
+ Object res = value.castKey(v, cloud);
+ // type may have changed (to some value wrapper). Undo that:
+ return (D) Casting.toType(v.getClass(), cloud, res);
} catch (NoClassDefFoundError ncdfe) {
log.error("Could not find class " + ncdfe.getMessage() + "
while casting " + v.getClass() + " " + v, ncdfe);
return v;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs