We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From SpotBugs:
The offending method:
@Override public boolean equals(Object _o) { return _o.getClass().equals(MethodTuple.class) && ((MethodTuple) _o).name.equals(this.name) && ((MethodTuple) _o).sig.equals(this.sig); }
SpotBugs is correct, _o needs a null guard (by convention). The IDE generates the following code for hashCode, equals, and the constructor:
_o
null
hashCode
equals
public MethodTuple(final String _name, final String _sig) { name = _name; sig = Objects.requireNonNullElse(_sig, ""); logger.trace("new MethodTuple({}, {})", name, sig); } @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final MethodTuple that = (MethodTuple) o; return Objects.equals(name, that.name) && Objects.equals(sig, that.sig); } @Override public int hashCode() { return Objects.hash(name, sig); }
The text was updated successfully, but these errors were encountered:
6d1d97e
No branches or pull requests
From SpotBugs:
The offending method:
SpotBugs is correct,
_o
needs anull
guard (by convention). The IDE generates the following code forhashCode
,equals
, and the constructor:The text was updated successfully, but these errors were encountered: