From fad5360a76b9f4f93b99f9775ad01997899859ab Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 23 Aug 2012 10:32:07 +0300 Subject: Make getStateType() find for protected getState methods (#9315) --- server/src/com/vaadin/terminal/AbstractClientConnector.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 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) { -- cgit v1.2.3