cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1215333 - /cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
Date Fri, 16 Dec 2011 23:06:51 GMT
Author: sergeyb
Date: Fri Dec 16 23:06:51 2011
New Revision: 1215333

URL: http://svn.apache.org/viewvc?rev=1215333&view=rev
Log:
[DOSGI-77] Adding a couple of NPE guards

Modified:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java?rev=1215333&r1=1215332&r2=1215333&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java Fri
Dec 16 23:06:51 2011
@@ -589,12 +589,15 @@ public final class OsgiUtils {
 
             String pack = iClass.getPackage().getName();
             LOG.finest("Looking for Package: " + pack);
-
-            for (ExportedPackage p : ep) {
-                if (pack.equals(p.getName())) {
-                    LOG.fine("found package -> Version: " + p.getVersion());
-                    return p.getVersion().toString();
-                }
+            if (ep != null) {
+	            for (ExportedPackage p : ep) {
+	            	if (p != null) {
+		                if (pack.equals(p.getName())) {
+		                    LOG.fine("found package -> Version: " + p.getVersion());
+		                    return p.getVersion().toString();
+		                }
+	            	}
+	            }
             }
         } else {
             LOG.severe("Was unable to obtain the package admin service -> can't resolve
interface versions");



Mime
View raw message