From 77d2a3782c4372985a398897aa6fe350b048bb38 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 6 Jul 2009 15:21:43 +0000 Subject: [PATCH] removed strange debugging strings git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6177 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/blogBoard.java | 6 +-- source/de/anomic/data/blogBoardComments.java | 6 +-- source/de/anomic/data/messageBoard.java | 2 +- source/de/anomic/data/userDB.java | 2 +- source/de/anomic/data/wiki/wikiBoard.java | 10 ++--- source/de/anomic/kelondro/blob/Stack.java | 4 +- source/de/anomic/kelondro/blob/Stacks.java | 8 ++-- .../de/anomic/kelondro/index/HandleMap.java | 1 - .../de/anomic/kelondro/order/Base64Order.java | 25 +++-------- source/de/anomic/kelondro/order/Bitfield.java | 2 +- source/de/anomic/kelondro/order/Coding.java | 44 ------------------- .../metadataPrototype/URLMetadataRow.java | 2 +- .../anomic/plasma/parser/vcf/vcfParser.java | 2 +- .../de/anomic/plasma/plasmaSwitchboard.java | 2 +- source/de/anomic/tools/CryptoLib.java | 9 ++-- source/de/anomic/tools/crypt.java | 4 +- source/de/anomic/tools/cryptbig.java | 10 ++--- source/de/anomic/yacy/yacyRelease.java | 5 +-- source/de/anomic/yacy/yacySeed.java | 6 +-- 19 files changed, 44 insertions(+), 106 deletions(-) delete mode 100644 source/de/anomic/kelondro/order/Coding.java diff --git a/source/de/anomic/data/blogBoard.java b/source/de/anomic/data/blogBoard.java index 188b0236e..d785d16e1 100644 --- a/source/de/anomic/data/blogBoard.java +++ b/source/de/anomic/data/blogBoard.java @@ -377,7 +377,7 @@ public class blogBoard { public byte[] getSubject() { final String m = record.get("subject"); if (m == null) return new byte[0]; - final byte[] b = Base64Order.enhancedCoder.decode(m, "de.anomic.data.blogBoard.subject()"); + final byte[] b = Base64Order.enhancedCoder.decode(m); if (b == null) return "".getBytes(); return b; } @@ -420,7 +420,7 @@ public class blogBoard { public byte[] getAuthor() { final String author = record.get("author"); if (author == null) return new byte[0]; - final byte[] b = Base64Order.enhancedCoder.decode(author, "de.anomic.data.blogBoard.author()"); + final byte[] b = Base64Order.enhancedCoder.decode(author); if (b == null) return "".getBytes(); return b; } @@ -469,7 +469,7 @@ public class blogBoard { public byte[] getPage() { final String page = record.get("page"); if (page == null) return new byte[0]; - final byte[] page_as_byte = Base64Order.enhancedCoder.decode(page, "de.anomic.data.blogBoard.page()"); + final byte[] page_as_byte = Base64Order.enhancedCoder.decode(page); if (page_as_byte == null) return "".getBytes(); return page_as_byte; } diff --git a/source/de/anomic/data/blogBoardComments.java b/source/de/anomic/data/blogBoardComments.java index 30cf33491..4803b6e6f 100644 --- a/source/de/anomic/data/blogBoardComments.java +++ b/source/de/anomic/data/blogBoardComments.java @@ -256,7 +256,7 @@ public class blogBoardComments { public byte[] getSubject() { final String subject = record.get("subject"); if (subject == null) return new byte[0]; - final byte[] subject_bytes = Base64Order.enhancedCoder.decode(subject, "de.anomic.data.blogBoardComments.subject()"); + final byte[] subject_bytes = Base64Order.enhancedCoder.decode(subject); if (subject_bytes == null) return "".getBytes(); return subject_bytes; } @@ -298,7 +298,7 @@ public class blogBoardComments { final String author = record.get("author"); if (author == null) return new byte[0]; - final byte[] author_byte = Base64Order.enhancedCoder.decode(author, "de.anomic.data.blogBoardComments.author()"); + final byte[] author_byte = Base64Order.enhancedCoder.decode(author); if (author_byte == null) return "".getBytes(); return author_byte; @@ -324,7 +324,7 @@ public class blogBoardComments { final String page = record.get("page"); if (page == null) return new byte[0]; - final byte[] page_byte = Base64Order.enhancedCoder.decode(page, "de.anomic.data.blogBoardComments.page()"); + final byte[] page_byte = Base64Order.enhancedCoder.decode(page); if (page_byte == null) return "".getBytes(); return page_byte; diff --git a/source/de/anomic/data/messageBoard.java b/source/de/anomic/data/messageBoard.java index a4ffa5e17..1ebae0eb7 100644 --- a/source/de/anomic/data/messageBoard.java +++ b/source/de/anomic/data/messageBoard.java @@ -176,7 +176,7 @@ public class messageBoard { final String m = record.get("message"); if (m == null) return new byte[0]; record.put("read", "true"); - return Base64Order.enhancedCoder.decode(m, "de.anomic.data.messageBoard.message()"); + return Base64Order.enhancedCoder.decode(m); } public boolean read() { diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java index 52c18c982..504847a38 100644 --- a/source/de/anomic/data/userDB.java +++ b/source/de/anomic/data/userDB.java @@ -127,7 +127,7 @@ public final class userDB { auth=auth.trim().substring(6); try{ - auth=Base64Order.standardCoder.decodeString(auth, "de.anomic.data.userDB.proxyAuth()"); + auth=Base64Order.standardCoder.decodeString(auth); }catch(final RuntimeException e){} //no valid Base64 final String[] tmp=auth.split(":"); if(tmp.length == 2){ diff --git a/source/de/anomic/data/wiki/wikiBoard.java b/source/de/anomic/data/wiki/wikiBoard.java index 16ece63fa..563c6ea2f 100644 --- a/source/de/anomic/data/wiki/wikiBoard.java +++ b/source/de/anomic/data/wiki/wikiBoard.java @@ -166,7 +166,7 @@ public class wikiBoard { public String author() { final String a = record.get("author"); if (a == null) return "anonymous"; - final byte[] b = Base64Order.enhancedCoder.decode(a, "de.anomic.data.wikiBoard.author()"); + final byte[] b = Base64Order.enhancedCoder.decode(a); if (b == null) return "anonymous"; return new String(b); } @@ -174,7 +174,7 @@ public class wikiBoard { public String reason() { final String r = record.get("reason"); if (r == null) return ""; - final byte[] b = Base64Order.enhancedCoder.decode(r, "de.anomic.data.wikiBoard.reason()"); + final byte[] b = Base64Order.enhancedCoder.decode(r); if (b == null) return "unknown"; return new String(b); } @@ -182,7 +182,7 @@ public class wikiBoard { public byte[] page() { final String m = record.get("page"); if (m == null) return new byte[0]; - final byte[] b = Base64Order.enhancedCoder.decode(m, "de.anomic.data.wikiBoard.page()"); + final byte[] b = Base64Order.enhancedCoder.decode(m); if (b == null) return "".getBytes(); return b; } @@ -228,7 +228,7 @@ public class wikiBoard { private String getChildName() { final String c = record.get("child"); if (c == null) return null; - final byte[] subject = Base64Order.enhancedCoder.decode(c, "de.anomic.data.wikiBoard.getChildName()"); + final byte[] subject = Base64Order.enhancedCoder.decode(c); if (subject == null) return null; return new String(subject); } @@ -236,7 +236,7 @@ public class wikiBoard { public boolean hasChild() { final String c = record.get("child"); if (c == null) return false; - final byte[] subject = Base64Order.enhancedCoder.decode(c, "de.anomic.data.wikiBoard.hasChild()"); + final byte[] subject = Base64Order.enhancedCoder.decode(c); return (subject != null); } diff --git a/source/de/anomic/kelondro/blob/Stack.java b/source/de/anomic/kelondro/blob/Stack.java index fe371f2ce..8162df651 100644 --- a/source/de/anomic/kelondro/blob/Stack.java +++ b/source/de/anomic/kelondro/blob/Stack.java @@ -186,8 +186,8 @@ public class Stack { public class Entry { - private long h; - private byte[] b; + long h; + byte[] b; /** * create a new entry object using a long handle diff --git a/source/de/anomic/kelondro/blob/Stacks.java b/source/de/anomic/kelondro/blob/Stacks.java index 291758f55..701cf8cfc 100644 --- a/source/de/anomic/kelondro/blob/Stacks.java +++ b/source/de/anomic/kelondro/blob/Stacks.java @@ -31,8 +31,8 @@ import java.util.concurrent.ConcurrentHashMap; public class Stacks { - private File stacksLocation; - private String stacksPrefix; + File stacksLocation; + String stacksPrefix; private ConcurrentHashMap stacks; /** @@ -65,9 +65,9 @@ public class Stacks { } private class StackInstance { - private String name; + String name; private File location; - private Stack stack; + Stack stack; public StackInstance(File location) throws IOException { String filename = location.getName(); diff --git a/source/de/anomic/kelondro/index/HandleMap.java b/source/de/anomic/kelondro/index/HandleMap.java index c5f9005cb..af24ce1bf 100644 --- a/source/de/anomic/kelondro/index/HandleMap.java +++ b/source/de/anomic/kelondro/index/HandleMap.java @@ -36,7 +36,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Random; import java.util.TreeMap; -import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; diff --git a/source/de/anomic/kelondro/order/Base64Order.java b/source/de/anomic/kelondro/order/Base64Order.java index 4c2751e6b..f1fc66b6a 100644 --- a/source/de/anomic/kelondro/order/Base64Order.java +++ b/source/de/anomic/kelondro/order/Base64Order.java @@ -32,7 +32,7 @@ import java.util.Comparator; import de.anomic.yacy.logging.Log; -public class Base64Order extends AbstractOrder implements ByteOrder, Coding, Comparator, Cloneable { +public class Base64Order extends AbstractOrder implements ByteOrder, Comparator, Cloneable { protected static final char[] alpha_standard = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); protected static final char[] alpha_enhanced = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".toCharArray(); @@ -252,17 +252,17 @@ public class Base64Order extends AbstractOrder implements ByteOrder, Cod return out; } - public final String decodeString(final String in, final String info) { + public final String decodeString(final String in) { try { //return new String(decode(in), "ISO-8859-1"); - return new String(decode(in, info), "UTF-8"); + return new String(decode(in), "UTF-8"); } catch (final java.io.UnsupportedEncodingException e) { System.out.println("internal error in base64: " + e.getMessage()); return null; } } - public final byte[] decode(String in, final String info) { + public final byte[] decode(String in) { if ((in == null) || (in.length() == 0)) return new byte[0]; try { int posIn = 0; @@ -300,24 +300,11 @@ public class Base64Order extends AbstractOrder implements ByteOrder, Cod } catch (final ArrayIndexOutOfBoundsException e) { // maybe the input was not base64 // throw new RuntimeException("input probably not base64"); - if (this.log.isFine()) this.log.logFine("wrong string receive: " + in + ", call: " + info); + if (this.log.isFine()) this.log.logFine("wrong string receive: " + in); return new byte[0]; } } - - /* - private final long cardinalI(final byte[] key) { - // returns a cardinal number in the range of 0 .. Long.MAX_VALUE - long c = 0; - int p = 0; - while ((p < 10) && (p < key.length)) c = (c << 6) | ahpla[key[p++]]; - while (p++ < 10) c = (c << 6); - c = c << 3; - assert c >= 0; - return c; - } - */ private final long cardinalI(final String key) { // returns a cardinal number in the range of 0 .. Long.MAX_VALUE long c = 0; @@ -578,7 +565,7 @@ public class Base64Order extends AbstractOrder implements ByteOrder, Cod } if (s[0].equals("-ds")) { // generate a b64 decoding from a given string - System.out.println(b64.decodeString(s[1], "")); + System.out.println(b64.decodeString(s[1])); } if (s[0].equals("-cl")) { // return the cardinal of a given string as long value with the enhanced encoder diff --git a/source/de/anomic/kelondro/order/Bitfield.java b/source/de/anomic/kelondro/order/Bitfield.java index d883a6640..668da29a9 100644 --- a/source/de/anomic/kelondro/order/Bitfield.java +++ b/source/de/anomic/kelondro/order/Bitfield.java @@ -46,7 +46,7 @@ public class Bitfield implements Cloneable { public Bitfield(final int bytelength, final String exported) { // imports a b64-encoded bitfield - final byte[] b = Base64Order.enhancedCoder.decode(exported, "de.anomic.kelondro.kelondroBitfield.kelondroBitfield(...)"); + final byte[] b = Base64Order.enhancedCoder.decode(exported); if (b.length == bytelength) { bb = b; } else { diff --git a/source/de/anomic/kelondro/order/Coding.java b/source/de/anomic/kelondro/order/Coding.java deleted file mode 100644 index 7f3a223b2..000000000 --- a/source/de/anomic/kelondro/order/Coding.java +++ /dev/null @@ -1,44 +0,0 @@ -// kelondroCoder.java -// ----------------------- -// part of The Kelondro Database -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2005 -// created 04.01.2006 -// -// $LastChangedDate: 2005-09-22 22:01:26 +0200 (Thu, 22 Sep 2005) $ -// $LastChangedRevision: 774 $ -// $LastChangedBy: orbiter $ -// -// 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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -package de.anomic.kelondro.order; - -public interface Coding { - - public char encodeByte(byte b); - public byte decodeByte(char b); - - public String encodeLongSmart(long c, int length); - public String encodeLong(long c, int length); - public long decodeLong(String s); - - public String encodeString(String in); - public String decodeString(String in, String info); - - public String encode(byte[] in); - public byte[] decode(String in, String info); - -} diff --git a/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java b/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java index 6ed485c74..21c1f24f7 100644 --- a/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java +++ b/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java @@ -270,7 +270,7 @@ public class URLMetadataRow implements Metadata { this.word = null; if (prop.containsKey("word")) throw new kelondroException("old database structure is not supported"); if (prop.containsKey("wi")) { - this.word = new WordReferenceRow(Base64Order.enhancedCoder.decodeString(prop.getProperty("wi", ""), "de.anomic.index.indexURLEntry.indexURLEntry()")); + this.word = new WordReferenceRow(Base64Order.enhancedCoder.decodeString(prop.getProperty("wi", ""))); } this.ranking = 0; this.comp = null; diff --git a/source/de/anomic/plasma/parser/vcf/vcfParser.java b/source/de/anomic/plasma/parser/vcf/vcfParser.java index 7106034c3..faa42dde0 100644 --- a/source/de/anomic/plasma/parser/vcf/vcfParser.java +++ b/source/de/anomic/plasma/parser/vcf/vcfParser.java @@ -151,7 +151,7 @@ public class vcfParser extends AbstractParser implements Parser { if (!useLastLine) value += line.trim(); else break; } while (line.length()!=0); - value = Base64Order.standardCoder.decodeString(value, "de.anomic.plasma.parser.vcf.vcfParser.parse(...)"); + value = Base64Order.standardCoder.decodeString(value); } } catch (final Exception ey) { // Encoding error: This could occure e.g. if the base64 doesn't diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index f78d41735..23ad0af72 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -753,7 +753,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch