A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/885 below:

[java] CompareObjectsWithEqualsRule trigger by enum1 != enum2 · Issue #885 · pmd/pmd · GitHub

Affects PMD Version:
6.0.1

Rule:
CompareObjectsWithEquals

Description:
enum1 != enum2 triggers CompareObjectsWithEquals.
I've seen there is code in CompareObjectsWithEqualsRule.java that says "skip, if it is an enum", but it doesn't.

Code Sample demonstrating the issue:

public static void assertEquals(final Enum<?> enum1,
                                    final Enum<?> enum2,
                                    final UUID errorKey,
                                    final Object... errorArgs)
        throws ResponseException
    {
        if (enum1 != enum2)
        {
            throw new ResponseException(errorKey, errorArgs);
        }
    }

Running PMD through: [CLI | Gradle]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4