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-6503] Updating JavaDocProvider to check methods derived from super interfaces, patch from Francesco Chicchiricc├▓ applied with thanks, This closes #95
Date Thu, 08 Oct 2015 12:32:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 12100800f -> e5b52ab82


[CXF-6503] Updating JavaDocProvider to check methods derived from super interfaces, patch
from Francesco Chicchiricc├▓ applied with thanks, This closes #95


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

Branch: refs/heads/3.0.x-fixes
Commit: e5b52ab829b75acd0d47b33a25d2932dfa1502a6
Parents: 1210080
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Oct 8 13:30:59 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Oct 8 13:31:46 2015 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/model/wadl/JavaDocProvider.java      | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e5b52ab8/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
index 17162bc..a5bcf0c 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
@@ -73,7 +73,7 @@ public class JavaDocProvider implements DocumentationProvider {
     
     public String getClassDoc(ClassResourceInfo cri) {
         try {
-            ClassDocs doc = getClassDocInternal(cri);
+            ClassDocs doc = getClassDocInternal(cri.getServiceClass());
             if (doc == null) {
                 return null;
             }
@@ -123,7 +123,7 @@ public class JavaDocProvider implements DocumentationProvider {
                 return null;
             }
         } catch (Exception ex) {
-            // ignore    
+            // ignore  
         }
         return null;
     }
@@ -132,7 +132,7 @@ public class JavaDocProvider implements DocumentationProvider {
         if (cls.getAnnotation(Path.class) != null) { 
             return cls;
         }
-        if (cls.getSuperclass().getAnnotation(Path.class) != null) {
+        if (cls.getSuperclass() != null && cls.getSuperclass().getAnnotation(Path.class)
!= null) {
             return cls.getSuperclass();
         }
         for (Class<?> i : cls.getInterfaces()) {
@@ -143,8 +143,8 @@ public class JavaDocProvider implements DocumentationProvider {
         return cls;
     }
     
-    private ClassDocs getClassDocInternal(ClassResourceInfo cri) throws Exception {
-        Class<?> annotatedClass = getPathAnnotatedClass(cri.getServiceClass());
+    private ClassDocs getClassDocInternal(Class<?> cls) throws Exception {
+        Class<?> annotatedClass = getPathAnnotatedClass(cls);
         String resource = annotatedClass.getName().replace(".", "/") + ".html";
         ClassDocs classDocs = docs.get(resource);
         if (classDocs == null) {
@@ -169,12 +169,13 @@ public class JavaDocProvider implements DocumentationProvider {
     
     
     private MethodDocs getOperationDocInternal(OperationResourceInfo ori) throws Exception
{
-        ClassDocs classDoc = getClassDocInternal(ori.getClassResourceInfo());
+        Method method = ori.getAnnotatedMethod() == null
+                ? ori.getMethodToInvoke()
+                : ori.getAnnotatedMethod();
+        ClassDocs classDoc = getClassDocInternal(method.getDeclaringClass());
         if (classDoc == null) {
             return null;
         }
-        Method method = ori.getAnnotatedMethod() == null ? ori.getMethodToInvoke() 
-            : ori.getAnnotatedMethod(); 
         MethodDocs mDocs = classDoc.getMethodDocs(method);
         if (mDocs == null) {
             String operLink = getOperLink();


Mime
View raw message