File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/java/io/r2dbc/postgresql
test/java/io/r2dbc/postgresql Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,12 @@ private static boolean isSpecialOrOperatorChar(char c) {
124124 private static TokenizedSql .Token getBlockCommentToken (String sql , int beginIndex ) {
125125 int depth = 1 ;
126126 for (int i = beginIndex + 2 ; i < (sql .length () - 1 ); i ++) {
127- String biGraph = sql .substring ( i , i + 2 );
128-
129- if (biGraph . equals ( "/*" ) ) {
127+ char c1 = sql .charAt ( i );
128+ char c2 = sql . charAt ( i + 1 );
129+ if (c1 == '/' && c2 == '*' ) {
130130 depth ++;
131131 i ++;
132- } else if (biGraph . equals ( "*/" ) ) {
132+ } else if (c1 == '*' && c2 == '/' ) {
133133 depth --;
134134 i ++;
135135 }
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ void lineCommentIsTokenized() {
6161 @ Test
6262 void cStyleCommentIsTokenized () {
6363 assertSingleStatementEqualsCompleteToken ("/*Test*/" , TokenizedSql .TokenType .COMMENT );
64+ assertSingleStatementEqualsCompleteToken ("/**/" , TokenizedSql .TokenType .COMMENT );
65+ assertSingleStatementEqualsCompleteToken ("/*T*/" , TokenizedSql .TokenType .COMMENT );
6466 }
6567
6668 @ Test
You can’t perform that action at this time.
0 commit comments