mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
don't compare strings with ==
This commit is contained in:
@@ -28,6 +28,8 @@ import java.util.Map;
|
|||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See http://en.wikipedia.org/wiki/URL_normalization for a reference Note: some
|
* See http://en.wikipedia.org/wiki/URL_normalization for a reference Note: some
|
||||||
* parts of the code are adapted from: http://stackoverflow.com/a/4057470/405418
|
* parts of the code are adapted from: http://stackoverflow.com/a/4057470/405418
|
||||||
@@ -46,7 +48,7 @@ public class URLCanonicalizer {
|
|||||||
URL canonicalURL = new URL(UrlResolver.resolveUrl(context == null ? "" : context, href));
|
URL canonicalURL = new URL(UrlResolver.resolveUrl(context == null ? "" : context, href));
|
||||||
|
|
||||||
String host = canonicalURL.getHost().toLowerCase();
|
String host = canonicalURL.getHost().toLowerCase();
|
||||||
if (host == "") {
|
if (StringUtils.isBlank(host)) {
|
||||||
// This is an invalid Url.
|
// This is an invalid Url.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user