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-6509] Adding a fine level warning that a given public method is not a JAX-RS method
Date Thu, 06 Aug 2015 13:27:48 GMT
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 <sberyozkin@gmail.com>
Authored: Thu Aug 6 14:27:22 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
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);


Mime
View raw message