From: lehtonen Date: Wed, 27 Apr 2016 11:37:24 +0000 (+0000) Subject: (refs #6022) Suppress useless and unavoidable warnings. X-Git-Tag: v1.29.0~29 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e609a0cd9d31a8e617bc3bfbfdcad6a2efc99442;p=simantics%2Fsysdyn.git (refs #6022) Suppress useless and unavoidable warnings. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@32724 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.xmile/src/org/simantics/sysdyn/xmile/XmileParser.java b/org.simantics.sysdyn.xmile/src/org/simantics/sysdyn/xmile/XmileParser.java index 9444ed48..4deea48b 100644 --- a/org.simantics.sysdyn.xmile/src/org/simantics/sysdyn/xmile/XmileParser.java +++ b/org.simantics.sysdyn.xmile/src/org/simantics/sysdyn/xmile/XmileParser.java @@ -663,6 +663,7 @@ public class XmileParser implements IModelParser { * @param objects * @return the element or null if none could be found */ + @SuppressWarnings("unchecked") private T getPossibleElement(Class type, List objects) { for (Object obj : objects) { if (obj.getClass().equals(type)) { @@ -680,7 +681,8 @@ public class XmileParser implements IModelParser { * @param objects * @return a list of elements (empty if none could be found) */ - private List getElements(Class type, List objects) { + @SuppressWarnings("unchecked") + private List getElements(Class type, List objects) { List elements = new ArrayList(); for (Object obj : objects) { if (obj.getClass().equals(type)) { @@ -690,8 +692,9 @@ public class XmileParser implements IModelParser { return elements; } + @SuppressWarnings("unchecked") private T getPossibleJAXBElement(Class type, String name, List objects) { - for (JAXBElement je : getElements(JAXBElement.class, objects)) { + for (JAXBElement je : getElements(JAXBElement.class, objects)) { if (je.getName().getLocalPart().equals(name) && je.getDeclaredType().equals(type)) { return (T)je.getValue(); } @@ -699,9 +702,10 @@ public class XmileParser implements IModelParser { return null; } + @SuppressWarnings("unchecked") private List getJAXBElements(Class type, String name, List objects) { List elements = new ArrayList(); - for (JAXBElement je : getElements(JAXBElement.class, objects)) { + for (JAXBElement je : getElements(JAXBElement.class, objects)) { if (je.getName().getLocalPart().equals(name) && je.getDeclaredType().equals(type)) { elements.add((T)je.getValue()); }