[jboss-cvs] JBossAS SVN: r69899 - in projects/microcontainer/trunk/osgi-int/src: main/org/jboss/osgi/plugins/metadata and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 18 13:13:40 EST 2008


Author: adrian at jboss.org
Date: 2008-02-18 13:13:40 -0500 (Mon, 18 Feb 2008)
New Revision: 69899

Modified:
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleImpl.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/FilterImpl.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/InternalOSGiFacadeException.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/OSGiUtils.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceFactoryProxy.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceRegistrationImpl.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractParameter.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/URLValueCreator.java
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java
Log:
Source code tidyup in the osgi project

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -78,7 +78,7 @@
    protected KernelEventEmitter emitterDelegate; // todo - get it
    protected KernelConfigurator configurator; // todo - get it
 
-   protected Map<EventListener, AbstractDelegateListener> listeners = Collections.synchronizedMap(new HashMap<EventListener, AbstractDelegateListener>());
+   protected Map<EventListener, AbstractDelegateListener<?>> listeners = Collections.synchronizedMap(new HashMap<EventListener, AbstractDelegateListener<?>>());
    protected Map<ServiceListener, KernelEventFilter> filters = Collections.synchronizedMap(new HashMap<ServiceListener, KernelEventFilter>());
 
    public BundleContextImpl(DeploymentUnit context)
