simplify switch case flow for DownloadMission
This commit is contained in:
parent
8e3449180f
commit
c57f14bca5
|
@ -396,17 +396,11 @@ public class DownloadMission extends Mission {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyPostProcessing(int state) {
|
private void notifyPostProcessing(int state) {
|
||||||
String action;
|
String action = switch (state) {
|
||||||
switch (state) {
|
case 1 -> "Running";
|
||||||
case 1:
|
case 2 -> "Completed";
|
||||||
action = "Running";
|
default -> "Failed";
|
||||||
break;
|
};
|
||||||
case 2:
|
|
||||||
action = "Completed";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
action = "Failed";
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.d(TAG, action + " postprocessing on " + storage.getName());
|
Log.d(TAG, action + " postprocessing on " + storage.getName());
|
||||||
|
|
||||||
|
@ -590,13 +584,11 @@ public class DownloadMission extends Mission {
|
||||||
* @return {@code true} if this mission is unrecoverable
|
* @return {@code true} if this mission is unrecoverable
|
||||||
*/
|
*/
|
||||||
public boolean isPsFailed() {
|
public boolean isPsFailed() {
|
||||||
switch (errCode) {
|
return switch (errCode) {
|
||||||
case ERROR_POSTPROCESSING:
|
case ERROR_POSTPROCESSING, ERROR_POSTPROCESSING_STOPPED -> psAlgorithm.worksOnSameFile;
|
||||||
case ERROR_POSTPROCESSING_STOPPED:
|
default -> false;
|
||||||
return psAlgorithm.worksOnSameFile;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue