codelipenghui commented on a change in pull request #14586:
URL: https://github.com/apache/pulsar/pull/14586#discussion_r826536123



##########
File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java
##########
@@ -301,7 +306,12 @@ public static Double stringToDouble(String val) {
      * @return The converted Double value.
      */
     public static Float stringToFloat(String val) {
-        return Float.valueOf(trim(val));
+        String v = trim(val);
+        if (io.netty.util.internal.StringUtil.isNullOrEmpty(v)) {

Review comment:
       ```suggestion
           if (StringUtils.isEmpty(v)) {
   ```

##########
File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java
##########
@@ -274,7 +274,12 @@ public static Integer stringToInteger(String val) {
      * @return The converted Long value.
      */
     public static Long stringToLong(String val) {
-        return Long.valueOf(trim(val));
+        String v = trim(val);
+        if (io.netty.util.internal.StringUtil.isNullOrEmpty(v)) {

Review comment:
       ```suggestion
           if (StringUtils.isEmpty(v)) {
   ```

##########
File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java
##########
@@ -384,7 +394,12 @@ public static String booleanToString(Boolean value) {
      * @return The converted Boolean value.
      */
     public static Boolean stringToBoolean(String value) {
-        return Boolean.valueOf(value);
+        String v = trim(value);
+        if (io.netty.util.internal.StringUtil.isNullOrEmpty(v)) {

Review comment:
       ```suggestion
           if (StringUtils.isEmpty(v)) {
   ```




-- 
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