summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-04-17 11:08:52 +0000
committerArtur Signell <artur.signell@itmill.com>2009-04-17 11:08:52 +0000
commit38ebfd1a0edb1cc8f16c9138cc714b8671a544a9 (patch)
treebed731981b5f9226237688c615d956bcab4a0d2d /src/com/itmill/toolkit
parent43e9f8f1181d8e00926eb959cc54995f6f9c94da (diff)
downloadvaadin-framework-38ebfd1a0edb1cc8f16c9138cc714b8671a544a9.tar.gz
vaadin-framework-38ebfd1a0edb1cc8f16c9138cc714b8671a544a9.zip
Additional fix for #695 - Serialization support: Fixed NPE in MethodProperty
svn changeset:7457/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit')
-rw-r--r--src/com/itmill/toolkit/data/util/MethodProperty.java30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/data/util/MethodProperty.java b/src/com/itmill/toolkit/data/util/MethodProperty.java
index 9d74175b2c..e8f220be79 100644
--- a/src/com/itmill/toolkit/data/util/MethodProperty.java
+++ b/src/com/itmill/toolkit/data/util/MethodProperty.java
@@ -98,10 +98,20 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
out.writeObject(instance);
out.writeObject(setArgs);
out.writeObject(getArgs);
- out.writeObject(setMethod.getName());
- out.writeObject(setMethod.getParameterTypes());
- out.writeObject(getMethod.getName());
- out.writeObject(getMethod.getParameterTypes());
+ if (setMethod != null) {
+ out.writeObject(setMethod.getName());
+ 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("");
+ }
};
/* Special serialization to handle method references */
@@ -114,10 +124,18 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
getArgs = (Object[]) in.readObject();
String name = (String) in.readObject();
Class<?>[] paramTypes = (Class<?>[]) in.readObject();
- setMethod = instance.getClass().getMethod(name, paramTypes);
+ if (name != null && !name.equals("")) {
+ setMethod = instance.getClass().getMethod(name, paramTypes);
+ } else {
+ setMethod = null;
+ }
name = (String) in.readObject();
paramTypes = (Class<?>[]) in.readObject();
- getMethod = instance.getClass().getMethod(name, paramTypes);
+ if (name != null && !name.equals("")) {
+ getMethod = instance.getClass().getMethod(name, paramTypes);
+ } else {
+ getMethod = null;
+ }
} catch (SecurityException e) {
System.err.println("Internal deserialization error");
e.printStackTrace();