Skip to content

Commit

Permalink
Merge pull request #13 from sentrysoftware/feature/MTX-518-Remove-imm…
Browse files Browse the repository at this point in the history
…utable-lists

[#14] Unsupported Operation Exception when using CiscoUCSRest request using CLI
  • Loading branch information
NassimBtk authored Jan 9, 2024
2 parents 167f24b + 687a7ee commit 14801d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
*/

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -55,7 +56,7 @@ public static List<List<String>> arrange(

// if there's no map return empty list
if (null == rowValuesMap || rowValuesMap.isEmpty()) {
return Collections.emptyList();
return new ArrayList<>();
}

// Recursively Link and merge the rows fragments and keep the row order.
Expand All @@ -69,7 +70,7 @@ public static List<List<String>> arrange(

static List<String> getValueData(final Map<Integer, String> values, final int totalProperties) {
return values.containsKey(ROOT_TAG_NOT_FOUND) ?
Collections.emptyList() :
new ArrayList<>() :
IntStream.range(0, totalProperties).boxed()
.map(id -> values.getOrDefault(id, Utils.EMPTY))
.collect(Collectors.toList());
Expand Down

0 comments on commit 14801d8

Please sign in to comment.