Michael Blow has posted comments on this change.

Change subject: ASTERIXDB-1470 Fix escapes in String values in ClassAd Parser
......................................................................


Patch Set 2:

(3 comments)

https://asterix-gerrit.ics.uci.edu/#/c/915/2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Util.java
File 
asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Util.java:

Line 37:     private static final Pattern OCTAL = 
Pattern.compile("\\\\(\\d{3})");
This will only match \nnn; this really needs to handle one or two digits, and 
also should only match on base-8 numbers.

e.g. should be [0-7]{1,3} not \\d{3}


Line 75:                             if (ch == 0) { // "\\0" is an invalid 
substring within a string literal
This isn't right- while null (\0) isn't valid, \012 should be I think.  I think 
you need to catch this as the result of the parseInt in the while loop below.


Line 118:                 m.appendReplacement(out, String.valueOf((char) 
Integer.parseInt(m.group(1), 8)));
see note above- store the result of this parseInt in a literal, and set 
validStr = false if the int is 0.


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/915
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6e4e25263c5a6f0efe26773da7c3b8fcf7e2427
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-HasComments: Yes

Reply via email to