We're updating the issue view to help you get more done. 

NamedMatcher.equals() does not compare all instance fields with another; hashCode() also wrong

Description

The NamedMatcher.equals() function currently only checks whether the matcher instance is equal to the other's matcher instance. It should also compare the parentPattern.

It also does not do a basic type comparison or null-check (something that every equals() should do).

Similarly, NamedMatcher.hashCode() currently only returns the hash code of the matcher instance when it should include parentPattern.hashCode() because parentPattern is also used in equals().

This was found by FindBugs.

Environment

None

Status

Assignee

TonyT

Reporter

TonyT

Labels

None

Fix versions

Priority

Major