Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: EXP05-J link fix

...

Although it advises against depending on parentheses for specifying evaluation order , EXP05-J. Do not write more than once to the same variable follow a write by a subsequent write or read of the same object within an expression applies only to expressions that contain side effects.

...

Detection of all expressions using low-precedence operators without parentheses is straightforward. Determining the correctness of such uses is infeasible in the general case, although heuristic warnings could be useful.

Automated Detection

Tool
Version
Checker
Description
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
FB.CORRECTNESS.BSHIFT_WRONG_ADD_PRIORITYPossible bad parsing of shift operation
SonarQube Java Plugin
Include Page
SonarQube Java Plugin_V
SonarQube Java Plugin_V
S864
 

Bibliography

[ESA 2005]

Rule 65, Use parentheses to explicitly indicate the order of execution of numerical operators

[Tutorials 2013]

Expressions, Statements, and Blocks

...


...