Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2971

Avoid the NPE of AnnotationsFactoryBeanListener

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3
    • None
    • None

    Description

      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));
      
      

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: