Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6FD44188A8 for ; Mon, 11 Jan 2016 10:45:40 +0000 (UTC) Received: (qmail 55074 invoked by uid 500); 11 Jan 2016 10:45:40 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 55043 invoked by uid 500); 11 Jan 2016 10:45:40 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 55009 invoked by uid 99); 11 Jan 2016 10:45:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jan 2016 10:45:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1080D2C1F5C for ; Mon, 11 Jan 2016 10:45:40 +0000 (UTC) Date: Mon, 11 Jan 2016 10:45:40 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6684) A Warning is logged on every JAX-RS call MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15091757#comment-15091757 ] Sergey Beryozkin commented on CXF-6684: --------------------------------------- I've run the test provided on the description and I see no warning - because the check in the referenced code blocks the comparison > A Warning is logged on every JAX-RS call > ---------------------------------------- > > Key: CXF-6684 > URL: https://issues.apache.org/jira/browse/CXF-6684 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.17 > Reporter: Luz > Assignee: Sergey Beryozkin > > A Warning is logged on every JAX-RS call: " Both Object#method and Object#method are equal candidates for handling the current request which can lead to unpredictable results". This occurs even with no configuration errors (only one service with one method). > This bug seems to be introduced by commit d58606e554418899e905cd2f3bc7e8c465eff451. > org.apache.cxf.jaxrs.utils.JAXRSUtils#findTargetMethod uses a java.util.TreeMap with org.apache.cxf.jaxrs.model.OperationResourceInfoComparator. But java.util.TreeMap.put(K, V) calls compare(key, key) internally. > {code:title=Test.java} > @Test > public void testWarning() throws Exception > { > Message m = new MessageImpl(); > Exchange e = new ExchangeImpl(); > e.setInMessage(m); > e.put(Endpoint.class, Mockito.mock(Endpoint.class)); > OperationResourceInfo k = new OperationResourceInfo(getClass().getMethod("toString"), > new ClassResourceInfo(getClass())); > k.setURITemplate(new URITemplate("template")); > new TreeMap<>(new OperationResourceInfoComparator(m, "GET")).put(k, new Object()); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)