felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1755339 - in /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime: AbstractInfo.java ResourceInfo.java
Date Fri, 05 Aug 2016 14:52:56 GMT
Author: cziegeler
Date: Fri Aug  5 14:52:56 2016
New Revision: 1755339

URL: http://svn.apache.org/viewvc?rev=1755339&view=rev
Log:
FELIX-5319 : HttpServiceRuntime provides incorrect info for service that is both Servlet and
Resource

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java?rev=1755339&r1=1755338&r2=1755339&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
Fri Aug  5 14:52:56 2016
@@ -82,12 +82,17 @@ public abstract class AbstractInfo<T> im
     {
         if (this.ranking == other.ranking)
         {
+            if ( this.serviceId == other.serviceId )
+            {
+                return this.getClass().getName().compareTo(other.getClass().getName());
+            }
             // Service id's can be negative. Negative id's follow the reverse natural ordering
of integers.
             int reverseOrder = ( this.serviceId >= 0 && other.serviceId >=
0 ) ? 1 : -1;
             return reverseOrder * new Long(this.serviceId).compareTo(other.serviceId);
         }
 
-        return new Integer(other.ranking).compareTo(this.ranking);
+        int result = new Integer(other.ranking).compareTo(this.ranking);
+        return result;
     }
 
     protected boolean isEmpty(final String value)

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java?rev=1755339&r1=1755338&r2=1755339&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
Fri Aug  5 14:52:56 2016
@@ -39,12 +39,19 @@ public final class ResourceInfo extends
 
     private final ServletInfo servletInfo;
 
+    private static final class ResourceServletInfo extends ServletInfo {
+
+        public ResourceServletInfo(ResourceInfo resource) {
+            super(resource);
+        }
+    };
+
     public ResourceInfo(final ServiceReference<Object> ref)
     {
         super(ref);
         this.patterns = getStringArrayProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN);
         this.prefix = getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX);
-        this.servletInfo = new ServletInfo(this);
+        this.servletInfo = new ResourceServletInfo(this);
     }
 
     @Override



Mime
View raw message