You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2020/01/04 18:57:22 UTC

[cxf] branch master updated: CXF-8097: Equal candidates for handling the current request (HEAD / GET). Minor refactorings.

This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new f977f50  CXF-8097: Equal candidates for handling the current request (HEAD / GET). Minor refactorings.
f977f50 is described below

commit f977f50f5de0e9df1663c447ee15d30eb0f67fca
Author: reta <dr...@gmail.com>
AuthorDate: Sat Jan 4 13:57:02 2020 -0500

    CXF-8097: Equal candidates for handling the current request (HEAD / GET). Minor refactorings.
---
 .../apache/cxf/jaxrs/model/OperationResourceInfoComparator.java  | 5 ++++-
 .../cxf/jaxrs/model/OperationResourceInfoComparatorBase.java     | 9 ++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparator.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparator.java
index c3adcb9..03b12fa 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparator.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparator.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.jaxrs.model;
 
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 import javax.ws.rs.core.MediaType;
@@ -27,7 +28,9 @@ import javax.ws.rs.core.MediaType;
 import org.apache.cxf.jaxrs.ext.ResourceComparator;
 import org.apache.cxf.message.Message;
 
-public class OperationResourceInfoComparator extends OperationResourceInfoComparatorBase {
+public class OperationResourceInfoComparator extends OperationResourceInfoComparatorBase
+        implements Comparator<OperationResourceInfo> {
+    
     private String httpMethod;
     private boolean getMethod;
     private Message message;
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparatorBase.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparatorBase.java
index e5016df..ae9d439 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparatorBase.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparatorBase.java
@@ -20,7 +20,6 @@
 package org.apache.cxf.jaxrs.model;
 
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -31,21 +30,21 @@ import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.jaxrs.ext.DefaultMethod;
 import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 
-public abstract class OperationResourceInfoComparatorBase implements Comparator<OperationResourceInfo> {
+public abstract class OperationResourceInfoComparatorBase {
     private static final Logger LOG = LogUtils.getL7dLogger(JAXRSUtils.class);
     
-    protected static int compare(OperationResourceInfo e1, OperationResourceInfo e2, String httpMethod) {
+    protected int compare(OperationResourceInfo e1, OperationResourceInfo e2, String httpMethod) {
         return compare(e1, e2, httpMethod, MediaType.WILDCARD_TYPE, 
             Collections.singletonList(MediaType.WILDCARD_TYPE));
     }
 
-    protected static int compare(OperationResourceInfo e1, OperationResourceInfo e2, String httpMethod, 
+    protected int compare(OperationResourceInfo e1, OperationResourceInfo e2, String httpMethod, 
             final MediaType contentType, final List<MediaType> acceptTypes) {
         return compare(e1, e2, HttpMethod.GET.equals(httpMethod), 
             httpMethod, contentType, acceptTypes);
     }
 
-    protected static int compare(OperationResourceInfo e1, OperationResourceInfo e2, boolean getMethod, 
+    protected int compare(OperationResourceInfo e1, OperationResourceInfo e2, boolean getMethod, 
             String httpMethod, final MediaType contentType, final List<MediaType> acceptTypes) {
 
         String e1HttpMethod = e1.getHttpMethod();