cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1089193 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
Date Tue, 05 Apr 2011 20:12:02 GMT
Author: dkulp
Date: Tue Apr  5 20:12:02 2011
New Revision: 1089193

URL: http://svn.apache.org/viewvc?rev=1089193&view=rev
Log:
[CXF-3410] Added a bunch of NPE guards

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java?rev=1089193&r1=1089192&r2=1089193&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
Tue Apr  5 20:12:02 2011
@@ -208,6 +208,9 @@ public class PolicyAnnotationListener im
         if (list != null) {
             addPolicies(factory, server.getEndpoint(), cls, list, Policy.Placement.BINDING);
         }
+        if (cls == null) {
+            return;
+        }
         Policy p = cls.getAnnotation(Policy.class);
         Policies ps = cls.getAnnotation(Policies.class);
         if (p != null || ps != null) {
@@ -268,6 +271,9 @@ public class PolicyAnnotationListener im
 
 
     private void addPolicies(AbstractServiceFactoryBean factory, InterfaceInfo ii, Class<?>
cls) {
+        if (cls == null) {
+            return;
+        }
         Policy p = cls.getAnnotation(Policy.class);
         Policies ps = cls.getAnnotation(Policies.class);
         if (p != null || ps != null) {
@@ -335,7 +341,7 @@ public class PolicyAnnotationListener im
             if (src != null) {
                 try {
                     Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
-                    if (service.getDescription() == null) {
+                    if (service.getDescription() == null && cls != null) {
                         service.setDescription(new DescriptionInfo());
                         service.getDescription().setBaseURI(cls.getResource("/").toString());
                     }



Mime
View raw message