Skip to content

Commit

Permalink
Merge pull request #11 from sentrysoftware/feature/fix-issue-10-immut…
Browse files Browse the repository at this point in the history
…able-collections

[#10] Fix Unsupported Operation Exception when using CiscoUCSRest request using CLI
  • Loading branch information
NassimBtk authored Jan 11, 2024
2 parents ddcfc93 + f0a9b73 commit 0e03cd8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/org/sentrysoftware/wmi/WqlQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@

import org.sentrysoftware.wmi.exceptions.WqlQuerySyntaxException;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -113,7 +120,7 @@ static List<String> buildSelectedProperties(String propertiesFragment) {
if (Utils.isNotBlank(propertiesFragment)) {
return Arrays.asList(propertiesFragment.trim().toLowerCase().split("\\s*,\\s*"));
}
return Collections.emptyList();
return new ArrayList<>();
}

/**
Expand All @@ -137,7 +144,7 @@ static Map<String, Set<String>> buildSupPropertiesMap(final List<String> propert

// Empty or null?
if (properties == null || properties.isEmpty()) {
return Collections.emptyMap();
return new HashMap<>();
}

Map<String, Set<String>> subPropertiesMap = new LinkedHashMap<>();
Expand Down

0 comments on commit 0e03cd8

Please sign in to comment.