You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org> on 2023/06/12 06:31:38 UTC

[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #14326: Fix switch task use boolean type error

github-code-scanning[bot] commented on code in PR #14326:
URL: https://github.com/apache/dolphinscheduler/pull/14326#discussion_r1226150387


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParameterUtils.java:
##########
@@ -149,6 +150,40 @@
         }
     }
 
+    public static Serializable getParameterValue(Property property) {
+        if (property == null) {
+            return null;
+        }
+        String value = property.getValue();
+        switch (property.getType()) {
+            case LONG:
+                return Long.valueOf(value);

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2948)



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParameterUtils.java:
##########
@@ -149,6 +150,40 @@
         }
     }
 
+    public static Serializable getParameterValue(Property property) {
+        if (property == null) {
+            return null;
+        }
+        String value = property.getValue();
+        switch (property.getType()) {
+            case LONG:
+                return Long.valueOf(value);
+            case FLOAT:
+                return Float.valueOf(value);

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2949)



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParameterUtils.java:
##########
@@ -149,6 +150,40 @@
         }
     }
 
+    public static Serializable getParameterValue(Property property) {
+        if (property == null) {
+            return null;
+        }
+        String value = property.getValue();
+        switch (property.getType()) {
+            case LONG:
+                return Long.valueOf(value);
+            case FLOAT:
+                return Float.valueOf(value);
+            case INTEGER:
+                return Integer.valueOf(value);

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2950)



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParameterUtils.java:
##########
@@ -149,6 +150,40 @@
         }
     }
 
+    public static Serializable getParameterValue(Property property) {
+        if (property == null) {
+            return null;
+        }
+        String value = property.getValue();
+        switch (property.getType()) {
+            case LONG:
+                return Long.valueOf(value);
+            case FLOAT:
+                return Float.valueOf(value);
+            case INTEGER:
+                return Integer.valueOf(value);
+            case DOUBLE:
+                return Double.valueOf(value);

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2951)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org