From: Tuukka Lehtonen Date: Wed, 26 Sep 2018 10:42:14 +0000 (+0300) Subject: Fix warnings from newly added code X-Git-Tag: v1.43.0~136^2~355 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F2246%2F1;p=simantics%2Fplatform.git Fix warnings from newly added code gitlab #96 Change-Id: Id2d7791ff5e471727f5b11ca7430c32c2bee415c --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java index e1d8b1fbf..9978076c6 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java @@ -76,6 +76,7 @@ public abstract class StyleBase implements Style { this.identity = getClass(); } + @SuppressWarnings("unchecked") protected T getIdentity() { return (T)identity; } @@ -96,7 +97,7 @@ public abstract class StyleBase implements Style { return false; if (getClass() != obj.getClass()) return false; - StyleBase other = (StyleBase) obj; + StyleBase other = (StyleBase) obj; if (identity == null) { if (other.identity != null) return false; diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBaseData.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBaseData.java index ca97fea78..074f92392 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBaseData.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBaseData.java @@ -14,6 +14,10 @@ import org.simantics.scenegraph.profile.common.ObserverGroupListener; import org.simantics.scl.runtime.tuple.Tuple; import org.simantics.scl.runtime.tuple.Tuple3; +/** + * @author Antti Villberg + * @since 1.36.0 + */ public class StyleBaseData { private static StyleBaseData INSTANCE; @@ -46,6 +50,7 @@ public class StyleBaseData { values.put(t, o); } + @SuppressWarnings("unchecked") public T getValue(Tuple t) { return (T) values.get(t); } @@ -71,7 +76,7 @@ public class StyleBaseData { return listeners.get(key); } - public synchronized void applyRemovals(EvaluationContext evaluationContext, StyleBase s) { + public synchronized void applyRemovals(EvaluationContext evaluationContext, StyleBase s) { List rs = removals.remove(s); if (rs == null) return;