Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24A931801E for ; Thu, 6 Aug 2015 13:27:55 +0000 (UTC) Received: (qmail 60363 invoked by uid 500); 6 Aug 2015 13:27:48 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 60295 invoked by uid 500); 6 Aug 2015 13:27:48 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 60286 invoked by uid 99); 6 Aug 2015 13:27:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2015 13:27:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A092BE6B7F; Thu, 6 Aug 2015 13:27:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <27ab7ed861374fb1b30052e5a91bc0a9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6509] Adding a fine level warning that a given public method is not a JAX-RS method Date: Thu, 6 Aug 2015 13:27:48 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master ee6039d7f -> 69bca0830 [CXF-6509] Adding a fine level warning that a given public method is not a JAX-RS method Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/69bca083 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/69bca083 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/69bca083 Branch: refs/heads/master Commit: 69bca0830e006abba308e9ba109dfcccdcc8c45a Parents: ee6039d Author: Sergey Beryozkin Authored: Thu Aug 6 14:27:22 2015 +0100 Committer: Sergey Beryozkin Committed: Thu Aug 6 14:27:22 2015 +0100 ---------------------------------------------------------------------- .../main/java/org/apache/cxf/jaxrs/utils/Messages.properties | 1 + .../main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java | 7 +++++++ 2 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/69bca083/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties index c8d3aba..d7f181b 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties @@ -20,6 +20,7 @@ # NO_SERVLET_API=No Java Servlet API is available on the runtime classpath NO_RESOURCE_OP_EXC=No resource methods have been found for resource class {0} +NOT_RESOURCE_METHOD={0}#{1} method is not a valid JAX-RS method as it has no Path and HttpMethod annotations GET_INSTEAD_OF_HEAD=Resource class {0} does not support HEAD http method, method {1} supporting GET http method will be invoked NO_CONTENT_TYPE_SPECIFIED=No Content-Type specified for HTTP {0} METHOD_INJECTION_FAILURE=Method {0} injection failure http://git-wip-us.apache.org/repos/asf/cxf/blob/69bca083/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java index afe6ea9..4bbbea1 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java @@ -291,6 +291,8 @@ public final class ResourceUtils { private static void evaluateResourceClass(ClassResourceInfo cri, boolean enableStatic) { MethodDispatcher md = new MethodDispatcher(); Class serviceClass = cri.getServiceClass(); + + boolean isFineLevelLoggable = LOG.isLoggable(Level.FINE); for (Method m : serviceClass.getMethods()) { Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(serviceClass, m); @@ -317,6 +319,11 @@ public final class ResourceUtils { } } } + } else if (isFineLevelLoggable) { + LOG.fine(new org.apache.cxf.common.i18n.Message("NOT_RESOURCE_METHOD", + BUNDLE, + m.getDeclaringClass().getName(), + m.getName()).toString()); } } cri.setMethodDispatcher(md);