Skip to content

Commit 0e8f6b2

Browse files
committed
Use default statement instead of SuppressWarnings
1 parent 454b3ce commit 0e8f6b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/embulk/input/CommandFileInputPlugin.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public void cleanup(TaskSource taskSource,
7171
List<TaskReport> successTaskReports) {
7272
}
7373

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

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

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

0 commit comments

Comments
 (0)