From 38ea64f0a5a6a796a7c39048f0af793a46e61e73 Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 12 Oct 2009 05:10:13 +0000 Subject: Adding @SupressWarnings git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@824228 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/databinding/jaxb/JAXBContextHelper.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany') diff --git a/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java b/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java index 95aa6d1402..833017a921 100644 --- a/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java +++ b/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java @@ -59,10 +59,7 @@ import org.apache.tuscany.sca.interfacedef.util.XMLType; */ // FIXME: [rfeng] We probably should turn this into a pluggable system service public class JAXBContextHelper { - // public static final String JAXB_CLASSES = "jaxb.classes"; - - // public static final String JAXB_CONTEXT_PATH = "jaxb.contextPath"; - + private static final JAXBContextCache cache = new JAXBContextCache(); private JAXBContextHelper() { @@ -82,7 +79,7 @@ public class JAXBContextHelper { if (tContext == null) throw new TransformationException("JAXB context is not set for the transformation."); - // TODO: [rfeng] Need to figure out what's the best grantularity to create the JAXBContext + // TODO: [rfeng] Need to figure out what's the best granularity to create the JAXBContext // per interface, operation or parameter Operation op = source ? tContext.getSourceOperation() : tContext.getTargetOperation(); if (op != null) { @@ -114,6 +111,7 @@ public class JAXBContextHelper { } } + @SuppressWarnings("unchecked") public static JAXBContext createJAXBContext(DataType dataType) throws JAXBException { return createJAXBContext(findClasses(dataType)); } @@ -202,6 +200,7 @@ public class JAXBContextHelper { * @return * @throws JAXBException */ + @SuppressWarnings("unchecked") public static JAXBContext createJAXBContext(Interface intf, boolean useWrapper) throws JAXBException { synchronized (cache) { LRUCache map = cache.getCache(); @@ -217,6 +216,7 @@ public class JAXBContextHelper { } } + @SuppressWarnings("unchecked") public static JAXBContext createJAXBContext(List dataTypes) throws JAXBException { JAXBContext context; Set> classes = new HashSet>(); @@ -229,6 +229,7 @@ public class JAXBContextHelper { return context; } + @SuppressWarnings("unchecked") private static Set> findClasses(DataType d) { Set> classes = new HashSet>(); Set visited = new HashSet(); @@ -236,6 +237,7 @@ public class JAXBContextHelper { return classes; } + @SuppressWarnings("unchecked") private static void findClasses(DataType d, Set> classes, Set visited) { if (d == null) { return; @@ -257,6 +259,7 @@ public class JAXBContextHelper { * @param classSet * @param visited */ + @SuppressWarnings("unchecked") private static void findClasses(Type type, Set> classSet, Set visited) { if (visited.contains(type) || type == null) { return; @@ -302,6 +305,7 @@ public class JAXBContextHelper { * @param useWrapper Use wrapper classes? * @return */ + @SuppressWarnings("unchecked") private static List getDataTypes(Interface intf, boolean useWrapper) { List dataTypes = new ArrayList(); for (Operation op : intf.getOperations()) { @@ -310,6 +314,7 @@ public class JAXBContextHelper { return dataTypes; } + @SuppressWarnings("unchecked") private static List getDataTypes(Operation op, boolean useWrapper) { List dataTypes = new ArrayList(); getDataTypes(dataTypes, op, useWrapper); @@ -333,6 +338,7 @@ public class JAXBContextHelper { return dataTypes; } + @SuppressWarnings("unchecked") private static void getDataTypes(List dataTypes, Operation op, boolean useWrapper) { WrapperInfo inputWrapperInfo = op.getInputWrapper(); WrapperInfo outputWrapperInfo = op.getOutputWrapper(); @@ -368,6 +374,7 @@ public class JAXBContextHelper { } } + @SuppressWarnings("unchecked") public static Class getJavaType(DataType dataType) { if (dataType == null) { return null; -- cgit v1.2.3