Myasuka commented on a change in pull request #8936: [FLINK-13043][Library / 
CEP] Fix the bug of parsing Dewey number from string
URL: https://github.com/apache/flink/pull/8936#discussion_r299158643
 
 

 ##########
 File path: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java
 ##########
 @@ -175,16 +175,18 @@ public String toString() {
        public static DeweyNumber fromString(final String deweyNumberString) {
                String[] splits = deweyNumberString.split("\\.");
 
-               if (splits.length == 0) {
+               if (splits.length == 1) {
                        return new 
DeweyNumber(Integer.parseInt(deweyNumberString));
-               } else {
+               } else if (splits.length > 0) {
 
 Review comment:
   In which case would the returned `splits` has a length not larger than `0`? 
I think the condition `if (splits.length > 0)` might be redundant.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to