Skip to content

Commit 62e5e01

Browse files
author
Federico Fissore
committed
Code cleanup
1 parent ea92393 commit 62e5e01

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arduino-core/src/processing/app/helpers/CommandlineParser.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ private enum ACTION {
4141
private String getPref;
4242
private String boardToInstall;
4343
private String libraryToInstall;
44-
private List<String> filenames = new LinkedList<String>();
44+
private final List<String> filenames = new LinkedList<>();
4545

4646
public CommandlineParser(String[] args) {
4747
this.args = args;
4848

49-
actions = new HashMap<String, ACTION>();
49+
actions = new HashMap<>();
5050
actions.put("--verify", ACTION.VERIFY);
5151
actions.put("--upload", ACTION.UPLOAD);
5252
actions.put("--get-pref", ACTION.GET_PREF);
@@ -236,16 +236,19 @@ private void processBoardArgument(String selectBoard) {
236236
TargetPackage targetPackage = BaseNoGui.getTargetPackage(split[0]);
237237
if (targetPackage == null) {
238238
BaseNoGui.showError(null, I18n.format(_("{0}: Unknown package"), split[0]), 3);
239+
return;
239240
}
240241

241242
TargetPlatform targetPlatform = targetPackage.get(split[1]);
242243
if (targetPlatform == null) {
243244
BaseNoGui.showError(null, I18n.format(_("{0}: Unknown architecture"), split[1]), 3);
245+
return;
244246
}
245247

246248
TargetBoard targetBoard = targetPlatform.getBoard(split[2]);
247249
if (targetBoard == null || !targetBoard.getId().equals(split[2])) {
248250
BaseNoGui.showError(null, I18n.format(_("{0}: Unknown board"), split[2]), 3);
251+
return;
249252
}
250253

251254
BaseNoGui.selectBoard(targetBoard);
@@ -314,7 +317,7 @@ public boolean isUploadMode() {
314317
return action == ACTION.UPLOAD;
315318
}
316319

317-
public boolean isVerifyMode() {
320+
private boolean isVerifyMode() {
318321
return action == ACTION.VERIFY;
319322
}
320323

0 commit comments

Comments
 (0)