felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r707743 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
Date Fri, 24 Oct 2008 20:37:21 GMT
Author: rickhall
Date: Fri Oct 24 13:37:21 2008
New Revision: 707743

URL: http://svn.apache.org/viewvc?rev=707743&view=rev
Log:
Fixed potential NPE when comparing resources. (FELIX-789)

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

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java?rev=707743&r1=707742&r2=707743&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
Fri Oct 24 13:37:21 2008
@@ -30,6 +30,14 @@
         Resource r2 = (Resource) o2;
         String name1 = (String) r1.getPresentationName();
         String name2 = (String) r2.getPresentationName();
+        if (name1 == null)
+        {
+            return -1;
+        }
+        else if (name2 == null)
+        {
+            return 1;
+        }
         return name1.compareToIgnoreCase(name2);
     }
 }
\ No newline at end of file



Mime
View raw message