[jboss-cvs] JBossAS SVN: r97141 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Nov 29 07:32:52 EST 2009


Author: alesj
Date: 2009-11-29 07:32:51 -0500 (Sun, 29 Nov 2009)
New Revision: 97141

Modified:
   projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
   projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Log:
Simple refactoring.

Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java	2009-11-29 04:58:48 UTC (rev 97140)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java	2009-11-29 12:32:51 UTC (rev 97141)
@@ -1196,7 +1196,7 @@
       // review: optimise this, e.g. index by class
       // Use a sorted set to order services according to spec
       Set<OSGiServiceState> result = new TreeSet<OSGiServiceState>(ServiceComparator.INSTANCE);
-      for (org.jboss.dependency.spi.ControllerContext context : contexts)
+      for (ControllerContext context : contexts)
       {
          // TODO - fix filtering
          if (context instanceof OSGiServiceState)

Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java	2009-11-29 04:58:48 UTC (rev 97140)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java	2009-11-29 12:32:51 UTC (rev 97141)
@@ -574,21 +574,18 @@
       else
          throw new IllegalArgumentException(reference + " is not a service reference");
 
-      long thisServiceId = this.getServiceId();
+      long thisServiceId = getServiceId();
       long otherServiceId = other.getServiceId();
       if (thisServiceId == otherServiceId)
          return 0;
 
-      int thisRanking = this.getServiceRanking();
+      int thisRanking = getServiceRanking();
       int otherRanking = other.getServiceRanking();
       int ranking = thisRanking - otherRanking;
       if (ranking != 0)
          return ranking;
 
-      if (thisServiceId > otherServiceId)
-         return -1;
-      else
-         return +1;
+      return (thisServiceId > otherServiceId) ? -1 : 1;
    }
 
    @Override




More information about the jboss-cvs-commits mailing list