Author: michiel
Date: 2010-04-01 11:43:43 +0200 (Thu, 01 Apr 2010)
New Revision: 41714

Modified:
   
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/BasicDataType.java
Log:
added serialVersionUID, and a catch to make rmmci 1.9.3 work with server 1.9.2

Modified: 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/BasicDataType.java
===================================================================
--- 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/BasicDataType.java
       2010-04-01 09:13:12 UTC (rev 41713)
+++ 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/BasicDataType.java
       2010-04-01 09:43:43 UTC (rev 41714)
@@ -154,7 +154,11 @@
         handlers              = (Map<String, Handler<?>>) in.readObject();
         restrictions          = (Collection<Restriction<?>>) in.readObject();
         unmodifiableRestrictions = 
Collections.unmodifiableCollection(restrictions);
-        defaultProcessor      = (Processor) in.readObject();
+        try {
+            defaultProcessor      = (Processor) in.readObject();
+        } catch (OptionalDataException ode) {
+            log.service(ode.getClass() + " " + ode.getMessage() +  " (remote 
version probably not supporting defaultProcessor yet (< 1.9.3))");
+        }
     }
 
     public String getBaseTypeIdentifier() {
@@ -1102,6 +1106,7 @@
      * cloning in java</a>
      */
     protected static abstract class StaticAbstractRestriction<D extends 
Serializable>  implements DataType.Restriction<D> {
+        private static final long serialVersionUID = -1921261633989010854L;
         protected final String name;
         protected final BasicDataType<?> parent;
         protected LocalizedString errorDescription;
@@ -1504,7 +1509,10 @@
         protected <D> D preCast(D v, Cloud cloud) {
             if (getValue() == null) return v;
             try {
-                if (v == null) return null;
+                if (v == null) {
+                    return null;
+                }
+
                 Object res = value.castKey(v, cloud);
                 // type may have changed (to some value wrapper). Undo that:
                 return (D) Casting.unWrap(res);
@@ -1522,6 +1530,7 @@
             if (value == null || value.isEmpty()) {
                 return true;
             }
+
             Cloud cloud = BasicDataType.this.getCloud(node, field);
             Collection<Map.Entry<C, String>> validValues = 
getEnumeration(null, cloud, node, field);
             if (validValues.size() == 0) {
@@ -1562,7 +1571,7 @@
                 }
             }
             if (i < col.size()) {
-                buf.append(".(" + col.size() + " " + (col.size() - i) + " more 
..");
+                buf.append(".(" + (col.size() - i) + " more ..)");
             }
             return buf.toString();
         }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to