From 816cb6ce93dcaf41ae479643e222489794b14d2d Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 28 Sep 2012 09:00:40 +0200 Subject: [PATCH] another fix for the debian installer: the installer fails because some classes had unresolved dependencies. This fix removes the dependencies. --- source/net/yacy/cora/order/Base64Order.java | 3 +++ source/net/yacy/cora/order/Digest.java | 26 ++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/source/net/yacy/cora/order/Base64Order.java b/source/net/yacy/cora/order/Base64Order.java index a9d88351a..2a0d6dab8 100644 --- a/source/net/yacy/cora/order/Base64Order.java +++ b/source/net/yacy/cora/order/Base64Order.java @@ -25,6 +25,9 @@ import java.util.Comparator; import net.yacy.cora.document.UTF8; +//ATTENTION! THIS CLASS SHALL NOT IMPORT FROM OTHER PACKAGES THAN CORA AND JRE +//BECAUSE OTHERWISE THE DEBIAN INSTALLER FAILS! + public class Base64Order extends AbstractOrder implements ByteOrder, Comparator, Cloneable, Serializable { private static final long serialVersionUID=980647587445343851L; diff --git a/source/net/yacy/cora/order/Digest.java b/source/net/yacy/cora/order/Digest.java index 733e81eb7..fe40cf1f5 100644 --- a/source/net/yacy/cora/order/Digest.java +++ b/source/net/yacy/cora/order/Digest.java @@ -18,7 +18,6 @@ * If not, see . */ - package net.yacy.cora.order; import java.io.ByteArrayInputStream; @@ -39,24 +38,22 @@ import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.LinkedBlockingQueue; -import org.apache.log4j.Logger; - import net.yacy.cora.document.UTF8; import net.yacy.cora.storage.ARC; import net.yacy.cora.storage.ConcurrentARC; import net.yacy.cora.util.Memory; +// ATTENTION! THIS CLASS SHALL NOT IMPORT FROM OTHER PACKAGES THAN CORA AND JRE +// BECAUSE OTHERWISE THE DEBIAN INSTALLER FAILS! public class Digest { - private final static Logger log = Logger.getLogger(Digest.class); public static BlockingQueue digestPool = new LinkedBlockingDeque(); private static final int md5CacheSize = Math.max(1000, Math.min(1000000, (int) (Memory.available() / 50000L))); private static ARC md5Cache = null; static { try { - log.info("creating hash cache of size " + md5CacheSize); md5Cache = new ConcurrentARC(md5CacheSize, Math.max(8, 2 * Runtime.getRuntime().availableProcessors())); } catch (final OutOfMemoryError e) { md5Cache = new ConcurrentARC(1000, Math.max(2, Runtime.getRuntime().availableProcessors())); @@ -158,7 +155,7 @@ public class Digest { in = new FileInputStream(file); } catch (final java.io.FileNotFoundException e) { System.out.println("file not found:" + file.toString()); - log.warn(e); + e.printStackTrace(); return null; } @@ -179,7 +176,8 @@ public class Digest { md5consumer.consume(c); } } catch (final IOException e) { - log.fatal("file error with " + file.toString() + ": " + e.getMessage(), e); + System.out.println("file error with " + file.toString() + ": " + e.getMessage()); + e.printStackTrace(); md5consumer.consume(md5FilechunkConsumer.poison); throw e; } finally { @@ -192,10 +190,10 @@ public class Digest { try { return md5result.get().digest(); } catch (final InterruptedException e) { - log.warn(e); + e.printStackTrace(); throw new IOException(e); } catch (final ExecutionException e) { - log.warn(e); + e.printStackTrace(); throw new IOException(e); } } @@ -234,7 +232,7 @@ public class Digest { try { this.filed.put(c); } catch (final InterruptedException e) { - log.warn(e); + e.printStackTrace(); } } @@ -242,7 +240,7 @@ public class Digest { try { return this.empty.take(); } catch (final InterruptedException e) { - log.warn(e); + e.printStackTrace(); throw new IOException(e); } } @@ -258,7 +256,7 @@ public class Digest { this.empty.put(c); } } catch (final InterruptedException e) { - log.warn(e); + e.printStackTrace(); } return this.digest; } @@ -281,7 +279,7 @@ public class Digest { assert b.length != 0 : "file = " + file.toString(); return Base64Order.enhancedCoder.encode(b); } catch (final IOException e) { - log.warn(e); + e.printStackTrace(); return null; } } @@ -311,7 +309,7 @@ public class Digest { try { digest = MessageDigest.getInstance("MD5"); } catch (final NoSuchAlgorithmException e) { - log.warn(e); + e.printStackTrace(); return null; } final RandomAccessFile raf = new RandomAccessFile(file, "r");