Skip to content

Commit

Permalink
Update set handling
Browse files Browse the repository at this point in the history
  • Loading branch information
akang31 committed Feb 6, 2024
1 parent 877d31c commit 5bf66d7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;

import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import org.apache.commons.configuration.AbstractConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationRuntimeException;
Expand Down Expand Up @@ -123,9 +125,8 @@ private Set<String> convertStringFlag(String properties) {
if (properties == null) {
return Collections.emptySet();
}
Set<String> ret = new HashSet<>();
Collections.addAll(ret, properties.split(","));
return ret;

return ImmutableSet.copyOf(Splitter.on(',').trimResults().omitEmptyStrings().split(properties));
}

public Set<String> getUsedProperties() {
Expand Down Expand Up @@ -611,7 +612,7 @@ private Object getProperty(String key, boolean instrument)
public void recordUsage(String key) {
if (enableInstrumentation) {
usedPropertiesRef.get().add(key);
boolean isTrackedProperty = !stackTraceEnabledProperties.isEmpty() && stackTraceEnabledProperties.contains(key);
boolean isTrackedProperty = stackTraceEnabledProperties.contains(key);
if (enableStackTrace || isTrackedProperty) {
String trace = Arrays.toString(Thread.currentThread().getStackTrace());
if (enableStackTrace) {
Expand Down

0 comments on commit 5bf66d7

Please sign in to comment.