rspec/rules/S1527/java/rule.adoc

42 lines
725 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
In Java 8, underscore (``++_++``) cannot be used as a parameter to a lambda, and by Java 9, it's a keyword. To ensure future portability (not to mention current readability), it should not be used now as an identifier.
2020-06-30 12:47:33 +02:00
=== Noncompliant code example
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2020-06-30 12:47:33 +02:00
----
private String _; // Noncompliant
----
=== Compliant solution
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2020-06-30 12:47:33 +02:00
----
private String foo;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Rename this (variable|parameter).
=== Highlighting
variable/param name
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]