rspec/rules/S1314/java/rule.adoc
Fred Tingaud 6f24cc0632
Clean rule at root
In some cases, the `rule.adoc` at root of a rule is never included
anywhere and thus is dead code.
It's a maintenance cost by itself, but also it misses opportunities to
inline code that seems used by two documents when in fact only one
document is actually rendered. And this missed opportunity, in turn,
stops us from applying the correct language tag on the code samples.
2023-10-16 16:34:38 +02:00

41 lines
784 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,java]
----
int myNumber = 010; // Noncompliant. myNumber will hold 8, not 10 - was this really expected?
----
=== Compliant solution
[source,java]
----
int myNumber = 8;
----
== Resources
* https://wiki.sei.cmu.edu/confluence/x/atYxBQ[CERT, DCL18-C.] - Do not begin integer constants with 0 when specifying a decimal value
* https://wiki.sei.cmu.edu/confluence/x/7DZGBQ[CERT, DCL50-J.] - Use visually distinct identifiers
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]