Update of /var/cvs/src/org/mmbase/module/corebuilders In directory james.mmbase.org:/tmp/cvs-serv11832
Modified Files: TypeDef.java Log Message: it's a mystery to me, why they did not simply made the substring method conveniently useable See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/module/corebuilders Index: TypeDef.java =================================================================== RCS file: /var/cvs/src/org/mmbase/module/corebuilders/TypeDef.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -b -r1.75 -r1.76 --- TypeDef.java 8 Feb 2008 09:03:48 -0000 1.75 +++ TypeDef.java 8 Feb 2008 10:40:20 -0000 1.76 @@ -32,7 +32,7 @@ * * @author Daniel Ockeloen * @author Pierre van Rooden - * @version $Id: TypeDef.java,v 1.75 2008/02/08 09:03:48 michiel Exp $ + * @version $Id: TypeDef.java,v 1.76 2008/02/08 10:40:20 michiel Exp $ */ public class TypeDef extends MMObjectBuilder { @@ -135,7 +135,10 @@ } // Quick fix around MMB-1590. Perhaps it should be solved more genericly, closer to the // storage layer. - node.setValue("description", node.getStringValue("description").substring(0, getField("description").getMaxLength())); + String desc = node.getStringValue("description"); + if (desc.length() > getField("description").getMaxLength()) { + node.setValue("description", desc.substring(0, getField("description").getMaxLength())); + } // try if the builder was already in TypeDef for some reason // this can happen when another thread was here first _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs