rspec/rules/S6035/java/rule.adoc

39 lines
524 B
Plaintext
Raw Normal View History

== Why is this an issue?
include::../description_with_reference_to_s5998.adoc[]
=== 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
----
Pattern.compile("a|b|c"); // 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
----
Pattern.compile("[abc]");
// or
Pattern.compile("[a-c]");
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Replace this alternation with a character class.
=== Highlighting
The alternation
endif::env-github,rspecator-view[]