From bb0dfc3397d6a64c297d7d3d2eabe0d91f3f624b Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 12 Mar 2026 10:56:35 +0100 Subject: [PATCH 1/2] Reduce equal method candidates log from WARNING to FINE The "Both X and Y are equal candidates" message fires during normal CORS preflight handling where wildcard media types are used, producing noisy logs. Downgrade to FINE since the behavior is deterministic and users can enable debug logging to investigate ambiguous routing. Closes #862 Co-Authored-By: Claude Opus 4.6 --- .../cxf/jaxrs/model/OperationResourceInfoComparatorBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 c382d8d0b71..72ee2132fe4 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 @@ -98,8 +98,8 @@ protected int compare(OperationResourceInfo e1, OperationResourceInfo e2, boolea e1.getClassResourceInfo().getServiceClass().getName() + "#" + e1.getMethodToInvoke().getName(); String m2Name = e2.getClassResourceInfo().getServiceClass().getName() + "#" + e2.getMethodToInvoke().getName(); - LOG.warning("Both " + m1Name + " and " + m2Name + " are equal candidates for handling the current request" - + " which can lead to unpredictable results"); + LOG.fine("Both " + m1Name + " and " + m2Name + " are equal candidates for handling the current request" + + " which can lead to unpredictable results"); } return result; } From 4197f73b707aff9e76f64fb753674d9d143b8fa9 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 12 Mar 2026 10:57:15 +0100 Subject: [PATCH 2/2] Improve wording and use lazy logging for equal candidates message Drop misleading "unpredictable results" phrasing (the sort is stable) and use a lambda supplier to avoid string concatenation overhead when FINE logging is disabled. Co-Authored-By: Claude Opus 4.6 --- .../cxf/jaxrs/model/OperationResourceInfoComparatorBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 72ee2132fe4..7f8a8e059c9 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 @@ -98,8 +98,8 @@ protected int compare(OperationResourceInfo e1, OperationResourceInfo e2, boolea e1.getClassResourceInfo().getServiceClass().getName() + "#" + e1.getMethodToInvoke().getName(); String m2Name = e2.getClassResourceInfo().getServiceClass().getName() + "#" + e2.getMethodToInvoke().getName(); - LOG.fine("Both " + m1Name + " and " + m2Name + " are equal candidates for handling the current request" - + " which can lead to unpredictable results"); + LOG.fine(() -> "Both " + m1Name + " and " + m2Name + + " are equal candidates for handling the current request"); } return result; }