Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Coverity Prevent Version 5.0 MUTABLE_COMPARISON checker can detect the instances where compareTo method is reading from a non-constant field. If the non-constant field is modified, the value of compareTo might change, which may break program invariants.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Other Languages

This rule appears in the C++ Secure Coding Standard as ARR40-CPP. Use a valid ordering rule.

Related Guidelines

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="04804c70e348cf2b-8a20e5e9-40aa4221-9509a8c0-fed0fd2f25036adda866dfb2"><ac:plain-text-body><![CDATA[

[[MITRE 2009

AA. Bibliography#MITRE 09]]

[CWE-573

http://cwe.mitre.org/data/definitions/573.html] "Improper Following of Specification by Caller"

]]></ac:plain-text-body></ac:structured-macro>

Other Languages

...

Bibliography

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="74b5440139b71cb5-0621a0ff-44ae47c9-869eb7b4-def295267d463fc70bf81d65"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 06]]

method [compareTo()

http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html#compareTo(java.lang.Object)]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e36e2435c2f6a94f-560598e5-4d3d4ede-aa5da2d1-b12c01a162bb2505770b994a"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. Bibliography#JLS 05]]

 

]]></ac:plain-text-body></ac:structured-macro>

...