Skip to content

[Suggestion]ArrayEquals supports detection assertEquals(array1, array2) is recommended #1658

@wuchiuwong

Description

@wuchiuwong

Description of the problem / feature request:

For rule ArrayEquals, assertEquals(array1, array2) is also used to determine whether the array is equalalled . It is recommended that this rule supplement the detection of this case.
This rule is implemented in error_prone_core-2.3.4-sources.jar!\com\google\errorprone\bugpatterns\ArrayEquals.java,
use instanceMethod().onClass(isArray()).named("equals"), argument(0, isArrayType()) to detect the case array1.equals(array2),
use staticEqualsInvocation(), argument(0, isArrayType()), argument(1, isArrayType()) to detect the case Array.equals(array1, array2).
So this rule cannot detect this case: assertEquals(array1, array2)

Feature requests: what underlying problem are you trying to solve with this feature?

assertEquals(array1, array2);

What version of Error Prone are you using?

2.3.4

Have you found anything relevant by searching the web?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions