From f77775220bf6ba65edfa6be439dbad623d1e6ca7 Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 4 Apr 2006 22:28:46 +0000 Subject: [PATCH] fixed parser error git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1999 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/htmlFilter/htmlFilterImageEntry.java | 4 ++-- source/de/anomic/plasma/plasmaParserDocument.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/de/anomic/htmlFilter/htmlFilterImageEntry.java b/source/de/anomic/htmlFilter/htmlFilterImageEntry.java index 9e900dff8..2c5bfd82d 100644 --- a/source/de/anomic/htmlFilter/htmlFilterImageEntry.java +++ b/source/de/anomic/htmlFilter/htmlFilterImageEntry.java @@ -42,7 +42,7 @@ package de.anomic.htmlFilter; import java.net.URL; -public class htmlFilterImageEntry { +public class htmlFilterImageEntry implements Comparable { private URL url; private String alt; @@ -72,7 +72,7 @@ public class htmlFilterImageEntry { } public String toString() { - return "{" + alt + ", " + width + "/" + height + "}"; + return "{" + url.toString() + ", " + alt + ", " + width + "/" + height + "}"; } public int hashCode() { diff --git a/source/de/anomic/plasma/plasmaParserDocument.java b/source/de/anomic/plasma/plasmaParserDocument.java index 47c46bf89..7f31d154c 100644 --- a/source/de/anomic/plasma/plasmaParserDocument.java +++ b/source/de/anomic/plasma/plasmaParserDocument.java @@ -213,11 +213,11 @@ public class plasmaParserDocument { // add the images to the medialinks i = images.iterator(); String normal; + htmlFilterImageEntry iEntry; while (i.hasNext()) { - entry = (Map.Entry) i.next(); - url = (String) entry.getKey(); - normal = htmlFilterContentScraper.urlNormalform(null, url); - if (normal != null) medialinks.put(normal, ((htmlFilterImageEntry) entry.getValue()).alt()); // avoid NullPointerException + iEntry = (htmlFilterImageEntry) i.next(); + normal = htmlFilterContentScraper.urlNormalform(iEntry.url()); + if (normal != null) medialinks.put(normal, iEntry.alt()); // avoid NullPointerException } // expand the hyperlinks: @@ -230,7 +230,6 @@ public class plasmaParserDocument { // finally add image links that we collected from the anchors to the image map i = collectedImages.iterator(); - htmlFilterImageEntry iEntry; while (i.hasNext()) { iEntry = (htmlFilterImageEntry) i.next(); if (!images.contains(iEntry)) images.add(iEntry);