File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
jnosql-tinkerpop/src/main/java/org/eclipse/jnosql/databases/tinkerpop/communication Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,12 @@ enum LikeToRegex {
24
24
25
25
/**
26
26
* Converts like pattern to regex pattern.
27
+ *
27
28
* @param text the like pattern to convert
28
29
* @return the regex pattern
29
30
*/
30
31
String likeToRegex (Object text ) {
31
- String like = text == null ? null : text .toString ();
32
+ String like = text == null ? null : text .toString ();
32
33
if (like == null ) {
33
34
return "(?!)" ;
34
35
}
@@ -37,7 +38,10 @@ String likeToRegex(Object text) {
37
38
for (int i = 0 ; i < like .length (); i ++) {
38
39
char c = like .charAt (i );
39
40
if (c == '%' || c == '_' ) {
40
- if (!lit .isEmpty ()) { rx .append (java .util .regex .Pattern .quote (lit .toString ())); lit .setLength (0 ); }
41
+ if (!lit .isEmpty ()) {
42
+ rx .append (java .util .regex .Pattern .quote (lit .toString ()));
43
+ lit .setLength (0 );
44
+ }
41
45
rx .append (c == '%' ? ".*" : "." );
42
46
} else {
43
47
lit .append (c );
You can’t perform that action at this time.
0 commit comments