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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to