felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1097224 - /felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java
Date Wed, 27 Apr 2011 20:01:26 GMT
Author: rickhall
Date: Wed Apr 27 20:01:25 2011
New Revision: 1097224

URL: http://svn.apache.org/viewvc?rev=1097224&view=rev
Log:
Fix NPE bug and lack of output for unmatched search. (FELIX-2937, FELIX-2938)

Modified:
    felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java

Modified: felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java?rev=1097224&r1=1097223&r2=1097224&view=diff
==============================================================================
--- felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java (original)
+++ felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/OBR.java Wed Apr
27 20:01:25 2011
@@ -272,7 +272,7 @@ public class OBR
                 targetVersion = args[argIdx].substring(idx + 1);
             }
             Resource[] resources = searchRepository(ra, targetName, targetVersion);
-            if (resources == null)
+            if ((resources == null) || (resources.length == 0))
             {
                 System.err.println("Unknown bundle and/or version: " + args[argIdx]);
             }
@@ -507,13 +507,21 @@ public class OBR
         try
         {
             Bundle bundle = m_bc.getBundle(Long.parseLong(targetId));
-            targetId = bundle.getSymbolicName();
+            if (bundle != null)
+            {
+                targetId = bundle.getSymbolicName();
+            }
+            else
+            {
+                return null;
+            }
         }
         catch (NumberFormatException ex)
         {
             // It was not a number, so ignore.
         }
 
+
         // The targetId may be a bundle name or a bundle symbolic name,
         // so create the appropriate LDAP query.
         StringBuffer sb = new StringBuffer("(|(presentationname=");



Mime
View raw message