From e609a0cd9d31a8e617bc3bfbfdcad6a2efc99442 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Wed, 27 Apr 2016 11:37:24 +0000 Subject: [PATCH] (refs #6022) Suppress useless and unavoidable warnings. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@32724 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/xmile/XmileParser.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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()); } -- 2.47.1