You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/07/02 02:23:46 UTC

[GitHub] [flink] liyafan82 commented on a change in pull request #8936: [FLINK-13043][Library / CEP] Fix the bug of parsing Dewey number from string

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

 ##########
 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:
   @Myasuka thanks for the comments. 
   In some rare cases, the length can be 0. So this condition guards against such cases. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services