Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Jan 20, 2022
1 parent 4b593f8 commit 663e3c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ public class TraceOptions {
private final Set<String> disabledFields;
private final Set<String> unsupportedOptions;

public TraceOptions(Map<String, String> traceOptions) {
supportedOptions = new ArrayList<>();
supportedOptions.addAll(Arrays.stream(DisableOption.values())
.map(option -> option.option).collect(Collectors.toList()));
public TraceOptions() {
supportedOptions = Arrays.stream(DisableOption.values()).map(option -> option.option)
.collect(Collectors.toList());

this.disabledFields = new HashSet<>();
this.unsupportedOptions = new HashSet<>();
}

public TraceOptions(Map<String, String> traceOptions) {
this();

if (traceOptions == null || traceOptions.isEmpty()) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ProgramTraceProcessor {
private TraceOptions traceOptions;

public ProgramTraceProcessor() {
traceOptions = new TraceOptions(Collections.emptyMap());
traceOptions = new TraceOptions();
}

public ProgramTraceProcessor(TraceOptions options) {
Expand Down

0 comments on commit 663e3c9

Please sign in to comment.