Author: hibou
Date: Sun Nov 13 19:54:16 2011
New Revision: 1201497

URL: http://svn.apache.org/viewvc?rev=1201497&view=rev
Log:
avoid NPE

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfo.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfo.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfo.java?rev=1201497&r1=1201496&r2=1201497&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfo.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfo.java Sun 
Nov 13 19:54:16 2011
@@ -267,7 +267,7 @@ public class BundleInfo {
         Iterator itCapabilities = capabilities.iterator();
         while (itCapabilities.hasNext()) {
             BundleCapability capability = (BundleCapability) 
itCapabilities.next();
-            if (capability.getType().equals(PACKAGE_TYPE)) {
+            if (PACKAGE_TYPE.equals(capability.getType())) {
                 set.add((ExportPackage) capability);
             }
         }
@@ -279,7 +279,7 @@ public class BundleInfo {
         Iterator itCapabilities = capabilities.iterator();
         while (itCapabilities.hasNext()) {
             BundleCapability capability = (BundleCapability) 
itCapabilities.next();
-            if (capability.getType().equals(SERVICE_TYPE)) {
+            if (SERVICE_TYPE.equals(capability.getType())) {
                 set.add(capability);
             }
         }

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java?rev=1201497&r1=1201496&r2=1201497&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java 
Sun Nov 13 19:54:16 2011
@@ -283,7 +283,7 @@ public class BundleInfoAdapter {
             String type = requirement.getType();
             String name = requirement.getName();
 
-            if (type.equals(BundleInfo.PACKAGE_TYPE) && 
exportedPkgNames.contains(name)) {
+            if (BundleInfo.PACKAGE_TYPE.equals(type) && 
exportedPkgNames.contains(name)) {
                 // don't declare package exported by the current bundle
                 continue;
             }
@@ -293,7 +293,7 @@ public class BundleInfoAdapter {
             DefaultDependencyDescriptor dd = new 
DefaultDependencyDescriptor(ddmrid, false);
 
             String conf = CONF_NAME_DEFAULT;
-            if (type.equals(BundleInfo.PACKAGE_TYPE)) {
+            if (BundleInfo.PACKAGE_TYPE.equals(type)) {
                 // declare the configuration for the package
                 conf = CONF_USE_PREFIX + name;
                 md.addConfiguration(new Configuration(CONF_USE_PREFIX + name, 
Visibility.PUBLIC,


Reply via email to