Skip to content

Commit

Permalink
fixes Collections util used in returns
Browse files Browse the repository at this point in the history
  • Loading branch information
CBiasuzzi authored and sylvlecl committed Nov 2, 2018
1 parent dc53ec2 commit 543cef9
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {
.program(config.getAmplHomeDir().resolve("ampl").toString())
.args("projector.run")
.build();
return Arrays.asList(new CommandExecution(command, 1, 0));
return Collections.singletonList(new CommandExecution(command, 1, 0));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public CompletableFuture<ImpactAnalysisResult> runAsync(SimulationState state, S
@Override
public List<CommandExecution> before(Path workingDir) throws IOException {
Command cmd = DymolaImpactAnalysis.this.createCommand(state, contingencyIds, workingDir, contingencies);
return Arrays.asList(new CommandExecution(cmd, contingencies.size(), priority, ImmutableMap.of("state", state.getName())));
return Collections.singletonList(new CommandExecution(cmd, contingencies.size(), priority, ImmutableMap.of("state", state.getName())));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public CompletableFuture<ImpactAnalysisResult> runAsync(SimulationState state, S
@Override
public List<CommandExecution> before(Path workingDir) throws IOException {
Command cmd = EurostagImpactAnalysis.this.before(state, contingencyIds, workingDir, contingencies);
return Arrays.asList(new CommandExecution(cmd, contingencies.size(), priority, ImmutableMap.of("state", state.getName())));
return Collections.singletonList(new CommandExecution(cmd, contingencies.size(), priority, ImmutableMap.of("state", state.getName())));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {

context = EurostagStabilization.this.before(workingDir);

return Arrays.asList(createCommandExecution());
return Collections.singletonList(createCommandExecution());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {
Converter.convert(network, lc, fes, workingDir.resolve(FPF_CLASSIC_INPUT_FILE), workingDir.resolve(FPF_CLASSIC_INPUT_FILE_CONT_MAPPING));

Command cmd = createFPFClassicCommand(destPath, workingDir.resolve(FPF_CLASSIC_INPUT_FILE));
return Arrays.asList(new CommandExecution(cmd, 1, Integer.MAX_VALUE));
return Collections.singletonList(new CommandExecution(cmd, 1, Integer.MAX_VALUE));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {

LOGGER.info("Running montecarlo sampler on {} network, asking for {} samples", network.getId(), nSamples);
Command cmd = createCommand(forecastOfflineSamplesDataFile, localNetworkDataMatFile);
return Arrays.asList(new CommandExecution(cmd, 1));
return Collections.singletonList(new CommandExecution(cmd, 1));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {

LOGGER.info("Preparing FPF input data for {} network", network.getId());
Command cmd = createFPFCommand(localForecastErrorsDataFile, localNetworkDataMatFile);
return Arrays.asList(new CommandExecution(cmd, 1));
return Collections.singletonList(new CommandExecution(cmd, 1));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
Expand Down Expand Up @@ -308,7 +307,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {
WCA_SENSIBILITIES_FILE,
WCA_INFLUENCE_PST_FILE)
.build();
return Arrays.asList(new CommandExecution(cmd, 1));
return Collections.singletonList(new CommandExecution(cmd, 1));
}

@Override
Expand Down Expand Up @@ -405,7 +404,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {
WCA_SENSIBILITIES_FILE,
WCA_INFLUENCE_PST_FILE)
.build();
return Arrays.asList(new CommandExecution(cmd, 1));
return Collections.singletonList(new CommandExecution(cmd, 1));
}

@Override
Expand Down

0 comments on commit 543cef9

Please sign in to comment.