correct fix WEB-8151

This commit is contained in:
Vladimir Krivosheev
2013-09-10 19:02:22 +02:00
parent 8534bf1625
commit 9f5e9d5cfe
3 changed files with 21 additions and 4 deletions
@@ -67,6 +67,11 @@ public final class LocalFileUrl implements Url {
return path.equals(((LocalFileUrl)o).path);
}
@Override
public boolean equalsIgnoreParameters(@Nullable Url url) {
return equals(url);
}
@Override
public int hashCode() {
return path.hashCode();
@@ -145,14 +145,24 @@ public final class UrlImpl implements Url {
return false;
}
UrlImpl url = (UrlImpl)o;
return equalsIgnoreParameters(url) && (parameters == null ? url.parameters == null : parameters.equals(url.parameters));
}
@Override
public boolean equalsIgnoreParameters(@Nullable Url o) {
if (this == o) {
return true;
}
if (!(o instanceof UrlImpl)) {
return false;
}
UrlImpl url = (UrlImpl)o;
if (!scheme.equals(url.scheme)) {
return false;
}
if (authority != null ? !authority.equals(url.authority) : url.authority != null) {
return false;
}
if (parameters != null ? !parameters.equals(url.parameters) : url.parameters != null) {
if (authority == null ? url.authority != null : !authority.equals(url.authority)) {
return false;
}
String decodedPath = getPath();
@@ -25,4 +25,6 @@ public interface Url {
@Nullable
String getParametersPart();
boolean equalsIgnoreParameters(@Nullable Url url);
}