Polishing

This commit is contained in:
Juergen Hoeller
2015-04-01 17:23:45 +02:00
parent 2c637dcb2e
commit 514eb4281c
4 changed files with 27 additions and 18 deletions

View File

@@ -155,17 +155,17 @@ public class EncodedResource implements InputStreamSource {
@Override
public boolean equals(Object obj) {
if (obj == this) {
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (obj instanceof EncodedResource) {
EncodedResource that = (EncodedResource) obj;
return (this.resource.equals(that.resource) &&
ObjectUtils.nullSafeEquals(this.charset, that.charset) &&
ObjectUtils.nullSafeEquals(this.encoding, that.encoding));
if (!(other instanceof EncodedResource)) {
return false;
}
return false;
EncodedResource otherResource = (EncodedResource) other;
return (this.resource.equals(otherResource.resource) &&
ObjectUtils.nullSafeEquals(this.charset, otherResource.charset) &&
ObjectUtils.nullSafeEquals(this.encoding, otherResource.encoding));
}
@Override