summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-12 05:10:13 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-12 05:10:13 +0000
commit38ea64f0a5a6a796a7c39048f0af793a46e61e73 (patch)
treee2d3f7134be220d49db9c78496792aeb3b729812 /branches/sca-java-1.x
parentc4953c75fecaab4b50d94072dfdac4efe2b31f84 (diff)
Adding @SupressWarnings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@824228 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x')
-rw-r--r--branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java17
1 files changed, 12 insertions, 5 deletions
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<Object, JAXBContext> map = cache.getCache();
@@ -217,6 +216,7 @@ public class JAXBContextHelper {
}
}
+ @SuppressWarnings("unchecked")
public static JAXBContext createJAXBContext(List<DataType> dataTypes) throws JAXBException {
JAXBContext context;
Set<Class<?>> classes = new HashSet<Class<?>>();
@@ -229,6 +229,7 @@ public class JAXBContextHelper {
return context;
}
+ @SuppressWarnings("unchecked")
private static Set<Class<?>> findClasses(DataType d) {
Set<Class<?>> classes = new HashSet<Class<?>>();
Set<Type> visited = new HashSet<Type>();
@@ -236,6 +237,7 @@ public class JAXBContextHelper {
return classes;
}
+ @SuppressWarnings("unchecked")
private static void findClasses(DataType d, Set<Class<?>> classes, Set<Type> 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<Class<?>> classSet, Set<Type> 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<DataType> getDataTypes(Interface intf, boolean useWrapper) {
List<DataType> dataTypes = new ArrayList<DataType>();
for (Operation op : intf.getOperations()) {
@@ -310,6 +314,7 @@ public class JAXBContextHelper {
return dataTypes;
}
+ @SuppressWarnings("unchecked")
private static List<DataType> getDataTypes(Operation op, boolean useWrapper) {
List<DataType> dataTypes = new ArrayList<DataType>();
getDataTypes(dataTypes, op, useWrapper);
@@ -333,6 +338,7 @@ public class JAXBContextHelper {
return dataTypes;
}
+ @SuppressWarnings("unchecked")
private static void getDataTypes(List<DataType> 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;