felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r949050 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
Date Fri, 28 May 2010 00:20:47 GMT
Author: gnodet
Date: Fri May 28 00:20:47 2010
New Revision: 949050

URL: http://svn.apache.org/viewvc?rev=949050&view=rev
Log:
Slight code cleanup (FELIX-2035)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java?rev=949050&r1=949049&r2=949050&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
Fri May 28 00:20:47 2010
@@ -173,6 +173,7 @@ public class FelixResolverState implemen
             }
             catch (Exception ex2)
             {
+                // Ignore
             }
             m_logger.log(Logger.LOG_ERROR,
                 "Serious error attaching fragments.", ex);
@@ -299,6 +300,7 @@ public class FelixResolverState implemen
                     }
                     catch (Exception ex2)
                     {
+                        // Ignore
                     }
                     m_logger.log(Logger.LOG_ERROR,
                         "Serious error attaching fragments.", ex);
@@ -314,7 +316,7 @@ public class FelixResolverState implemen
     private void removeFragment(Module fragment)
     {
         // Get fragment list, which may be null for system bundle fragments.
-        List fragList = (List) m_fragmentMap.get(fragment.getSymbolicName());
+        List<Module> fragList = m_fragmentMap.get(fragment.getSymbolicName());
         if (fragList != null)
         {
             // Remove from fragment map.
@@ -357,6 +359,7 @@ public class FelixResolverState implemen
                         }
                         catch (Exception ex2)
                         {
+                            // Ignore
                         }
                         m_logger.log(Logger.LOG_ERROR,
                             "Serious error attaching fragments.", ex);
@@ -498,6 +501,7 @@ public class FelixResolverState implemen
                 }
                 catch (Exception ex2)
                 {
+                    // Ignore
                 }
                 m_logger.log(Logger.LOG_ERROR,
                     "Serious error attaching fragments.", ex);
@@ -603,7 +607,7 @@ public class FelixResolverState implemen
                     (index < 0) && (listIdx < fragmentList.size());
                     listIdx++)
                 {
-                    Module existing = (Module) fragmentList.get(listIdx);
+                    Module existing = fragmentList.get(listIdx);
                     if (fragment.getBundle().getBundleId()
                         < existing.getBundle().getBundleId())
                     {
@@ -872,12 +876,11 @@ public class FelixResolverState implemen
         else
         {
             Version version = module.getVersion();
-            Version middleVersion = null;
-            int top = 0, bottom = modules.size() - 1, middle = 0;
+            int top = 0, bottom = modules.size() - 1;
             while (top <= bottom)
             {
-                middle = (bottom - top) / 2 + top;
-                middleVersion = modules.get(middle).getVersion();
+                int middle = (bottom - top) / 2 + top;
+                Version middleVersion = modules.get(middle).getVersion();
                 // Sort in reverse version order.
                 int cmp = middleVersion.compareTo(version);
                 if (cmp < 0)
@@ -887,7 +890,7 @@ public class FelixResolverState implemen
                 else if (cmp == 0)
                 {
                     // Sort further by ascending bundle ID.
-                    long middleId = ((Module) modules.get(middle)).getBundle().getBundleId();
+                    long middleId = modules.get(middle).getBundle().getBundleId();
                     long exportId = module.getBundle().getBundleId();
                     if (middleId < exportId)
                     {



Mime
View raw message