summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/util/ReflectTools.java
diff options
context:
space:
mode:
authorTaras Hupalo <taras.hupalo@gmail.com>2014-09-16 16:28:55 +0300
committerVaadin Code Review <review@vaadin.com>2014-09-19 09:43:02 +0000
commit23d87699945d7fd773f71cf923bc173616608907 (patch)
tree56cb366e6dbabaa875198b98427d561a00394d43 /server/src/com/vaadin/util/ReflectTools.java
parent0c6829673d1b51cce136c47beb4a080a4d82f7be (diff)
downloadvaadin-framework-23d87699945d7fd773f71cf923bc173616608907.tar.gz
vaadin-framework-23d87699945d7fd773f71cf923bc173616608907.zip
Made MethodPropertyDescriptor box primitive types as it's done in MethodProperty (#14659)
Change-Id: I75ee98c36bf57483025157d0bd2039e3f6553aec
Diffstat (limited to 'server/src/com/vaadin/util/ReflectTools.java')
-rw-r--r--server/src/com/vaadin/util/ReflectTools.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/src/com/vaadin/util/ReflectTools.java b/server/src/com/vaadin/util/ReflectTools.java
index f56a68f223..fa34a670bf 100644
--- a/server/src/com/vaadin/util/ReflectTools.java
+++ b/server/src/com/vaadin/util/ReflectTools.java
@@ -186,4 +186,28 @@ public class ReflectTools implements Serializable {
}
field.set(object, value);
}
+
+ public static Class<?> convertPrimitiveType(Class<?> type) {
+ // Gets the return type from get method
+ if (type.isPrimitive()) {
+ if (type.equals(Boolean.TYPE)) {
+ type = Boolean.class;
+ } else if (type.equals(Integer.TYPE)) {
+ type = Integer.class;
+ } else if (type.equals(Float.TYPE)) {
+ type = Float.class;
+ } else if (type.equals(Double.TYPE)) {
+ type = Double.class;
+ } else if (type.equals(Byte.TYPE)) {
+ type = Byte.class;
+ } else if (type.equals(Character.TYPE)) {
+ type = Character.class;
+ } else if (type.equals(Short.TYPE)) {
+ type = Short.class;
+ } else if (type.equals(Long.TYPE)) {
+ type = Long.class;
+ }
+ }
+ return type;
+ }
}