Prevent possible NPE in AuthorRevision.equals

Add check for the given object being an instance of the
expected class.

This clears a warning from Findbugs.

Change-Id: I097f8894239f04804a0038b504eccd8e2374b07a
This commit is contained in:
David Pursehouse
2013-12-16 14:15:20 +09:00
parent d26a0a26a5
commit 0ee2e98606

View File

@@ -210,6 +210,9 @@ class History extends FlowPanel {
@Override
public boolean equals(Object o) {
if (!(o instanceof AuthorRevision)) {
return false;
}
AuthorRevision b = (AuthorRevision) o;
return author == b.author && revision == b.revision;
}