Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix in Document inboundlinks/outboundlinks sorting

orbitere3d19d0a9063
diff --git a/source/net/yacy/document/Document.java b/source/net/yacy/document/Document.java
index 3f7562e44..142bd1be4 100644
--- a/source/net/yacy/document/Document.java
+++ b/source/net/yacy/document/Document.java
@@ -402,10 +402,14 @@ dc_rights
for (Map.Entry<MultiProtocolURI, Properties> entry: anchors.entrySet()) {
url = entry.getKey();
if (url == null) continue;
- if (url.getHost() != null && thishost != null &&
- url.getHost().endsWith(thishost) ||
- (thishost.startsWith("www.") && url.getHost().endsWith(thishost.substring(4)))
- ) this.inboundlinks.put(url, "anchor"); else this.outboundlinks.put(url, "anchor");
+ if ((thishost == null && url.getHost() == null) ||
+ ((thishost != null && url.getHost() != null) &&
+ (url.getHost().endsWith(thishost) ||
+ (thishost.startsWith("www.") && url.getHost().endsWith(thishost.substring(4)))))) {
+ this.inboundlinks.put(url, "anchor");
+ } else {
+ this.outboundlinks.put(url, "anchor");
+ }
u = url.toNormalform(true, false);
String name = entry.getValue().getProperty("name", "");
if (u.startsWith("mailto:")) {