commit | 20249c63d2be4862258f9bbf41808d4ef08023d6 | [log] [tgz] |
---|---|---|
author | Carsten Ziegeler <cziegeler@apache.org> | Wed Aug 27 11:39:08 2014 +0000 |
committer | Carsten Ziegeler <cziegeler@apache.org> | Wed Aug 27 11:39:08 2014 +0000 |
tree | 4d23ac1a40edfa5d9e07d238c12f383d2fde5d7d | |
parent | c59b1bea5ee8fe872bf894bc0c3662105fed35a7 [diff] |
FELIX-4616 : BundleRepository ResourceComparator violates comparison contract git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1620867 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java index 35f7439..2dfc892 100644 --- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java +++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java
@@ -1,4 +1,4 @@ -/* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -28,10 +28,14 @@ { Resource r1 = (Resource) o1; Resource r2 = (Resource) o2; - String name1 = (String) r1.getPresentationName(); - String name2 = (String) r2.getPresentationName(); + String name1 = r1.getPresentationName(); + String name2 = r2.getPresentationName(); if (name1 == null) { + if (name2 == null) + { + return 0; + } return -1; } else if (name2 == null)