@@ -198,7 +198,7 @@
    public void removeServiceListener(ServiceListener serviceListener)
    {
       validateBundle();
-      AbstractDelegateListener listener = listeners.get(serviceListener);
+      AbstractDelegateListener<?> listener = listeners.get(serviceListener);
       if (listener != null)
       {
          listener.removeValidate();
@@ -244,7 +244,7 @@
    public void removeBundleListener(BundleListener bundleListener)
    {
       validateBundle();
-      AbstractDelegateListener listener = listeners.get(bundleListener);
+      AbstractDelegateListener<?> listener = listeners.get(bundleListener);
       if (listener != null)
       {
          listener.removeValidate();
@@ -285,7 +285,7 @@
    public void removeFrameworkListener(FrameworkListener frameworkListener)
    {
       validateBundle();
-      AbstractDelegateListener listener = listeners.get(frameworkListener);
+      AbstractDelegateListener<?> listener = listeners.get(frameworkListener);
       if (listener != null)
       {
          listener.removeValidate();
@@ -304,6 +304,7 @@
       }
    }
 
+   @SuppressWarnings("unchecked")
    public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
    {
       validateBundle();
@@ -315,7 +316,7 @@
 
       ClassInfo serviceInfo;
       ClassInfo[] infos = new ClassInfo[clazzes.length];
-      Class[] interfaces = new Class[clazzes.length];
+      Class<?>[] interfaces = new Class[clazzes.length];
       try
       {
          serviceInfo = configurator.getClassInfo(service.getClass());
@@ -363,6 +364,7 @@
       return new ServiceRegistrationImpl(this, context, serviceId, serviceMap);
    }
 
+   @SuppressWarnings("unchecked")
    public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
    {
       return registerService(new String[]{clazz}, service, properties);

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleImpl.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleImpl.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleImpl.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -76,6 +76,7 @@
       //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public Dictionary getHeaders()
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -111,6 +112,7 @@
       return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public Dictionary getHeaders(String string)
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -121,16 +123,18 @@
       return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
-   public Class loadClass(String string) throws ClassNotFoundException
+   public Class<?> loadClass(String string) throws ClassNotFoundException
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public Enumeration getResources(String string) throws IOException
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public Enumeration getEntryPaths(String string)
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -146,6 +150,7 @@
       return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public Enumeration findEntries(String string, String string1, boolean b)
    {
       return null;  //To change body of implemented methods use File | Settings | File Templates.

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/FilterImpl.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/FilterImpl.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/FilterImpl.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -55,11 +55,13 @@
       return false;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public boolean match(Dictionary dictionary)
    {
       return false;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public boolean matchCase(Dictionary dictionary)
    {
       return false;  //To change body of implemented methods use File | Settings | File Templates.

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/InternalOSGiFacadeException.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/InternalOSGiFacadeException.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/InternalOSGiFacadeException.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -28,6 +28,9 @@
  */
 public class InternalOSGiFacadeException extends RuntimeException
 {
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 9213483035127929387L;
+
    public InternalOSGiFacadeException()
    {
       super();

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/OSGiUtils.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/OSGiUtils.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/OSGiUtils.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -42,6 +42,7 @@
     * @param dictionary dictionary to transform
     * @return Map<String, Object>
     */
+   @SuppressWarnings("unchecked")
    public static Map<String, Object> toMap(Dictionary dictionary)
    {
       Map<String, Object> map = new HashMap<String, Object>();

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceFactoryProxy.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceFactoryProxy.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceFactoryProxy.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -56,20 +56,20 @@
    }
 */
    protected Object serviceFactory;
-   protected Class[] interfaces;
+   protected Class<?>[] interfaces;
    protected Object service;
    protected Boolean checked;
 
-   private ServiceFactoryProxy(Object serviceFactory, Class[] interfaces)
+   private ServiceFactoryProxy(Object serviceFactory, Class<?>[] interfaces)
    {
       this.serviceFactory = serviceFactory;
       this.interfaces = interfaces;
    }
 
-   public static Object createProxy(Object serviceFactory, Class[] interfaces)
+   public static Object createProxy(Object serviceFactory, Class<?>[] interfaces)
    {
       int lenght = interfaces.length;
-      Class[] allIntefaces = new Class[lenght + 1];
+      Class<?>[] allIntefaces = new Class[lenght + 1];
       System.arraycopy(interfaces, 0, allIntefaces, 0, lenght);
       allIntefaces[lenght] = ServiceFactory.class;
       InvocationHandler handler = new ServiceFactoryProxy(serviceFactory, interfaces);
@@ -85,8 +85,8 @@
       if (service == null)
          return true;
 
-      Class serviceInterface = service.getClass();
-      for(Class exposedInterface : interfaces)
+      Class<?> serviceInterface = service.getClass();
+      for(Class<?> exposedInterface : interfaces)
       {
          if (exposedInterface.isAssignableFrom(serviceInterface) == false)
          {

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceRegistrationImpl.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceRegistrationImpl.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/ServiceRegistrationImpl.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -79,6 +79,7 @@
       return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
 
+   @SuppressWarnings("unchecked")
    public void setProperties(Dictionary properties)
    {
       validateServiceRegistration();

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractParameter.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractParameter.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractParameter.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -38,6 +38,9 @@
  */
 public class AbstractParameter extends JBossObject implements Parameter, Serializable
 {
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -7920499358318841779L
+   ;
    protected Collection<String> values;
 
    public AbstractParameter()

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -91,7 +91,7 @@
       return properties;
    }
 
-   public Class getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
+   public Class<?> getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
    {
       return null;
    }

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/URLValueCreator.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/URLValueCreator.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/URLValueCreator.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -24,8 +24,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import org.jboss.logging.Logger;
-
 /**
  * Create URL from string.
  *
@@ -33,8 +31,6 @@
 */
 class URLValueCreator extends AbstractValueCreator<URL>
 {
-   private static Logger log = Logger.getLogger(URLValueCreator.class);
-
    public URLValueCreator()
    {
       super();

Modified: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java	2008-02-18 17:58:00 UTC (rev 69898)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java	2008-02-18 18:13:40 UTC (rev 69899)
@@ -233,7 +233,7 @@
 
    public void testIllegalManifest() throws Exception
    {
-      Manifest manifest = getManifest(createName("Illegal"));
+      getManifest(createName("Illegal"));
       // todo
    }
 




More information about the jboss-cvs-commits mailing list