diff options
author | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-04 12:42:00 +0000 |
---|---|---|
committer | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-04 12:42:00 +0000 |
commit | f6e7ad0f270ca07f29148edc73eae9c4bb885065 (patch) | |
tree | eda1a8ed3eeb10224015de024f5e24f4ff942ab1 /java | |
parent | c489a4f7caf724bab90d8a7aabaaf6274584708a (diff) |
Fixed generics raw type compiler warnings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@723300 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
7 files changed, 24 insertions, 24 deletions
diff --git a/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java b/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java index 192536e2c9..9a040886b2 100644 --- a/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java +++ b/java/sca/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java @@ -100,7 +100,7 @@ public class JavaIntrospectionHelperTestCase { @Test public void testGetAllInterfaces() { - Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(Z.class); + Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(Z.class); assertEquals(2, interfaces.size()); assertTrue(interfaces.contains(W.class)); assertTrue(interfaces.contains(W2.class)); @@ -109,13 +109,13 @@ public class JavaIntrospectionHelperTestCase { @Test public void testGetAllInterfacesObject() { - Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(Object.class); + Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(Object.class); assertEquals(0, interfaces.size()); } @Test public void testGetAllInterfacesNoInterfaces() { - Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(NoInterface.class); + Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(NoInterface.class); assertEquals(0, interfaces.size()); } diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java index 9502582fc9..e748a5f6fa 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java @@ -136,7 +136,7 @@ public class JavaElementImpl { return ((Method)anchor).getAnnotations(); } if (anchor instanceof Constructor) { - return ((Constructor)anchor).getParameterAnnotations()[index]; + return ((Constructor<?>)anchor).getParameterAnnotations()[index]; } } return anchor.getAnnotations(); diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java index 6503aa2889..6cb5e3730b 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java @@ -118,7 +118,7 @@ public class JavaClassIntrospectorImpl { } } - Class superClass = clazz.getSuperclass(); + Class<?> superClass = clazz.getSuperclass(); if (superClass != null) { visitSuperClass(superClass, type); } diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java index d36bf7397e..5e83ea656f 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java @@ -287,7 +287,7 @@ public final class JavaIntrospectionHelper { return implClass.getSimpleName(); } - public static boolean isImmutable(Class clazz) { + public static boolean isImmutable(Class<?> clazz) { return String.class == clazz || clazz.isPrimitive() || Number.class.isAssignableFrom(clazz) || Boolean.class.isAssignableFrom(clazz) @@ -318,7 +318,7 @@ public final class JavaIntrospectionHelper { public static Class<?> getErasure(Type type) { if (type instanceof Class) { - return (Class)type; + return (Class<?>)type; } else if (type instanceof GenericArrayType) { // FIXME: How to deal with the []? GenericArrayType arrayType = (GenericArrayType)type; @@ -399,7 +399,7 @@ public final class JavaIntrospectionHelper { * Compares a two types, assuming one is a primitive, to determine if the * other is its object counterpart */ - private static boolean primitiveAssignable(Class memberType, Class param) { + private static boolean primitiveAssignable(Class<?> memberType, Class<?> param) { if (memberType == Integer.class) { return param == Integer.TYPE; } else if (memberType == Double.class) { @@ -490,15 +490,15 @@ public final class JavaIntrospectionHelper { * Returns the set of interfaces implemented by the given class and its * ancestors or a blank set if none */ - public static Set<Class> getAllInterfaces(Class clazz) { - Set<Class> implemented = new HashSet<Class>(); + public static Set<Class<?>> getAllInterfaces(Class<?> clazz) { + Set<Class<?>> implemented = new HashSet<Class<?>>(); getAllInterfaces(clazz, implemented); return implemented; } - private static void getAllInterfaces(Class clazz, Set<Class> implemented) { - Class[] interfaces = clazz.getInterfaces(); - for (Class interfaze : interfaces) { + private static void getAllInterfaces(Class<?> clazz, Set<Class<?>> implemented) { + Class<?>[] interfaces = clazz.getInterfaces(); + for (Class<?> interfaze : interfaces) { implemented.add(interfaze); } Class<?> superClass = clazz.getSuperclass(); @@ -518,7 +518,7 @@ public final class JavaIntrospectionHelper { .startsWith("get")); } - private final static Map<Class, String> signatures = new HashMap<Class, String>(); + private final static Map<Class<?>, String> signatures = new HashMap<Class<?>, String>(); static { signatures.put(boolean.class, "Z"); signatures.put(byte.class, "B"); @@ -549,7 +549,7 @@ public final class JavaIntrospectionHelper { return Class.forName(buf.toString(), false, componentType.getClassLoader()); } - public static Set<Method> getPrivateMethods(Class clazz) { + public static Set<Method> getPrivateMethods(Class<?> clazz) { Set<Method> methods = new HashSet<Method>(); Method[] declaredMethods = clazz.getDeclaredMethods(); for (final Method declaredMethod : declaredMethods) { @@ -562,7 +562,7 @@ public final class JavaIntrospectionHelper { return methods; } - public static Set<Field> getPrivateFields(Class clazz) { + public static Set<Field> getPrivateFields(Class<?> clazz) { Set<Field> fields = new HashSet<Field>(); Field[] declaredFields = clazz.getDeclaredFields(); for (final Field declaredField : declaredFields) { diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java index 7d1d6c83ce..f4c88e61ad 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java @@ -98,7 +98,7 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor { * interfaces is remotable, then by default the implementation offers a single service whose type * is the implementation class. */ - Set<Class> interfaces = getAllInterfaces(clazz); + Set<Class<?>> interfaces = getAllInterfaces(clazz); for (Class<?> i : interfaces) { if (i.isAnnotationPresent(Remotable.class) || i.isAnnotationPresent(WebService.class)) { addService(type, i); @@ -360,8 +360,8 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor { } } - private static boolean areUnique(Class[] collection) { - Set<Class> set = new HashSet<Class>(Arrays.asList(collection)); + private static boolean areUnique(Class<?>[] collection) { + Set<Class<?>> set = new HashSet<Class<?>>(Arrays.asList(collection)); return set.size() == collection.length; } @@ -371,7 +371,7 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor { */ private boolean calcPropRefUniqueness(Collection<JavaElementImpl> props, Collection<JavaElementImpl> refs) { - Class[] classes = new Class[props.size() + refs.size()]; + Class<?>[] classes = new Class[props.size() + refs.size()]; int i = 0; for (JavaElementImpl property : props) { classes[i] = property.getType(); @@ -530,7 +530,7 @@ public class HeuristicPojoProcessor extends BaseJavaClassVisitor { } public boolean areUnique(JavaParameterImpl[] parameters) { - Set<Class> set = new HashSet<Class>(parameters.length); + Set<Class<?>> set = new HashSet<Class<?>>(parameters.length); for (JavaParameterImpl p : parameters) { if (!set.add(p.getType())) { return false; diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java index 3d5faf4f54..7a5dbb01f9 100644 --- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java +++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java @@ -66,7 +66,7 @@ public class ServiceProcessor extends BaseJavaClassVisitor { org.osoa.sca.annotations.Service annotation = clazz.getAnnotation(org.osoa.sca.annotations.Service.class); if (annotation == null) { // scan interfaces for remotable - Set<Class> interfaces = getAllInterfaces(clazz); + Set<Class<?>> interfaces = getAllInterfaces(clazz); for (Class<?> interfaze : interfaces) { if (interfaze.isAnnotationPresent(Remotable.class) || interfaze.isAnnotationPresent(WebService.class) diff --git a/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java b/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java index 1f3722e129..7c37e4452a 100644 --- a/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java +++ b/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java @@ -101,7 +101,7 @@ public class PolicyProcessorTestCase { verifyIntents(Service6.class, type); } - private void verifyIntents(Class serviceImplClass, JavaImplementation type) { + private void verifyIntents(Class<?> serviceImplClass, JavaImplementation type) { if ( !(type instanceof PolicySetAttachPoint) ) { fail("No Intents on the service "); } @@ -134,7 +134,7 @@ public class PolicyProcessorTestCase { for (org.apache.tuscany.sca.assembly.Service service: type.getServices()) { serviceMap.put(service.getName(), service); } - for (Class interfaceClass : serviceImplClass.getInterfaces()) { + for (Class<?> interfaceClass : serviceImplClass.getInterfaces()) { Requires interfaceIntentAnnotation = (Requires)interfaceClass.getAnnotation(Requires.class); org.apache.tuscany.sca.assembly.Service service = serviceMap.get(interfaceClass.getSimpleName()); if (service == null) { |