diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2017-05-17 10:36:02 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-05-17 14:29:46 +0300 |
commit | b829146be06147fb03e644f88a18b29488f745af (patch) | |
tree | 7dab022ffd1c10f00f6e77af71861256f12021a9 /client | |
parent | 21c54c9228a63ac6c199b0a70603a72f6041586a (diff) | |
download | vaadin-framework-b829146be06147fb03e644f88a18b29488f745af.tar.gz vaadin-framework-b829146be06147fb03e644f88a18b29488f745af.zip |
Remove deprecation from setTag and throw on subsequent calls
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ServerConnector.java | 9 | ||||
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/AbstractConnector.java | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/client/src/main/java/com/vaadin/client/ServerConnector.java b/client/src/main/java/com/vaadin/client/ServerConnector.java index 71d65732bb..ba1b81205c 100644 --- a/client/src/main/java/com/vaadin/client/ServerConnector.java +++ b/client/src/main/java/com/vaadin/client/ServerConnector.java @@ -221,19 +221,20 @@ public interface ServerConnector extends Connector { * Sets the connector type tag for this connector. This should only be * called from * {@link WidgetSet#createConnector(int, ApplicationConfiguration)} + * <p> + * <strong>Note:</strong> This method is intended for internal use only. * * @see #getTag() * * @param tag * the connector type tag * - * @deprecated This is an internal method and should not be called by an - * application developer. + * @throws IllegalStateException + * if {@code tag} has already been set * * @since 8.1 */ - @Deprecated - public void setTag(int tag); + public void setTag(int tag) throws IllegalStateException; /** * Gets the connector type tag for this connector. This type tag is an diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java index f7bdf80ee0..7269a03df6 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java @@ -61,7 +61,7 @@ public abstract class AbstractConnector private ApplicationConnection connection; private String id; - private int tag; + private int tag = -1; private HandlerManager handlerManager; private FastStringMap<HandlerManager> statePropertyHandlerManagers; @@ -532,6 +532,10 @@ public abstract class AbstractConnector @Override public void setTag(int tag) { + if (this.tag >= 0) { + throw new IllegalStateException( + "Tag already set for this " + getClass().getSimpleName()); + } this.tag = tag; } } |