Author: djencks
Date: Thu Mar 10 07:47:23 2016
New Revision: 1734367

URL: http://svn.apache.org/viewvc?rev=1734367&view=rev
Log:
FELIX-5205 eliminate obvious source of IllegalStateException in dto fetching

Modified:
    
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java

Modified: 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java?rev=1734367&r1=1734366&r2=1734367&view=diff
==============================================================================
--- 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
 (original)
+++ 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
 Thu Mar 10 07:47:23 2016
@@ -342,17 +342,24 @@ public class ServiceComponentRuntimeImpl
                {
                        return null;
                }
-               Bundle bundle = bundleContext.getBundle();
-               if (bundle == null)
-               {
-                       return null;
-               }
-               BundleDTO b = new BundleDTO();
-               b.id = bundle.getBundleId();
-               b.lastModified = bundle.getLastModified();
-               b.state = bundle.getState();
-               b.symbolicName = bundle.getSymbolicName();
-               b.version = bundle.getVersion().toString();
-               return b;
+               try
+        {
+            Bundle bundle = bundleContext.getBundle();
+            if (bundle == null)
+            {
+                return null;
+            }
+            BundleDTO b = new BundleDTO();
+            b.id = bundle.getBundleId();
+            b.lastModified = bundle.getLastModified();
+            b.state = bundle.getState();
+            b.symbolicName = bundle.getSymbolicName();
+            b.version = bundle.getVersion().toString();
+            return b;
+        }
+        catch (IllegalStateException e)
+        {
+            return null;
+        }
        }
 }


Reply via email to