Skip to content
Snippets Groups Projects
Commit 0c2896e4 authored by dgelessus's avatar dgelessus
Browse files

Use new ProB 2 API methods for handling pretty operation names

parent ae69755e
Branches
No related tags found
No related merge requests found
...@@ -54,32 +54,6 @@ public final class CommandUtils { ...@@ -54,32 +54,6 @@ public final class CommandUtils {
throw new AssertionError("Utility class"); throw new AssertionError("Utility class");
} }
public static @NotNull String prettyOperationName(final @NotNull String name) {
switch (name) {
case "$setup_constants":
return "SETUP_CONSTANTS";
case "$initialise_machine":
return "INITIALISATION";
default:
return name;
}
}
public static @NotNull String unprettyOperationName(final @NotNull String name) {
switch (name) {
case "SETUP_CONSTANTS":
return "$setup_constants";
case "INITIALISATION":
return "$initialise_machine";
default:
return name;
}
}
/** /**
* <p> * <p>
* Split an argument string according to the given parameter specification. * Split an argument string according to the given parameter specification.
......
...@@ -71,7 +71,7 @@ public final class ExecCommand implements Command { ...@@ -71,7 +71,7 @@ public final class ExecCommand implements Command {
@Override @Override
public @NotNull DisplayData run(final @NotNull ParsedArguments args) { public @NotNull DisplayData run(final @NotNull ParsedArguments args) {
final Trace trace = this.animationSelector.getCurrentTrace(); final Trace trace = this.animationSelector.getCurrentTrace();
final String translatedOpName = CommandUtils.unprettyOperationName(args.get(OPERATION_PARAM)); final String translatedOpName = Transition.unprettifyName(args.get(OPERATION_PARAM));
final String predicate; final String predicate;
if (!args.get(PREDICATE_PARAM).isPresent()) { if (!args.get(PREDICATE_PARAM).isPresent()) {
predicate = "1=1"; predicate = "1=1";
...@@ -103,8 +103,7 @@ public final class ExecCommand implements Command { ...@@ -103,8 +103,7 @@ public final class ExecCommand implements Command {
final List<String> opNames = this.animationSelector.getCurrentTrace() final List<String> opNames = this.animationSelector.getCurrentTrace()
.getNextTransitions() .getNextTransitions()
.stream() .stream()
.map(Transition::getName) .map(Transition::getPrettyName)
.map(CommandUtils::prettyOperationName)
.distinct() .distinct()
.filter(s -> s.startsWith(prefix)) .filter(s -> s.startsWith(prefix))
.sorted() .sorted()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment