Update of /var/cvs/src/org/mmbase/datatypes
In directory james.mmbase.org:/tmp/cvs-serv4879
Modified Files:
BasicDataType.java
Log Message:
could give CCE when using toType
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.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- BasicDataType.java 1 Dec 2008 18:15:34 -0000 1.102
+++ BasicDataType.java 8 Feb 2009 21:15:13 -0000 1.103
@@ -40,7 +40,7 @@
* @author Pierre van Rooden
* @author Michiel Meeuwissen
* @since MMBase-1.8
- * @version $Id: BasicDataType.java,v 1.102 2008/12/01 18:15:34 michiel Exp $
+ * @version $Id: BasicDataType.java,v 1.103 2009/02/08 21:15:13 michiel Exp $
*/
public class BasicDataType<C> extends AbstractDescriptor implements
DataType<C>, Comparable<DataType<C>>, Descriptor {
@@ -309,7 +309,7 @@
try {
return cast(value, cloud, node, field);
} catch (CastException ce) {
- log.service(ce);
+ log.service(ce.getMessage(), ce);
return Casting.toType(classType, cloud, preCast(value, cloud,
node, field));
}
}
@@ -1289,7 +1289,14 @@
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);
+ return (D) Casting.unWrap(res);
+
+ // Used to be this, but that give CCE if type unrecognized
+ //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