mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspections] EscapedSpaceInspection: proper unicode escape support
GitOrigin-RevId: 4595d28c6b09fa8ab5e1afe63cc34f95c5a17a86
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7f445c6f03
commit
c0f509d780
@@ -0,0 +1,8 @@
|
||||
// "Replace '\s' sequences with spaces" "true-preview"
|
||||
class X {
|
||||
void test(String str) {
|
||||
if (str.matches("\uuu1234 +")) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace '\s' sequences with spaces" "true-preview"
|
||||
class X {
|
||||
void test(String str) {
|
||||
if (str.matches("\uuu1234<caret>\s+")) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -42,8 +42,10 @@ public class EscapedSpaceInspection extends AbstractBaseJavaLocalInspectionTool
|
||||
if (pos == -1 || pos == text.length() - 1) break;
|
||||
char next = text.charAt(pos + 1);
|
||||
if (next == 'u') {
|
||||
// unicode escape
|
||||
pos += 6;
|
||||
// unicode escape can contain several 'u', according to the spec
|
||||
pos += 2;
|
||||
while (pos < text.length() && text.charAt(pos) == 'u') pos++;
|
||||
pos += 4;
|
||||
continue;
|
||||
}
|
||||
pos += 2;
|
||||
|
||||
Reference in New Issue
Block a user