Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ private List<List<MultiPropertyKey>> carthesianProductMultiProperty(int index, L
}


List<MultiPropertyKey> getPermutations(String key, String[] values) {
List<MultiPropertyKey> getPermutations(String key, String[] propertyValues) {
List<MultiPropertyKey> results = new ArrayList<>();
// Sort a copy. The array of a service property can be the live array of the registration, which other threads read and sort too.
String[] values = propertyValues.clone();
Arrays.sort(values, String.CASE_INSENSITIVE_ORDER);
for (int v = 0; v < values.length; v++) {
String processValue = values[v];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ public void noContext() {
}


@SuppressWarnings("rawtypes")
@Test
public void objectClassArrayOfReferenceIsNotModified() {
MultiPropertyFilterIndex index = new MultiPropertyFilterIndex("objectClass");
String[] objectClass = new String[] { "org.example.Zeta", "org.example.alpha", "org.example.Mid" };
String[] expected = objectClass.clone();

TestReference ref = new TestReference();
ref.addProperty("service.id", 4711);
ref.addProperty("objectclass", objectClass);

index.addedService(ref, new String("Service"));

assertTrue("The index must not sort the array of the service reference", java.util.Arrays.equals(expected, objectClass));
}


@SuppressWarnings("rawtypes")
@Test
public void noContextCid() {
Expand Down
Loading