From e830e0af318d4d5bfb09cd3b28597b5fc7575e36 Mon Sep 17 00:00:00 2001
From: Artur Signell <artur.signell@itmill.com>
Date: Mon, 8 Jun 2009 19:08:18 +0000
Subject: Fix for #3051 - MethodProperty serialization broken when setter or
 getter is null

svn changeset:8156/svn branch:6.0
---
 src/com/vaadin/data/util/MethodProperty.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/com/vaadin/data/util/MethodProperty.java b/src/com/vaadin/data/util/MethodProperty.java
index f74e84ea93..87915bda88 100644
--- a/src/com/vaadin/data/util/MethodProperty.java
+++ b/src/com/vaadin/data/util/MethodProperty.java
@@ -103,14 +103,12 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
             out.writeObject(setMethod.getParameterTypes());
         } else {
             out.writeObject("");
-            out.writeObject("");
         }
         if (getMethod != null) {
             out.writeObject(getMethod.getName());
             out.writeObject(getMethod.getParameterTypes());
         } else {
             out.writeObject("");
-            out.writeObject("");
         }
     };
 
@@ -123,15 +121,16 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
             setArgs = (Object[]) in.readObject();
             getArgs = (Object[]) in.readObject();
             String name = (String) in.readObject();
-            Class<?>[] paramTypes = (Class<?>[]) in.readObject();
             if (name != null && !name.equals("")) {
+                Class<?>[] paramTypes = (Class<?>[]) in.readObject();
                 setMethod = instance.getClass().getMethod(name, paramTypes);
             } else {
                 setMethod = null;
             }
+
             name = (String) in.readObject();
-            paramTypes = (Class<?>[]) in.readObject();
             if (name != null && !name.equals("")) {
+                Class<?>[] paramTypes = (Class<?>[]) in.readObject();
                 getMethod = instance.getClass().getMethod(name, paramTypes);
             } else {
                 getMethod = null;
-- 
cgit v1.2.3