Polishing

This commit is contained in:
Juergen Hoeller
2015-04-01 17:12:29 +02:00
parent 50f49774bc
commit 34a5fb28c2
2 changed files with 19 additions and 15 deletions

View File

@@ -85,6 +85,7 @@ public class EncodedResource {
this.charset = charset;
}
/**
* Return the {@code Resource} held by this {@code EncodedResource}.
*/
@@ -152,17 +153,17 @@ public class EncodedResource {
@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