Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

REDUN.EQNULL

A redundant operation is one that does not have any effect, such as

  • an assignment of a variable to itself
  • use of an expression that will be evaluated to a constant such as a/a
  • use of an expression that can be reduced to one operand such as a & a

Even if this is not an error on its own, it may indicate a larger error in the code. A REDUN.EQNULL warning is reported for a suspicious call to equals() with null passed as a parameter. Normally, equals(null) returns false (object is never equal to null).

Example 1

9      public int test() {
10         String s = "String";
11         if (s.equals(null)) {
12             return 1;
13         }
14         return 0;
15     }

REDUN.EQNULL is reported for line 11: Suspicious equals() called with 's' and null (never true).