26 lines
695 B
Plaintext
26 lines
695 B
Plaintext
![]() |
=== On 2014-10-01T11:39:51Z Nicolas Peru Wrote:
|
||
|
Sub task for RSPEC-1764 with updated description for Java, please review.
|
||
|
|
||
|
=== On 2014-10-01T11:44:49Z Ann Campbell Wrote:
|
||
|
\[~nicolas.peru] I question retaining this noncompliant example:
|
||
|
|
||
|
----
|
||
|
if (5 / 5) { // always 1
|
||
|
doV();
|
||
|
}
|
||
|
----
|
||
|
|
||
|
In C, >=1 evaluates to true & 0 evaluates to false. Is it that the same holds true in Java but it's just considered very bad form? If so, then why eliminate this one:
|
||
|
|
||
|
----
|
||
|
if (5 - 5) { // always 0
|
||
|
do_u();
|
||
|
}
|
||
|
----
|
||
|
?
|
||
|
|
||
|
|
||
|
Also, we have a different rule that yells at people for using equality operators with floating-point numbers, so the first exception is doubly confusing
|
||
|
|
||
|
include::../comments-and-links.adoc[]
|