alexott commented on a change in pull request #3796:
URL: https://github.com/apache/zeppelin/pull/3796#discussion_r439810957



##########
File path: 
zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/util/SqlSplitter.java
##########
@@ -79,11 +81,9 @@ public SqlSplitter(String... 
additionalSingleCommentPrefixList) {
       }
 
       // end of multiple line comment
-      if (multiLineComment && character == '/' && text.charAt(index - 1) == 
'*') {
+      if (multiLineComment && (index - 1) >= 0 && text.charAt(index - 1) == '/'

Review comment:
       Can we replace ` (index - 1) >= 0` with ` (index - 2) >= 0` and just 
skip it later?

##########
File path: 
zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/util/SqlSplitter.java
##########
@@ -106,39 +106,30 @@ public SqlSplitter(String... 
additionalSingleCommentPrefixList) {
               && text.length() > (index + 1)) {
         if (isSingleLineComment(text.charAt(index), text.charAt(index + 1))) {
           singleLineComment = true;
-        } else if (text.charAt(index) == '/' && text.charAt(index + 1) == '*') 
{
+        } else if (text.charAt(index) == '/' && text.charAt(index + 1) == '*'
+                && text.length() > (index + 2) && text.charAt(index + 2) != 
'+') {

Review comment:
       I would move `text.length() > (index + 2)` before `text.charAt(index + 
1) == '*'`




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


Reply via email to