You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2009/10/12 07:10:13 UTC
svn commit: r824228 -
/tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
Author: lresende
Date: Mon Oct 12 05:10:13 2009
New Revision: 824228
URL: http://svn.apache.org/viewvc?rev=824228&view=rev
Log:
Adding @SupressWarnings
Modified:
tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
Modified: tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java?rev=824228&r1=824227&r2=824228&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java (original)
+++ tuscany/branches/sca-java-1.x/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java Mon Oct 12 05:10:13 2009
@@ -59,10 +59,7 @@
*/
// 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 @@
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 @@
}
}
+ @SuppressWarnings("unchecked")
public static JAXBContext createJAXBContext(DataType dataType) throws JAXBException {
return createJAXBContext(findClasses(dataType));
}
@@ -202,6 +200,7 @@
* @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 @@
}
}
+ @SuppressWarnings("unchecked")
public static JAXBContext createJAXBContext(List<DataType> dataTypes) throws JAXBException {
JAXBContext context;
Set<Class<?>> classes = new HashSet<Class<?>>();
@@ -229,6 +229,7 @@
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 @@
return classes;
}
+ @SuppressWarnings("unchecked")
private static void findClasses(DataType d, Set<Class<?>> classes, Set<Type> visited) {
if (d == null) {
return;
@@ -257,6 +259,7 @@
* @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 @@
* @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 @@
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 @@
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 @@
}
}
+ @SuppressWarnings("unchecked")
public static Class<?> getJavaType(DataType<?> dataType) {
if (dataType == null) {
return null;