cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6499] Optionally ignore path parameters for the same path method evaluation
Date Wed, 15 Jul 2015 10:34:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 90de43b2c -> a5f83ebe4


[CXF-6499] Optionally ignore path parameters for the same path method evaluation


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a5f83ebe
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a5f83ebe
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a5f83ebe

Branch: refs/heads/3.0.x-fixes
Commit: a5f83ebe4ef4f202d2f18baea99e8fa9737a8fe9
Parents: 90de43b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Jul 15 13:33:11 2015 +0300
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Jul 15 13:34:14 2015 +0300

----------------------------------------------------------------------
 .../cxf/jaxrs/model/wadl/WadlGenerator.java     | 41 +++++++++++---------
 1 file changed, 23 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a5f83ebe/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index 24de86b..90b6fac 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -164,6 +164,7 @@ public class WadlGenerator implements ContainerRequestFilter {
     private boolean ignoreOverloadedMethods;
     private boolean checkAbsolutePathSlash;
     private boolean keepRelativeDocLinks;
+    private boolean usePathParamsToCompareOperations = true;
     
     private List<String> externalSchemasCache;
     private List<URI> externalSchemaLinks;
@@ -626,27 +627,31 @@ public class WadlGenerator implements ContainerRequestFilter {
             && ori1.getHttpMethod() == null) {
             return false;
         }
-        int ori1PathParams = 0;
-        int ori1MatrixParams = 0;
-        for (Parameter p : ori1.getParameters()) {
-            if (p.getType() == ParameterType.PATH) {
-                ori1PathParams++;
-            } else if (p.getType() == ParameterType.MATRIX) {
-                ori1MatrixParams++;
+        if (usePathParamsToCompareOperations) {
+            int ori1PathParams = 0;
+            int ori1MatrixParams = 0;
+            for (Parameter p : ori1.getParameters()) {
+                if (p.getType() == ParameterType.PATH) {
+                    ori1PathParams++;
+                } else if (p.getType() == ParameterType.MATRIX) {
+                    ori1MatrixParams++;
+                }
             }
-        }
-
-        int ori2PathParams = 0;
-        int ori2MatrixParams = 0;
-        for (Parameter p : ori2.getParameters()) {
-            if (p.getType() == ParameterType.PATH) {
-                ori2PathParams++;
-            } else if (p.getType() == ParameterType.MATRIX) {
-                ori2MatrixParams++;
+    
+            int ori2PathParams = 0;
+            int ori2MatrixParams = 0;
+            for (Parameter p : ori2.getParameters()) {
+                if (p.getType() == ParameterType.PATH) {
+                    ori2PathParams++;
+                } else if (p.getType() == ParameterType.MATRIX) {
+                    ori2MatrixParams++;
+                }
             }
+    
+            return ori1PathParams == ori2PathParams && ori1MatrixParams == ori2MatrixParams;
+        } else {
+            return true;
         }
-
-        return ori1PathParams == ori2PathParams && ori1MatrixParams == ori2MatrixParams;
     }
 
     private boolean openResource(String path) {


Mime
View raw message