Enable and fix more Eclipse warnings

Enable and fix warnings:

- Missing `hashCode` method on classes that define `equals`
- Redundant null check

Also enable "possible accidental boolean assignment" warning.  There
are currently no instances of this but it might be useful to enable.

Change-Id: I7659ae66bedb6a17e088c90d2165282b7fe33695
This commit is contained in:
David Pursehouse
2014-10-31 18:36:03 +09:00
parent 1c8767ed14
commit 7a05f9f6a8
3 changed files with 10 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.client.diff;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/** Helper class to handle calculations involving line gaps. */
class LineMapper {
@@ -192,6 +193,11 @@ class LineMapper {
return false;
}
@Override
public int hashCode() {
return Objects.hash(this);
}
@Override
public String toString() {
return line + " " + aligned;