cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: svn commit: r722117 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ rt/frontend/jaxrs/src/main/jav...
Date Wed, 03 Dec 2008 04:06:40 GMT
On Mon, 2008-12-01 at 16:36 +0000, sergeyb@apache.org wrote:

> Modified:
> cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
> URL:
> http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=722117&r1=722116&r2=722117&view=diff
> ==============================================================================
> ---
> cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
(original)
> +++
> cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Mon Dec  1 08:36:47 2008
> @@ -67,6 +67,7 @@

> +    public static int compareSortedMediaTypes(List<MediaType> mts1,
> List<MediaType> mts2) {
> +        int size1 = mts1.size();
> +        int size2 = mts2.size();
> +        for (int i = 0; i < size1 && i < size2; i++) {
> (1) +            int result = compareMediaTypes(mts1.get(i),
> mts2.get(i));
> +            if (result != 0) {
> +                return result;
> +            }
> +        }
> (2) +        return size1 == size2 ? 0 : size1 < size2 ? -1 : 1;
> +    }

The logic of cSMT() here seems strange, but it could be that I'm not
properly comprehending the code or purpose of this method:

(A, B, C) vs. (A, B)  left-side wins because it has three elements to
the right side's two.  (From line 2 above)
(A, B, C) vs. (A, C)  right-side wins because C is greater than B (From
line 1 above)  <-- but the left side also has C, so so what?

Glen


Mime
View raw message