diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-23 10:32:07 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-23 10:32:29 +0300 |
commit | fad5360a76b9f4f93b99f9775ad01997899859ab (patch) | |
tree | faae0c67294eb255c8311ff80bd165db066641b4 /server | |
parent | 034304bda81dfe65725c37a6eae3fbcdf7496082 (diff) | |
download | vaadin-framework-fad5360a76b9f4f93b99f9775ad01997899859ab.tar.gz vaadin-framework-fad5360a76b9f4f93b99f9775ad01997899859ab.zip |
Make getStateType() find for protected getState methods (#9315)
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/terminal/AbstractClientConnector.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java index a8da553a62..1025297a4f 100644 --- a/server/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/server/src/com/vaadin/terminal/AbstractClientConnector.java @@ -187,7 +187,16 @@ public abstract class AbstractClientConnector implements ClientConnector { @Override public Class<? extends SharedState> getStateType() { try { - Method m = getClass().getMethod("getState", (Class[]) null); + Method m = null; + Class<?> class1 = getClass(); + while (m == null && class1 != null) { + m = class1.getDeclaredMethod("getState", (Class[]) null); + class1 = class1.getSuperclass(); + } + if (m == null) { + throw new NoSuchMethodException(getClass().getCanonicalName() + + ".getState()"); + } Class<?> type = m.getReturnType(); return type.asSubclass(SharedState.class); } catch (Exception e) { |