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) {
124
124
private static TokenizedSql .Token getBlockCommentToken (String sql , int beginIndex ) {
125
125
int depth = 1 ;
126
126
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 == '*' ) {
130
130
depth ++;
131
131
i ++;
132
- } else if (biGraph . equals ( "*/" ) ) {
132
+ } else if (c1 == '*' && c2 == '/' ) {
133
133
depth --;
134
134
i ++;
135
135
}
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ void lineCommentIsTokenized() {
61
61
@ Test
62
62
void cStyleCommentIsTokenized () {
63
63
assertSingleStatementEqualsCompleteToken ("/*Test*/" , TokenizedSql .TokenType .COMMENT );
64
+ assertSingleStatementEqualsCompleteToken ("/**/" , TokenizedSql .TokenType .COMMENT );
65
+ assertSingleStatementEqualsCompleteToken ("/*T*/" , TokenizedSql .TokenType .COMMENT );
64
66
}
65
67
66
68
@ Test
You can’t perform that action at this time.
0 commit comments