SbloodyS commented on code in PR #16564:
URL:
https://github.com/apache/dolphinscheduler/pull/16564#discussion_r1740821729
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/TaskTimeoutStrategy.java:
##########
@@ -50,13 +55,11 @@ public String getDescp() {
return descp;
}
+ private static final Map<Integer, TaskTimeoutStrategy> code2Strategy =
Arrays.stream(values()).collect(Collectors.toMap(x -> x.code, x -> x));
+
+
public static TaskTimeoutStrategy of(int status) {
- for (TaskTimeoutStrategy es : values()) {
- if (es.getCode() == status) {
- return es;
- }
- }
- throw new IllegalArgumentException("invalid status : " + status);
Review Comment:
This is meaningless since this enum only have 3 values. Please open another
more meaningful pull request. @LiJie20190102
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]