From 17d36c13a6743370ba2dc1c9ed3d8461b795d182 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Fri, 3 Jan 2014 09:03:11 +0000 Subject: [PATCH] Fixed/ignored unnecessary warnings. refs #3552 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28588 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../factories/OptionalRelatedElementsRuleFactory.java | 3 ++- .../src/org/simantics/objmap/rules/range/FieldAccessor.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/OptionalRelatedElementsRuleFactory.java b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/OptionalRelatedElementsRuleFactory.java index 20692388..e1974fec 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/OptionalRelatedElementsRuleFactory.java +++ b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/OptionalRelatedElementsRuleFactory.java @@ -13,6 +13,7 @@ package org.simantics.objmap.annotations.factories; import java.lang.annotation.Annotation; import java.lang.reflect.Field; +import java.util.Collection; import java.util.Collections; import org.simantics.db.ReadGraph; @@ -34,7 +35,7 @@ public class OptionalRelatedElementsRuleFactory implements IFieldRuleFactory { return new MappedElementsRule( new RelatedObjectsAccessor(g.getResource(annotation.value()), annotation.composition()), - new FieldAccessorWithDefault(field, Collections.emptyList()) + new FieldAccessorWithDefault>(field, Collections.emptyList()) ); } diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java index 53d0d875..e731e3e9 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java @@ -33,7 +33,8 @@ public class FieldAccessor implements IRangeAccessor { @Override public T get(Object element) throws MappingException { try { - T result = (T)field.get(element); + @SuppressWarnings("unchecked") + T result = (T)field.get(element); if(LOGGER.isInfoEnabled()) LOGGER.info(" FieldAccessor.get " + -- 2.47.1