From: lehtonen Date: Fri, 3 Jan 2014 09:03:11 +0000 (+0000) Subject: Fixed/ignored unnecessary warnings. X-Git-Tag: simantics-1.19.0~1 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=8a7e33547caeeca16a5dac5fec38371f722b91ff;p=simantics%2F3d.git Fixed/ignored unnecessary warnings. refs #3552 git-svn-id: https://www.simantics.org/svn/simantics/3d/trunk@28588 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java index 6d625abe..2120b50f 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java @@ -22,11 +22,8 @@ import org.simantics.objmap.bidirectional.IBidirectionalMappingRule; import org.simantics.objmap.graph.annotations.CompoundRelatedGetValue; import org.simantics.objmap.graph.annotations.CompoundRelatedSetValue; import org.simantics.objmap.graph.rules.ValueRule; -import org.simantics.objmap.graph.rules.adapters.IdentityAdapter; -import org.simantics.objmap.graph.rules.adapters.ValueAdapter; import org.simantics.objmap.graph.rules.domain.CompoundValueAccessor; import org.simantics.objmap.graph.rules.factory.IGetSetRuleFactory; -import org.simantics.objmap.graph.rules.range.AdaptedRangeAccessor; import org.simantics.objmap.graph.rules.range.CompoundGetSetValueAccessor; import org.simantics.objmap.graph.rules.range.IRangeAccessor; diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/OptionalRelatedElementsRuleFactory.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/OptionalRelatedElementsRuleFactory.java index 23ff1644..84b1134a 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/OptionalRelatedElementsRuleFactory.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/OptionalRelatedElementsRuleFactory.java @@ -37,7 +37,7 @@ public class OptionalRelatedElementsRuleFactory implements IFieldRuleFact return new MappedElementsRule( new RelatedObjectsAccessor(g.getResource(annotation.value()), annotation.composition()), - new FieldAccessorWithDefault>(field, (Collection)Collections.emptyList()) + new FieldAccessorWithDefault>(field, Collections.emptyList()) ); } diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/domain/CompoundValueAccessor.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/domain/CompoundValueAccessor.java index bdecbcde..4d29ac0a 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/domain/CompoundValueAccessor.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/domain/CompoundValueAccessor.java @@ -68,6 +68,7 @@ public class CompoundValueAccessor implements IDomainAccessor { try { Layer0 l0 = Layer0.getInstance(g); LOGGER.info(" CompoundValueAccessor.set"); + @SuppressWarnings("unchecked") Map values = (Map)v; Collection coll = g.getStatements(element, objRelation); diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/range/FieldAccessor.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/range/FieldAccessor.java index d4742d2f..4cd0f2e5 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/range/FieldAccessor.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/rules/range/FieldAccessor.java @@ -34,7 +34,8 @@ public class FieldAccessor implements IRangeAccessor { @Override public T get(Range 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 " + diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DefaultSchema.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DefaultSchema.java index e0797289..e5adac84 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DefaultSchema.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DefaultSchema.java @@ -84,6 +84,8 @@ public class DefaultSchema implements IMappingSchema { public ILinkType linkTypeOfRangeType(Class clazz) { ILinkType type = rangeLinkTypes.get(clazz); if(type == null) { + // FIXME: c is not referenced at all, should it be? + // TODO: should this method take inheritance into account ? for (Class c : clazz.getInterfaces()) { type = rangeLinkTypes.get(clazz); if (type != null) diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java index 4205f2c4..bc436288 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java @@ -69,7 +69,7 @@ public class DynamicSimpleLinkType extends SimpleLinkType{ public Resource createDomainElement(WriteGraph g, Range rangeElement) throws MappingException { try { - String typeUri = (String)typeGetter.invoke(rangeElement, null); + String typeUri = (String)typeGetter.invoke(rangeElement, (Object[]) null); if(LOGGER.isInfoEnabled()) LOGGER.info("SimpleLinkType.createDomainElement " + rangeElement.toString() diff --git a/org.simantics.objmap2/src/org/simantics/objmap/structural/annotations/factories/OptionalRelatedElementsRuleFactory.java b/org.simantics.objmap2/src/org/simantics/objmap/structural/annotations/factories/OptionalRelatedElementsRuleFactory.java index 41f6ac26..734b3cd7 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/structural/annotations/factories/OptionalRelatedElementsRuleFactory.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/structural/annotations/factories/OptionalRelatedElementsRuleFactory.java @@ -37,7 +37,7 @@ public class OptionalRelatedElementsRuleFactory implements IFieldRuleFact return new MappedElementsRule( new RelatedObjectsAccessor(g.getResource(annotation.value()), annotation.composition(),false), - new FieldAccessorWithDefault>(field, (Collection)Collections.emptyList()) + new FieldAccessorWithDefault>(field, Collections.emptyList()) ); } diff --git a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectsAccessor.java b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectsAccessor.java index b04a40d7..c56ffb6d 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectsAccessor.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedObjectsAccessor.java @@ -62,7 +62,7 @@ public class RelatedObjectsAccessor implements IDomainAccessor coll = g.getObjects(res, relation); List result = new ArrayList(coll.size()); for (Resource r : coll) { diff --git a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedOrderedSetElementsAccessor.java b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedOrderedSetElementsAccessor.java index c1164810..c9b63e4c 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedOrderedSetElementsAccessor.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/RelatedOrderedSetElementsAccessor.java @@ -45,7 +45,7 @@ public class RelatedOrderedSetElementsAccessor implements IDomainAccessor list = OrderedSetUtils.toList(g, res); List result = new ArrayList(list.size()); for (Resource r : list) { diff --git a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/StructuralRelatedObjectsAccessor.java b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/StructuralRelatedObjectsAccessor.java index ce1295cf..c2bc6f9e 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/StructuralRelatedObjectsAccessor.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/structural/rules/domain/StructuralRelatedObjectsAccessor.java @@ -21,12 +21,10 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.Layer0; import org.simantics.objmap.exceptions.MappingException; import org.simantics.objmap.graph.rules.domain.IDomainAccessor; import org.simantics.objmap.graph.rules.domain.MappingUtils; import org.simantics.objmap.structural.StructuralResource; -import org.simantics.structural.stubs.StructuralResource2; public class StructuralRelatedObjectsAccessor implements IDomainAccessor> { @@ -48,7 +46,7 @@ public class StructuralRelatedObjectsAccessor implements IDomainAccessor coll = g.getObjects(instance, publicRelation); List result = new ArrayList(coll.size());