Skip to content

Commit

Permalink
Use default statement instead of SuppressWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroyuki-sato committed May 9, 2024
1 parent 454b3ce commit 0e8f6b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/embulk/input/CommandFileInputPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public void cleanup(TaskSource taskSource,
List<TaskReport> successTaskReports) {
}

@SuppressWarnings("MissingSwitchDefault")
@Override
public TransactionalFileInput open(TaskSource taskSource, int taskIndex) {
final TaskMapper taskMapper = CONFIG_MAPPER_FACTORY.createTaskMapper();
Expand All @@ -91,6 +90,9 @@ public TransactionalFileInput open(TaskSource taskSource, int taskIndex) {
case "stderr":
builder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
break;
default:
throw new IllegalStateException(String.format(
"Unknown 'pipe' option '%s'. It must be either 'stdout' or 'stderr'", task.getPipe()));
}

try {
Expand All @@ -105,6 +107,9 @@ public TransactionalFileInput open(TaskSource taskSource, int taskIndex) {
case "stderr":
stream = process.getErrorStream();
break;
default:
throw new IllegalStateException(String.format(
"Unknown 'pipe' option '%s'. It must be either 'stdout' or 'stderr'", task.getPipe()));
}

PluginFileInput input = new PluginFileInput(task, new ProcessWaitInputStream(stream, process));
Expand Down

0 comments on commit 0e8f6b2

Please sign in to comment.