felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r774904 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
Date Thu, 14 May 2009 20:03:59 GMT
Author: rickhall
Date: Thu May 14 20:03:59 2009
New Revision: 774904

URL: http://svn.apache.org/viewvc?rev=774904&view=rev
Log:
OBR expected all resources to have a presentation name when listing them,
when they did not an NPE resulted. (FELIX-1157)

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java?rev=774904&r1=774903&r2=774904&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
Thu May 14 20:03:59 2009
@@ -241,7 +241,12 @@
                 // Otherwise, compare the presentation name to keep them sorted
                 // by presentation name. If the presentation names are equal, then
                 // use the symbolic name to differentiate.
-                int compare = r1.getPresentationName().compareToIgnoreCase(r2.getPresentationName());
+                int compare = (r1.getPresentationName() == null)
+                    ? -1
+                    : (r2.getPresentationName() == null)
+                        ? 1
+                        : r1.getPresentationName().compareToIgnoreCase(
+                            r2.getPresentationName());
                 if (compare == 0)
                 {
                     return symCompare;



Mime
View raw message