cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amic...@apache.org
Subject svn commit: r1502019 - in /cxf/dosgi/trunk: discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/ discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/ dsw/cxf-dsw/sr...
Date Wed, 10 Jul 2013 21:41:32 GMT
Author: amichai
Date: Wed Jul 10 21:41:32 2013
New Revision: 1502019

URL: http://svn.apache.org/r1502019
Log:
Generify and remove @SuppressWarnings

Modified:
    cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/Utils.java
    cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/UtilsTest.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTracker.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java

Modified: cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/Utils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/Utils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/Utils.java
(original)
+++ cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/util/Utils.java
Wed Jul 10 21:41:32 2013
@@ -107,15 +107,13 @@ public final class Utils {
         }
     }
 
-    @SuppressWarnings("rawtypes")
-    public static String getProp(Dictionary props, String key, String def) {
-        Object val = props.get(key);
+    public static <K, V> String getProp(Dictionary<K, V> props, String key, String
def) {
+        V val = props.get(key);
         return val == null ? def : val.toString();
     }
 
-    @SuppressWarnings("rawtypes")
-    public static int getProp(Dictionary props, String key, int def) {
-        Object val = props.get(key);
+    public static <K, V> int getProp(Dictionary<K, V> props, String key, int
def) {
+        V val = props.get(key);
         return val == null ? def : Integer.parseInt(val.toString());
     }
 

Modified: cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/UtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/UtilsTest.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/UtilsTest.java
(original)
+++ cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/util/UtilsTest.java
Wed Jul 10 21:41:32 2013
@@ -38,7 +38,6 @@ public class UtilsTest extends TestCase 
         assertEquals(Utils.PATH_PREFIX, Utils.getZooKeeperPath(""));
     }
 
-    @SuppressWarnings("unchecked")
     public void testGetStringPlusProperty() {
         String[] out = Utils.getStringPlusProperty("MyString");
         assertEquals(1, out.length);

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
Wed Jul 10 21:41:32 2013
@@ -99,7 +99,7 @@ public class HttpServiceManager {
         return (HttpService) service;
     }
 
-    public String getServletContextRoot(Map<?, ?> sd) {
+    public String getServletContextRoot(Map<String, Object> sd) {
         return OsgiUtils.getFirstNonEmptyStringProperty(sd,
                 Constants.WS_HTTP_SERVICE_CONTEXT,
                 Constants.WS_HTTP_SERVICE_CONTEXT_OLD,

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
Wed Jul 10 21:41:32 2013
@@ -53,8 +53,7 @@ public final class JaxRSUtils {
         // never constructed
     }
 
-    @SuppressWarnings("rawtypes")
-    static List<Object> getProviders(BundleContext callingContext, Map sd) {
+    static List<Object> getProviders(BundleContext callingContext, Map<String, Object>
sd) {
         List<Object> providers = new ArrayList<Object>();
         if ("aegis".equals(sd.get(org.apache.cxf.dosgi.dsw.Constants.RS_DATABINDING_PROP_KEY)))
{
             providers.add(new AegisElementProvider());

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
Wed Jul 10 21:41:32 2013
@@ -38,8 +38,7 @@ public final class IntentUtils {
         // never constructed
     }
 
-    @SuppressWarnings("rawtypes")
-    public static String[] getIntentsImplementedByTheService(Map serviceProperties) {
+    public static String[] getIntentsImplementedByTheService(Map<String, Object> serviceProperties)
{
         // Get the Intents that are implemented by the service
         return Utils.normalizeStringPlus(serviceProperties.get(RemoteConstants.SERVICE_INTENTS));
     }
@@ -63,7 +62,7 @@ public final class IntentUtils {
         return list.toArray(new String[list.size()]);
     }
 
-    public static Set<String> getRequestedIntents(Map<?, ?> sd) {
+    public static Set<String> getRequestedIntents(Map<String, Object> sd) {
         Collection<String> intents = OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS));
         Collection<String> intents2
             = OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS_EXTRA));

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
Wed Jul 10 21:41:32 2013
@@ -18,8 +18,8 @@
  */
 package org.apache.cxf.dosgi.dsw.service;
 
-import java.util.Dictionary;
-import java.util.Properties;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
@@ -44,8 +44,7 @@ public class EventAdminHelper {
         bctx = bc;
     }
 
-    @SuppressWarnings("rawtypes")
-    private Event createEvent(Properties props, String type) {
+    private Event createEvent(Map<String, Object> props, String type) {
         String topic = "org/osgi/service/remoteserviceadmin/" + type;
         props.put("bundle", bctx.getBundle());
         props.put("bundle.id", bctx.getBundle().getBundleId());
@@ -55,13 +54,13 @@ public class EventAdminHelper {
         Version v = version != null ? new Version(version) : Version.emptyVersion;
         setIfNotNull(props, "bundle.version", v);
 
-        return new Event(topic, (Dictionary)props);
+        return new Event(topic, props);
     }
 
     public void notifyEventAdmin(RemoteServiceAdminEvent rsae) {
         String topic = remoteServiceAdminEventTypeToString(rsae.getType());
 
-        Properties props = new Properties();
+        Map<String, Object> props = new HashMap<String, Object>();
         setIfNotNull(props, "cause", rsae.getException());
 
         EndpointDescription endpoint = null;

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
Wed Jul 10 21:41:32 2013
@@ -74,6 +74,7 @@ public class RemoteServiceAdminCore impl
         this.configTypeHandlerFactory = configTypeHandlerFactory;
     }
 
+    @Override
     @SuppressWarnings({ "rawtypes", "unchecked" })
     public List<ExportRegistration> exportService(ServiceReference serviceReference,
Map additionalProperties)
         throws IllegalArgumentException, UnsupportedOperationException {
@@ -272,6 +273,7 @@ public class RemoteServiceAdminCore impl
         return bctx.getBundle().equals(sref.getBundle()); // sref bundle can be null
     }
 
+    @Override
     public Collection<ExportReference> getExportedServices() {
         synchronized (exportedServices) {
             List<ExportReference> ers = new ArrayList<ExportReference>();
@@ -284,6 +286,7 @@ public class RemoteServiceAdminCore impl
         }
     }
 
+    @Override
     public Collection<ImportReference> getImportedEndpoints() {
         synchronized (importedServices) {
             List<ImportReference> irs = new ArrayList<ImportReference>();
@@ -299,6 +302,7 @@ public class RemoteServiceAdminCore impl
     /**
      * Importing form here...
      */
+    @Override
     public ImportRegistration importService(EndpointDescription endpoint) {
         LOG.debug("importService() Endpoint: {}", endpoint.getProperties());
 

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
Wed Jul 10 21:41:32 2013
@@ -30,7 +30,9 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.EndpointPermission;
+import org.osgi.service.remoteserviceadmin.ExportReference;
 import org.osgi.service.remoteserviceadmin.ExportRegistration;
+import org.osgi.service.remoteserviceadmin.ImportReference;
 import org.osgi.service.remoteserviceadmin.ImportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
@@ -48,28 +50,30 @@ public class RemoteServiceAdminInstance 
         rsaCore = core;
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public List /* ExportRegistration */exportService(final ServiceReference ref, final Map
properties) {
+    @Override
+    @SuppressWarnings("rawtypes")
+    public List<ExportRegistration> exportService(final ServiceReference ref, final
Map properties) {
         checkPermission(new EndpointPermission("*", EndpointPermission.EXPORT));
-        return AccessController.doPrivileged(new PrivilegedAction<List>() {
+        return AccessController.doPrivileged(new PrivilegedAction<List<ExportRegistration>>()
{
             public List<ExportRegistration> run() {
                 return closed ? Collections.<ExportRegistration>emptyList() : rsaCore.exportService(ref,
properties);
             }
         });
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public Collection getExportedServices() {
+    @Override
+    public Collection<ExportReference> getExportedServices() {
         checkPermission(new EndpointPermission("*", EndpointPermission.READ));
         return closed ? null : rsaCore.getExportedServices();
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public Collection getImportedEndpoints() {
+    @Override
+    public Collection<ImportReference> getImportedEndpoints() {
         checkPermission(new EndpointPermission("*", EndpointPermission.READ));
         return closed ? null : rsaCore.getImportedEndpoints();
     }
 
+    @Override
     public ImportRegistration importService(final EndpointDescription endpoint) {
         checkPermission(new EndpointPermission(endpoint, OsgiUtils.getUUID(bctx), EndpointPermission.IMPORT));
         return AccessController.doPrivileged(new PrivilegedAction<ImportRegistration>()
{

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java
Wed Jul 10 21:41:32 2013
@@ -92,8 +92,8 @@ public final class ClassUtils {
         return null;
     }
 
-    @SuppressWarnings("rawtypes")
-    public static List<Object> loadProviderClasses(BundleContext callingContext, Map
sd, String propName) {
+    public static List<Object> loadProviderClasses(BundleContext callingContext,
+                                                   Map<String, Object> sd, String propName)
{
         Object serviceProviders = sd.get(propName);
         if (serviceProviders != null) {
             if (serviceProviders.getClass().isArray()) {

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
Wed Jul 10 21:41:32 2013
@@ -42,10 +42,7 @@ public final class OsgiUtils {
     private OsgiUtils() {
     }
 
-    // TODO : move these property helpers into PropertyUtils?
-
-    @SuppressWarnings("rawtypes")
-    public static boolean getBooleanProperty(Map sd, String name) {
+    public static boolean getBooleanProperty(Map<String, Object> sd, String name) {
         return toBoolean(sd.get(name));
     }
 
@@ -71,13 +68,12 @@ public final class OsgiUtils {
         return getProperty(endpoint.getProperties(), name);
     }
 
-    @SuppressWarnings("rawtypes")
-    public static String getProperty(Map dict, String name) {
-        Object o = dict.get(name);
-        return o instanceof String ? (String) o : null;
+    public static String getProperty(Map<String, Object> dict, String name) {
+        Object value = dict.get(name);
+        return value instanceof String ? (String) value : null;
     }
 
-    public static String getFirstNonEmptyStringProperty(@SuppressWarnings("rawtypes") Map
dict, String ... keys) {
+    public static String getFirstNonEmptyStringProperty(Map<String, Object> dict, String
... keys) {
         for (String key : keys) {
             String value = getProperty(dict, key);
             if (value != null) {

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java Wed
Jul 10 21:41:32 2013
@@ -86,10 +86,9 @@ public final class Utils {
         return map;
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static void setIfNotNull(Dictionary dict, String key, Object val) {
+    public static <K, V> void setIfNotNull(Map<K, V> map, K key, V val) {
         if (val != null) {
-            dict.put(key, val);
+            map.put(key, val);
         }
     }
 }

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
Wed Jul 10 21:41:32 2013
@@ -61,7 +61,6 @@ public class JaxRSUtilsTest extends Test
         assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
     }
 
-    @SuppressWarnings("rawtypes")
     public void testServiceProviders() {
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.RS_PROVIDER_PROP_KEY, new Object[] {
@@ -126,7 +125,6 @@ public class JaxRSUtilsTest extends Test
         assertEquals(JAXBElementProvider.class.getName(), providers.get(1).getClass().getName());
     }
 
-    @SuppressWarnings("rawtypes")
     public void testCustomGlobalProvider() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -135,7 +133,7 @@ public class JaxRSUtilsTest extends Test
         sref.getProperty(Constants.RS_PROVIDER_EXPECTED_PROP_KEY);
         EasyMock.expectLastCall().andReturn(false);
         bc.getService(sref);
-        AegisElementProvider p = new AegisElementProvider();
+        AegisElementProvider<?> p = new AegisElementProvider();
         EasyMock.expectLastCall().andReturn(p);
         EasyMock.replay(bc, sref);
         Map<String, Object> props = new HashMap<String, Object>();
@@ -146,7 +144,6 @@ public class JaxRSUtilsTest extends Test
         assertSame(p, providers.get(0));
     }
 
-    @SuppressWarnings("rawtypes")
     public void testNoCustomGlobalProvider() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -155,7 +152,7 @@ public class JaxRSUtilsTest extends Test
         sref.getProperty(Constants.RS_PROVIDER_PROP_KEY);
         EasyMock.expectLastCall().andReturn(false);
         bc.getService(sref);
-        AegisElementProvider p = new AegisElementProvider();
+        AegisElementProvider<?> p = new AegisElementProvider();
         EasyMock.expectLastCall().andReturn(p);
         EasyMock.replay(bc);
         Map<String, Object> props = new HashMap<String, Object>();
@@ -166,7 +163,6 @@ public class JaxRSUtilsTest extends Test
         assertEquals(0, providers.size());
     }
 
-    @SuppressWarnings("rawtypes")
     public void testCustomGlobalProviderExpected() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -175,7 +171,7 @@ public class JaxRSUtilsTest extends Test
         sref.getProperty(Constants.RS_PROVIDER_PROP_KEY);
         EasyMock.expectLastCall().andReturn(true);
         bc.getService(sref);
-        AegisElementProvider p = new AegisElementProvider();
+        AegisElementProvider<?> p = new AegisElementProvider();
         EasyMock.expectLastCall().andReturn(p);
         EasyMock.replay(bc, sref);
         Map<String, Object> props = new HashMap<String, Object>();

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
Wed Jul 10 21:41:32 2013
@@ -53,34 +53,31 @@ public class ClassUtilsTest extends Test
 
     public void testLoadProvidersAsString() throws Exception {
         BundleContext bc = mockBundleContext();
-        List<Object> providers = ClassUtils
-            .loadProviderClasses(bc, Collections.singletonMap("providers",
-                                Provider.class.getName()), "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
Provider.class.getName());
+        List<Object> providers = ClassUtils.loadProviderClasses(bc, sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }
 
     public void testLoadProvidersAsStringArray() throws Exception {
         BundleContext bc = mockBundleContext();
-        List<Object> providers = ClassUtils
-           .loadProviderClasses(bc, Collections.singletonMap("providers",
-               new String[]{Provider.class.getName()}), "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
+                new String[]{Provider.class.getName()});
+        List<Object> providers = ClassUtils.loadProviderClasses(bc, sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }
 
     public void testLoadProvidersAsObject() throws Exception {
-        List<Object> providers = ClassUtils.loadProviderClasses(null,
-            Collections.singletonMap("providers", new Provider()),
-                "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
new Provider());
+        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }
 
     public void testLoadProvidersAsObjectArray() throws Exception {
-        List<Object> providers = ClassUtils.loadProviderClasses(null,
-            Collections.singletonMap("providers",
-                new Object[]{new Provider()}), "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
new Object[]{new Provider()});
+        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }
@@ -88,8 +85,8 @@ public class ClassUtilsTest extends Test
     public void testLoadProvidersAsObjectList() throws Exception {
         List<Object> list = new LinkedList<Object>();
         list.add(new Provider());
-        List<Object> providers = ClassUtils.loadProviderClasses(null,
-            Collections.singletonMap("providers", list), "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
list);
+        List<Object> providers = ClassUtils.loadProviderClasses(null, sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }
@@ -97,9 +94,8 @@ public class ClassUtilsTest extends Test
     public void testLoadProvidersAsStringList() throws Exception {
         List<Object> list = new LinkedList<Object>();
         list.add(Provider.class.getName());
-        List<Object> providers = ClassUtils.loadProviderClasses(
-            mockBundleContext(),
-            Collections.singletonMap("providers", list), "providers");
+        Map<String, Object> sd = Collections.<String, Object>singletonMap("providers",
list);
+        List<Object> providers = ClassUtils.loadProviderClasses(mockBundleContext(),
sd, "providers");
         assertEquals(1, providers.size());
         assertTrue(providers.get(0) instanceof Provider);
     }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTracker.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTracker.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTracker.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/util/SimpleServiceTracker.java
Wed Jul 10 21:41:32 2013
@@ -114,7 +114,6 @@ public class SimpleServiceTracker<T> ext
      *
      * @return all currently tracked services
      */
-    @SuppressWarnings("unchecked")
     public List<T> getAllServices() {
         return new ArrayList<T>(services.values());
     }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java?rev=1502019&r1=1502018&r2=1502019&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
Wed Jul 10 21:41:32 2013
@@ -49,7 +49,6 @@ public class ExportServiceTest {
      *
      * @throws Exception
      */
-    @SuppressWarnings("unchecked")
     @Test
     public void testServiceExport() throws Exception {
         IMocksControl c = EasyMock.createControl();



Mime
View raw message