mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-119819 (Cannot suppress warnings for inspection "Unnecessary unicode escape sequence")
This commit is contained in:
+6
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -103,7 +103,7 @@ public class UnnecessaryUnicodeEscapeInspection extends BaseInspection {
|
||||
return new UnnecessaryUnicodeEscapeVisitor();
|
||||
}
|
||||
|
||||
private static class UnnecessaryUnicodeEscapeVisitor extends BaseInspectionVisitor {
|
||||
private class UnnecessaryUnicodeEscapeVisitor extends BaseInspectionVisitor {
|
||||
|
||||
@Override
|
||||
public void visitFile(PsiFile file) {
|
||||
@@ -157,6 +157,10 @@ public class UnnecessaryUnicodeEscapeInspection extends BaseInspection {
|
||||
charBuffer.put(d).rewind();
|
||||
final CoderResult coderResult = encoder.encode(charBuffer, byteBuffer, true);
|
||||
if (!coderResult.isUnmappable()) {
|
||||
final PsiElement element = file.findElementAt(i);
|
||||
if (element != null && isSuppressedFor(element)) {
|
||||
return;
|
||||
}
|
||||
registerErrorAtOffset(file, i, escapeEnd - i, Character.valueOf(d));
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -3,4 +3,8 @@ package com.siyeh.igtest.internationalization.unnecessary_unicode_escape;
|
||||
class UnnecessaryUnicodeEscape {
|
||||
// <warning descr="Unicode escape sequence '\uuuuuu0061' can be replaced with 'a'">\uuuuuu0061</warning><warning descr="Unicode escape sequence '\u0062' can be replaced with 'b'">\u0062</warning>
|
||||
// control char & not representable char: \u0010 \u00e4
|
||||
}
|
||||
@SuppressWarnings("UnnecessaryUnicodeEscape")
|
||||
class Suppress {
|
||||
String s = "\u0062";
|
||||
}
|
||||
Reference in New Issue
Block a user