diff options
author | Leif Åstrand <leif@vaadin.com> | 2014-12-04 21:38:09 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-12-07 18:49:17 +0000 |
commit | a44f7cbfd83d180f3dd437f0aeb04906ab19dad6 (patch) | |
tree | 4efdff79ef5e5b939fc8d074064e803965ef8024 /client-compiler | |
parent | 3ab4ceaacbb2b38cba8def46e63859ebf0b5746e (diff) | |
download | vaadin-framework-a44f7cbfd83d180f3dd437f0aeb04906ab19dad6.tar.gz vaadin-framework-a44f7cbfd83d180f3dd437f0aeb04906ab19dad6.zip |
Show better feedback if renderer connector is not parameterized (#13334)
Change-Id: Ica9281e254938443576fcd3c61197a50ceaa2d2e
Diffstat (limited to 'client-compiler')
-rw-r--r-- | client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java index 6c6d6d116c..4c356cda7f 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java @@ -17,8 +17,10 @@ package com.vaadin.server.widgetsetutils.metadata; import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.TreeLogger.Type; +import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; +import com.google.gwt.core.ext.typeinfo.JParameterizedType; import com.google.gwt.core.ext.typeinfo.JType; import com.vaadin.client.ui.grid.renderers.AbstractRendererConnector; @@ -43,7 +45,7 @@ public class RendererVisitor extends TypeVisitor { @Override public void visitConnector(TreeLogger logger, JClassType type, - ConnectorBundle bundle) { + ConnectorBundle bundle) throws UnableToCompleteException { if (ConnectorBundle.isConnectedRendererConnector(type)) { doRendererType(logger, type, bundle); doPresentationType(logger, type, bundle); @@ -75,20 +77,31 @@ public class RendererVisitor extends TypeVisitor { } private void doPresentationType(TreeLogger logger, JClassType type, - ConnectorBundle bundle) { - JType presentationType = getPresentationType(type); + ConnectorBundle bundle) throws UnableToCompleteException { + JType presentationType = getPresentationType(type, logger); bundle.setPresentationType(type, presentationType); logger.log(Type.DEBUG, "Presentation type of " + type + " is " + presentationType); } - private static JType getPresentationType(JClassType type) { + private static JType getPresentationType(JClassType type, TreeLogger logger) + throws UnableToCompleteException { JClassType originalType = type; while (type != null) { if (type.getQualifiedBinaryName().equals( AbstractRendererConnector.class.getName())) { - return type.isParameterized().getTypeArgs()[0]; + JParameterizedType parameterized = type.isParameterized(); + if (parameterized == null) { + logger.log( + Type.ERROR, + type.getQualifiedSourceName() + + " must define the generic parameter of the inherited " + + AbstractRendererConnector.class + .getSimpleName()); + throw new UnableToCompleteException(); + } + return parameterized.getTypeArgs()[0]; } type = type.getSuperclass(); } |