]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fix warnings from newly added code 46/2246/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 26 Sep 2018 10:42:14 +0000 (13:42 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 26 Sep 2018 10:42:14 +0000 (13:42 +0300)
gitlab #96

Change-Id: Id2d7791ff5e471727f5b11ca7430c32c2bee415c

bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java
bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBaseData.java

index e1d8b1fbf7e67e043c8af93202f03d95747d9216..9978076c641abd89d207c86610f664c609fc1b0b 100644 (file)
@@ -76,6 +76,7 @@ public abstract class StyleBase<Result> implements Style {
         this.identity = getClass();
     }
 
+    @SuppressWarnings("unchecked")
     protected <T> T getIdentity() {
         return (T)identity;
     }
@@ -96,7 +97,7 @@ public abstract class StyleBase<Result> 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;
index ca97fea784d3a35c3449fb8598fe611dbf4c5b6e..074f9239215f26479f1af04c743bc96a982e28d7 100644 (file)
@@ -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> 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<Resource> rs = removals.remove(s);
         if (rs == null)
             return;