Avoid the NPE of AnnotationsFactoryBeanListener 
------------------------------------------------

                 Key: CXF-2971
                 URL: https://issues.apache.org/jira/browse/CXF-2971
             Project: CXF
          Issue Type: Improvement
            Reporter: Willem Jiang
            Assignee: Willem Jiang
             Fix For: 2.3


{code}
Index: 
src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
===================================================================
--- 
src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
    (revision 992197)
+++ 
src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
    (working copy)
@@ -81,6 +81,10 @@
             Class<?> cls = (Class<?>)args[2];
             Endpoint ep = (Endpoint)args[1];
             Bus bus = factory.getBus();
+            // To avoid the NPE
+            if (cls == null) {
+                return;
+            }
             addSchemaValidationSupport(ep, 
cls.getAnnotation(SchemaValidation.class));
             addFastInfosetSupport(ep, cls.getAnnotation(FastInfoset.class));
             addGZipSupport(ep, bus, cls.getAnnotation(GZIP.class));

{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to