Update of /var/cvs/src/org/mmbase/module/corebuilders
In directory james.mmbase.org:/tmp/cvs-serv11777

Modified Files:
      Tag: MMBase-1_8
        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.68.2.3
retrieving revision 1.68.2.4
diff -u -b -r1.68.2.3 -r1.68.2.4
--- TypeDef.java        8 Feb 2008 09:01:11 -0000       1.68.2.3
+++ TypeDef.java        8 Feb 2008 10:39:28 -0000       1.68.2.4
@@ -32,7 +32,7 @@
  *
  * @author Daniel Ockeloen
  * @author Pierre van Rooden
- * @version $Id: TypeDef.java,v 1.68.2.3 2008/02/08 09:01:11 michiel Exp $
+ * @version $Id: TypeDef.java,v 1.68.2.4 2008/02/08 10:39:28 michiel Exp $
  */
 public class TypeDef extends MMObjectBuilder {
 
@@ -135,7 +135,10 @@
         } catch (Exception e) {
             throw new RuntimeException(e.getMessage(), e);
         }
-        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
         int result = getIntValue(node.getStringValue("name"));
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to