*) made sure that   is replaced with a space and not just deleted in CharacterCoding.java

*) added annotations and made minor changes to serverObjects.java
*) set subversion properties for several files

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6409 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 16 years ago
parent 6c347a37eb
commit 8829ec5f18

@ -30,6 +30,7 @@ public class CharacterCoding {
private static final char amp_unicode = "\u0026".charAt(0); private static final char amp_unicode = "\u0026".charAt(0);
private static final String amp_html = "&"; private static final String amp_html = "&";
private static final String space_html = " ";
private static final String[] mapping4xml = { private static final String[] mapping4xml = {
"\"",""", //quotation mark "\"",""", //quotation mark
@ -253,6 +254,10 @@ public class CharacterCoding {
sb.append(amp_unicode); sb.append(amp_unicode);
continue; continue;
} }
if (s.equals(space_html)) {
sb.append(" ");
continue;
}
if ((r = html2unicode4xml.get(s)) != null) { if ((r = html2unicode4xml.get(s)) != null) {
sb.append(r.charValue()); sb.append(r.charValue());
continue; continue;
@ -288,5 +293,9 @@ public class CharacterCoding {
final String text2 = "encodeUnicode2xml: & \" < >"; final String text2 = "encodeUnicode2xml: & \" < >";
System.out.println(text2); System.out.println(text2);
System.out.println(unicode2xml(text2, true)); System.out.println(unicode2xml(text2, true));
final String text3 = "space&nbsp;t&auml;st";
System.out.println(text3);
System.out.println(html2unicode(text3));
} }
} }

@ -4,9 +4,9 @@
// first published on http://www.anomic.de // first published on http://www.anomic.de
// Frankfurt, Germany, 2004 // Frankfurt, Germany, 2004
// //
// $LastChangedDate: 2006-02-20 23:57:42 +0100 (Mo, 20 Feb 2006) $ // $LastChangedDate$
// $LastChangedRevision: 1715 $ // $LastChangedRevision$
// $LastChangedBy: borg-0300 $ // $LastChangedBy$
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by

@ -4,8 +4,8 @@
// //
//(C) 2006 by Martin Thelian //(C) 2006 by Martin Thelian
// //
//last change: $LastChangedDate: 2006-05-12 16:35:56 +0200 (Fr, 12 Mai 2006) $ by $LastChangedBy: theli $ //last change: $LastChangedDate$ by $LastChangedBy$
//Revision: $LastChangedRevision: 2086 $ //Revision: $LastChangedRevision$
// //
//This program is free software; you can redistribute it and/or modify //This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by //it under the terms of the GNU General Public License as published by

@ -5,9 +5,9 @@
//Frankfurt, Germany, 2004 //Frankfurt, Germany, 2004
//(C) changes by Bjoern 'fuchs' Krombholz //(C) changes by Bjoern 'fuchs' Krombholz
// //
// $LastChangedDate: $ // $LastChangedDate$
// $LastChangedRevision: $ // $LastChangedRevision$
// $LastChangedBy: $ // $LastChangedBy$
// //
//This program is free software; you can redistribute it and/or modify //This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by //it under the terms of the GNU General Public License as published by
@ -84,6 +84,7 @@ public class serverObjects extends HashMap<String, String> implements Cloneable
* @return The value that was added to the map. * @return The value that was added to the map.
* @see java.util.Hashtable#put(K, V) * @see java.util.Hashtable#put(K, V)
*/ */
@Override
public String put(final String key, final String value) { public String put(final String key, final String value) {
if (key == null) { if (key == null) {
// this does nothing // this does nothing
@ -287,8 +288,7 @@ public class serverObjects extends HashMap<String, String> implements Cloneable
public boolean hasValue(final String key) { public boolean hasValue(final String key) {
final String s = super.get(key); final String s = super.get(key);
if (s == null) return false; if (s == null || s.length() < 1) return false;
if (s == "") return false;
return true; return true;
} }
@ -347,6 +347,7 @@ public class serverObjects extends HashMap<String, String> implements Cloneable
this.localized = loc; this.localized = loc;
} }
@Override
public Object clone() { public Object clone() {
return super.clone(); return super.clone();
} }

@ -4,9 +4,9 @@
// //
// This is a part of YaCy, a peer-to-peer based web search engine // This is a part of YaCy, a peer-to-peer based web search engine
// //
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $ // $LastChangedDate$
// $LastChangedRevision: 1986 $ // $LastChangedRevision$
// $LastChangedBy: orbiter $ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //

Loading…
Cancel
Save