rspec/rules/S2973/java/rule.adoc

51 lines
1.0 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
The use of Unicode escape sequences should be reserved for characters that would otherwise be ambiguous, such as unprintable characters.
This rule ignores sequences composed entirely of Unicode characters, but otherwise raises an issue for each Unicode character that represents a printable character.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
String prefix = "n\u00E9e"; // Noncompliant
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
String prefix = "née";
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this Unicode escape sequence and use the character instead.
'''
== Comments And Links
(visible only on this page)
=== on 27 May 2015, 08:43:19 Freddy Mallet wrote:
I would not activate this rule by default otherwise we might generate a lot of noise out of the box.
=== on 27 May 2015, 19:15:11 Ann Campbell wrote:
Inactive by default
=== on 2 Jun 2015, 13:58:34 Nicolas Peru wrote:
ok for me.
endif::env-github,rspecator-view[]