diff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.java index d70d5e453..97f98e303 100644 --- a/htroot/AccessTracker_p.java +++ b/htroot/AccessTracker_p.java @@ -86,7 +86,7 @@ public class AccessTracker_p { prop.put("page_num", entCount); } if (page == 1) { - String host = post.get("host", ""); + String host = (post == null) ? "" : post.get("host", ""); int entCount = 0; TreeMap access; Map.Entry entry; diff --git a/htroot/osm.java b/htroot/osm.java index 43364162c..8e8b3b60a 100644 --- a/htroot/osm.java +++ b/htroot/osm.java @@ -1,4 +1,4 @@ -import java.io.IOException; + import de.anomic.http.httpHeader; import de.anomic.server.serverObjects; @@ -8,7 +8,7 @@ import de.anomic.ymage.ymageOSM; public class osm { - public static ymageMatrix respond(httpHeader header, serverObjects post, serverSwitch env) throws IOException { + public static ymageMatrix respond(httpHeader header, serverObjects post, serverSwitch env) { int zoom = 10; double lat = 47.968056d; diff --git a/htroot/xml/bookmarks/xbel/xbel.class b/htroot/xml/bookmarks/xbel/xbel.class new file mode 100755 index 000000000..69ad20b03 Binary files /dev/null and b/htroot/xml/bookmarks/xbel/xbel.class differ diff --git a/source/de/anomic/data/blogBoard.java b/source/de/anomic/data/blogBoard.java index a1d05eab5..a2121d56c 100644 --- a/source/de/anomic/data/blogBoard.java +++ b/source/de/anomic/data/blogBoard.java @@ -340,7 +340,7 @@ public class blogBoard { wikiBoard.setAuthor(ip, new String(author)); } - private BlogEntry(String key, HashMap record) { + BlogEntry(String key, HashMap record) { this.key = key; this.record = record; if (this.record.get("comments")==null) this.record.put("comments", listManager.collection2string(new ArrayList())); diff --git a/source/de/anomic/data/blogBoardComments.java b/source/de/anomic/data/blogBoardComments.java index 38cd9bf06..180d6ce79 100644 --- a/source/de/anomic/data/blogBoardComments.java +++ b/source/de/anomic/data/blogBoardComments.java @@ -76,7 +76,7 @@ public class blogBoardComments { private static final String dateFormat = "yyyyMMddHHmmss"; private static final int recordSize = 512; - private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); + static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); static { SimpleFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -94,7 +94,7 @@ public class blogBoardComments { public void close() { database.close(); } - private static String dateString(Date date) { + static String dateString(Date date) { synchronized (SimpleFormatter) { return SimpleFormatter.format(date); } @@ -240,7 +240,7 @@ public class blogBoardComments { wikiBoard.setAuthor(ip, new String(author)); } - private CommentEntry(String key, HashMap record) { + CommentEntry(String key, HashMap record) { this.key = key; this.record = record; if (this.record.get("comments")==null) this.record.put("comments", listManager.collection2string(new ArrayList())); diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index 6bb55588e..0ab8a8dd3 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -951,7 +951,7 @@ public class bookmarksDB { this((new yacyURL((String)map.map().get(BOOKMARK_URL), null)).hash(), map.map()); } - private Map toMap() { + Map toMap() { entry.put(BOOKMARK_TAGS, listManager.collection2string(tags)); entry.put(BOOKMARK_TIMESTAMP, String.valueOf(this.timestamp)); return entry; diff --git a/source/de/anomic/data/diff.java b/source/de/anomic/data/diff.java index 8bcc09d78..b4688d9b0 100644 --- a/source/de/anomic/data/diff.java +++ b/source/de/anomic/data/diff.java @@ -55,8 +55,8 @@ import java.util.ArrayList; public class diff { private final ArrayList parts = new ArrayList(); - private final Object[] o; - private final Object[] n; + final Object[] o; + final Object[] n; /** * @param o the original String @@ -217,7 +217,7 @@ public class diff { private final int posOld; private final int posNew; - private Part(int action, int posOld, int posNew) { + Part(int action, int posOld, int posNew) { this.action = action; this.posOld = posOld; this.posNew = posNew; diff --git a/source/de/anomic/data/messageBoard.java b/source/de/anomic/data/messageBoard.java index 8a901a21b..da9ad1dc6 100644 --- a/source/de/anomic/data/messageBoard.java +++ b/source/de/anomic/data/messageBoard.java @@ -60,13 +60,13 @@ public class messageBoard { private static final String dateFormat = "yyyyMMddHHmmss"; private static final int recordSize = 512; - private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); + static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); static { SimpleFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); } - private kelondroMapObjects database = null; + kelondroMapObjects database = null; private int sn = 0; public messageBoard(File path) { @@ -85,13 +85,13 @@ public class messageBoard { database.close(); } - private static String dateString() { + static String dateString() { synchronized (SimpleFormatter) { return SimpleFormatter.format(new Date()); } } - private String snString() { + String snString() { String s = Integer.toString(sn); if (s.length() == 1) s = "0" + s; sn++; @@ -137,7 +137,7 @@ public class messageBoard { record.put("read", "false"); } - private entry(String key, HashMap record) { + entry(String key, HashMap record) { this.key = key; this.record = record; } diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java index 0e58f7fc0..b3e88bf09 100644 --- a/source/de/anomic/data/userDB.java +++ b/source/de/anomic/data/userDB.java @@ -70,8 +70,8 @@ public final class userDB { kelondroMapObjects userTable; private final File userTableFile; - private HashMap ipUsers = new HashMap(); - private HashMap cookieUsers = new HashMap(); + HashMap ipUsers = new HashMap(); + HashMap cookieUsers = new HashMap(); public userDB(File userTableFile) { this.userTableFile = userTableFile; @@ -325,8 +325,8 @@ public final class userDB { public static final int PROXY_TIMELIMIT_REACHED = 3; // this is a simple record structure that hold all properties of a user - private HashMap mem; - private String userName; + HashMap mem; + String userName; private Calendar oldDate, newDate; public Entry(String userName, HashMap mem) throws IllegalArgumentException { diff --git a/source/de/anomic/data/wiki/knwikiParser.java b/source/de/anomic/data/wiki/knwikiParser.java index b2674b4b1..79fdb1cd0 100644 --- a/source/de/anomic/data/wiki/knwikiParser.java +++ b/source/de/anomic/data/wiki/knwikiParser.java @@ -259,7 +259,7 @@ public class knwikiParser implements wikiParser { public boolean isEscaped() { return this.escaped; } public boolean isNewLineBefore() { return this.nl; } - private static Text[] split2Texts(String text, String escapeBegin, String escapeEnd) { + static Text[] split2Texts(String text, String escapeBegin, String escapeEnd) { if (text == null) return null; if (text.length() < 2) return new Text[] { new Text(text, false, true) }; @@ -286,7 +286,7 @@ public class knwikiParser implements wikiParser { from < escapeEnd.length() + 2 || (!escaped && text.charAt(from - escapeEnd.length() - 1) == '\n')); } - private static String mergeTexts(Text[] texts) { + static String mergeTexts(Text[] texts) { StringBuffer sb = new StringBuffer(); for (int n=0; n < texts.length; n++) sb.append(texts[n].getTextPlain()); diff --git a/source/de/anomic/data/wikiBoard.java b/source/de/anomic/data/wikiBoard.java index 8cb1ce626..4889c93d3 100644 --- a/source/de/anomic/data/wikiBoard.java +++ b/source/de/anomic/data/wikiBoard.java @@ -60,15 +60,15 @@ public class wikiBoard { private static final String dateFormat = "yyyyMMddHHmmss"; private static final int recordSize = 512; - private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); + static SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat); static { SimpleFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); } - private kelondroMapObjects datbase = null; - private kelondroMapObjects bkpbase = null; - private static HashMap authors = new HashMap(); + kelondroMapObjects datbase = null; + kelondroMapObjects bkpbase = null; + static HashMap authors = new HashMap(); public wikiBoard(File actpath, File bkppath) { new File(actpath.getParent()).mkdirs(); @@ -94,7 +94,7 @@ public class wikiBoard { bkpbase.close(); } - private static String dateString() { + static String dateString() { return dateString(new Date()); } @@ -156,7 +156,7 @@ public class wikiBoard { //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString()); } - private entry(String key, HashMap record) { + entry(String key, HashMap record) { this.key = key; this.record = record; } @@ -204,7 +204,7 @@ public class wikiBoard { return b; } - private void setAncestorDate(Date date) { + void setAncestorDate(Date date) { record.put("bkp", dateString(date)); } @@ -238,7 +238,7 @@ public class wikiBoard { return read(key + dateString(ancDate), bkpbase); } - private void setChild(String subject) { + void setChild(String subject) { record.put("child", kelondroBase64Order.enhancedCoder.encode(subject.getBytes())); } @@ -290,7 +290,7 @@ public class wikiBoard { return read(key, datbase); } - private entry read(String key, kelondroMapObjects base) { + entry read(String key, kelondroMapObjects base) { try { key = normalize(key); if (key.length() > keyLength) key = key.substring(0, keyLength); diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java index 3659e7941..879edbd69 100644 --- a/source/de/anomic/http/httpc.java +++ b/source/de/anomic/http/httpc.java @@ -108,7 +108,7 @@ public final class httpc { private static final String vDATE = "20040602"; private static final int terminalMaxLength = 30000; private static final SimpleDateFormat HTTPGMTFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); - private static final HashMap reverseMappingCache = new HashMap(); + static final HashMap reverseMappingCache = new HashMap(); private static final HashSet activeConnections = new HashSet(); // all connections are stored here and deleted when they are finished private static final long minimumTime_before_activeConnections_cleanup = 3600000; // 1 Hour private static final long minimumTime_before_idleConnections_cleanup = 120000; // 2 Minutes @@ -189,7 +189,7 @@ public final class httpc { private String target_virtual_host = null; // output and input streams for client control connection - private PushbackInputStream clientInput = null; + PushbackInputStream clientInput = null; private OutputStream clientOutput = null; private httpdByteCountInputStream clientInputByteCount = null; @@ -198,7 +198,7 @@ public final class httpc { private boolean remoteProxyUse = false; private httpRemoteProxyConfig remoteProxyConfig = null; - private String requestPath = null; + String requestPath = null; private boolean allowContentEncoding = true; public boolean ssl; @@ -1443,7 +1443,7 @@ public final class httpc { } catch (IOException e) { e.printStackTrace(); } - if (file.length() == 0) file.delete(); + if ((file != null) && (file.length() == 0)) file.delete(); } } diff --git a/source/de/anomic/index/indexRWIEntryOrder.java b/source/de/anomic/index/indexRWIEntryOrder.java index 5d3f60fd8..9cdfaaac7 100644 --- a/source/de/anomic/index/indexRWIEntryOrder.java +++ b/source/de/anomic/index/indexRWIEntryOrder.java @@ -153,7 +153,8 @@ public class indexRWIEntryOrder { public static class minmaxfinder extends Thread { - private indexRWIVarEntry entryMin, entryMax; + indexRWIVarEntry entryMin; + indexRWIVarEntry entryMax; private indexContainer container; private int start, end; private HashMap doms; diff --git a/source/de/anomic/kelondro/kelondroAbstractRecords.java b/source/de/anomic/kelondro/kelondroAbstractRecords.java index 45a0e6a00..956fc8ae4 100644 --- a/source/de/anomic/kelondro/kelondroAbstractRecords.java +++ b/source/de/anomic/kelondro/kelondroAbstractRecords.java @@ -53,9 +53,9 @@ public abstract class kelondroAbstractRecords implements kelondroRecords { private static long POS_COLUMNS = POS_DESCR + LEN_DESCR; // 2 bytes, short: number of columns in one entry private static long POS_OHBYTEC = POS_COLUMNS + 2; // 2 bytes, number of extra bytes on each Node private static long POS_OHHANDLEC = POS_OHBYTEC + 2; // 2 bytes, number of Handles on each Node - private static long POS_USEDC = POS_OHHANDLEC + 2; // 4 bytes, int: used counter - private static long POS_FREEC = POS_USEDC + 4; // 4 bytes, int: free counter - private static long POS_FREEH = POS_FREEC + 4; // 4 bytes, int: free pointer (to free chain start) + static long POS_USEDC = POS_OHHANDLEC + 2; // 4 bytes, int: used counter + static long POS_FREEC = POS_USEDC + 4; // 4 bytes, int: free counter + static long POS_FREEH = POS_FREEC + 4; // 4 bytes, int: free pointer (to free chain start) private static long POS_MD5PW = POS_FREEH + 4; // 16 bytes, string (encrypted password to this file) private static long POS_ENCRYPTION = POS_MD5PW + 16; // 16 bytes, string (method description) private static long POS_OFFSET = POS_ENCRYPTION + 16; // 8 bytes, long (seek position of first record) @@ -75,7 +75,7 @@ public abstract class kelondroAbstractRecords implements kelondroRecords { protected int headchunksize;// overheadsize + key element column size protected int tailchunksize;// sum(all: COLWIDTHS) minus the size of the key element colum protected int recordsize; // (overhead + sum(all: COLWIDTHS)) = the overall size of a record - private byte[] spaceChunk; // a chunk of data that is used to reserve space within the file + byte[] spaceChunk; // a chunk of data that is used to reserve space within the file // dynamic run-time seek pointers private long POS_HANDLES = 0; // starts after end of POS_COLWIDHS which is POS_COLWIDTHS + COLWIDTHS.length * 4 @@ -137,7 +137,7 @@ public abstract class kelondroAbstractRecords implements kelondroRecords { } } - private synchronized void writeused(boolean finalwrite) throws IOException { + synchronized void writeused(boolean finalwrite) throws IOException { // we write only at close time, not in between. othervise, the read/write head // needs to run up and own all the way between the beginning and the end of the // file for each record. We check consistency beteen file size and @@ -176,7 +176,7 @@ public abstract class kelondroAbstractRecords implements kelondroRecords { return this.USEDC + this.FREEC; } - private synchronized int used() { + synchronized int used() { checkConsistency(); return this.USEDC; } diff --git a/source/de/anomic/kelondro/kelondroAttrSeq.java b/source/de/anomic/kelondro/kelondroAttrSeq.java index 0191edbcb..5129aeb79 100644 --- a/source/de/anomic/kelondro/kelondroAttrSeq.java +++ b/source/de/anomic/kelondro/kelondroAttrSeq.java @@ -286,7 +286,6 @@ public class kelondroAttrSeq { StringTokenizer st = new StringTokenizer(attr, ","); while (st.hasMoreTokens()) { a = new kelondroColumn(st.nextToken()); - if (a == null) break; l.add(a); } prop_names = new String[l.size()]; @@ -307,7 +306,6 @@ public class kelondroAttrSeq { st = new StringTokenizer(seqs, ","); while (st.hasMoreTokens()) { a = new kelondroColumn(st.nextToken()); - if (a == null) break; l.add(a); } seq_names = new String[l.size()]; diff --git a/source/de/anomic/kelondro/kelondroBufferedEcoFS.java b/source/de/anomic/kelondro/kelondroBufferedEcoFS.java index d87549080..72a37ff5e 100644 --- a/source/de/anomic/kelondro/kelondroBufferedEcoFS.java +++ b/source/de/anomic/kelondro/kelondroBufferedEcoFS.java @@ -42,7 +42,7 @@ public class kelondroBufferedEcoFS { * That means, each time, an entry is written to the end of the file, it is not buffered */ - public kelondroBufferedEcoFS(kelondroEcoFS efs, int maxEntries) throws IOException { + public kelondroBufferedEcoFS(kelondroEcoFS efs, int maxEntries) { this.efs = efs; this.maxEntries = maxEntries; this.buffer = new TreeMap(); diff --git a/source/de/anomic/kelondro/kelondroCache.java b/source/de/anomic/kelondro/kelondroCache.java index 540144d59..955ef8cf4 100644 --- a/source/de/anomic/kelondro/kelondroCache.java +++ b/source/de/anomic/kelondro/kelondroCache.java @@ -165,7 +165,7 @@ public class kelondroCache implements kelondroIndex { return true; } - private boolean checkHitSpace() throws IOException { + private boolean checkHitSpace() { // returns true if it is allowed to write into this cache int status = cacheGrowStatus(); if (status < 1) { diff --git a/source/de/anomic/kelondro/kelondroCachedRecords.java b/source/de/anomic/kelondro/kelondroCachedRecords.java index 92be672cb..e3bf2bec7 100644 --- a/source/de/anomic/kelondro/kelondroCachedRecords.java +++ b/source/de/anomic/kelondro/kelondroCachedRecords.java @@ -46,8 +46,18 @@ public class kelondroCachedRecords extends kelondroAbstractRecords implements ke private static long memStartShrink = 6000000; // a limit for the node cache to start with shrinking if less than this memory amount is available // caching buffer - private kelondroIntBytesMap cacheHeaders; // the cache; holds overhead values and key element - private int readHit, readMiss, writeUnique, writeDouble, cacheDelete, cacheFlush; + kelondroIntBytesMap cacheHeaders; // the cache; holds overhead values and key element + int readHit; + + int readMiss; + + int writeUnique; + + int writeDouble; + + int cacheDelete; + + int cacheFlush; public kelondroCachedRecords( @@ -110,7 +120,7 @@ public class kelondroCachedRecords extends kelondroAbstractRecords implements ke } } - private int cacheGrowStatus() { + int cacheGrowStatus() { long available = serverMemory.available(); if ((cacheHeaders != null) && (available < cacheHeaders.memoryNeededForGrow())) return 0; return cacheGrowStatus(available, memStopGrow, memStartShrink); @@ -300,7 +310,7 @@ public class kelondroCachedRecords extends kelondroAbstractRecords implements ke //private Handle[] ohHandle= null; // the overhead handles, OHHANDLEC values //private byte[][] values = null; // an array of byte[] nodes is the value vector private kelondroHandle handle = null; // index of the entry, by default NUL means undefined - private byte[] headChunk = null; // contains ohBytes, ohHandles and the key value + byte[] headChunk = null; // contains ohBytes, ohHandles and the key value private byte[] tailChunk = null; // contains all values except the key value private boolean headChanged = false; private boolean tailChanged = false; diff --git a/source/de/anomic/kelondro/kelondroCollectionIndex.java b/source/de/anomic/kelondro/kelondroCollectionIndex.java index 9a11c83cb..ded5711f7 100644 --- a/source/de/anomic/kelondro/kelondroCollectionIndex.java +++ b/source/de/anomic/kelondro/kelondroCollectionIndex.java @@ -57,7 +57,7 @@ public class kelondroCollectionIndex { private static final long minimumRAM4Eco = 20 * 1024 * 1024; private static final int EcoFSBufferSize = 1000; - private kelondroIndex index; + kelondroIndex index; private int keylength; private File path; private String filenameStub; @@ -354,7 +354,7 @@ public class kelondroCollectionIndex { // this is computed by the size of the biggest used collection // this must be multiplied with the payload size // and doubled for necessary memory transformation during sort operation - return (int) (arrayCapacity(arrays.size() - 1) * this.payloadrow.objectsize * kelondroRowSet.growfactor); + return (int) (arrayCapacity(arrays.size() - 1) * this.payloadrow.objectsize * kelondroRowCollection.growfactor); } private void array_remove( diff --git a/source/de/anomic/kelondro/kelondroDyn.java b/source/de/anomic/kelondro/kelondroDyn.java index ec67f0b29..fd863ef0b 100644 --- a/source/de/anomic/kelondro/kelondroDyn.java +++ b/source/de/anomic/kelondro/kelondroDyn.java @@ -119,7 +119,7 @@ public class kelondroDyn { file.delete(); } else { if (file.isDirectory()) { - kelondroFlexTable.delete(file.getParentFile(), file.getName()); + kelondroFlexWidthArray.delete(file.getParentFile(), file.getName()); } else { file.delete(); } diff --git a/source/de/anomic/kelondro/kelondroEcoTable.java b/source/de/anomic/kelondro/kelondroEcoTable.java index 15a06b0e9..0e091a344 100644 --- a/source/de/anomic/kelondro/kelondroEcoTable.java +++ b/source/de/anomic/kelondro/kelondroEcoTable.java @@ -61,10 +61,12 @@ public class kelondroEcoTable implements kelondroIndex { public static final long maxarraylength = 134217727L; // that may be the maxmimum size of array length in some JVMs - private kelondroRowSet table; - private kelondroBytesIntMap index; - private kelondroBufferedEcoFS file; - private kelondroRow rowdef, taildef; + kelondroRowSet table; + kelondroBytesIntMap index; + kelondroBufferedEcoFS file; + kelondroRow rowdef; + + kelondroRow taildef; private int buffersize; public kelondroEcoTable(File tablefile, kelondroRow rowdef, int useTailCache, int buffersize, int initialSpace) { @@ -88,7 +90,7 @@ public class kelondroEcoTable implements kelondroIndex { // should not happen e.printStackTrace(); } - try { fos.close(); } catch (IOException e) {} + if (fos != null) try { fos.close(); } catch (IOException e) {} } try { @@ -220,7 +222,7 @@ public class kelondroEcoTable implements kelondroIndex { } public static int staticRAMIndexNeed(File f, kelondroRow rowdef) { - return (int) ((rowdef.primaryKeyLength + 4) * tableSize(f, rowdef.objectsize) * kelondroRowSet.growfactor); + return (int) ((rowdef.primaryKeyLength + 4) * tableSize(f, rowdef.objectsize) * kelondroRowCollection.growfactor); } public synchronized void addUnique(Entry row) throws IOException { @@ -492,7 +494,7 @@ public class kelondroEcoTable implements kelondroIndex { // should not happen e.printStackTrace(); } - try { fos.close(); } catch (IOException e) {} + if (fos != null) try { fos.close(); } catch (IOException e) {} // open an existing table file diff --git a/source/de/anomic/kelondro/kelondroFlexTable.java b/source/de/anomic/kelondro/kelondroFlexTable.java index feedbe49b..4dd4db5e7 100644 --- a/source/de/anomic/kelondro/kelondroFlexTable.java +++ b/source/de/anomic/kelondro/kelondroFlexTable.java @@ -140,7 +140,7 @@ public class kelondroFlexTable extends kelondroFlexWidthArray implements kelondr } public static int staticRAMIndexNeed(File path, String tablename, kelondroRow rowdef) { - return (int) ((rowdef.column(0).cellwidth + 4) * staticSize(path, tablename) * kelondroRowSet.growfactor); + return (int) ((rowdef.column(0).cellwidth + 4) * staticSize(path, tablename) * kelondroRowCollection.growfactor); } public boolean hasRAMIndex() { @@ -385,26 +385,24 @@ public class kelondroFlexTable extends kelondroFlexWidthArray implements kelondr } public synchronized kelondroCloneableIterator rows(boolean up, byte[] firstKey) throws IOException { - if (index == null) return new rowIterator(index, up, firstKey); + if (index == null) return new rowIterator(up, firstKey); assert this.size() == index.size() : "content.size() = " + this.size() + ", index.size() = " + index.size(); - return new rowIterator(index, up, firstKey); + return new rowIterator(up, firstKey); } public class rowIterator implements kelondroCloneableIterator { kelondroCloneableIterator indexIterator; - kelondroBytesIntMap index; boolean up; - public rowIterator(kelondroBytesIntMap index, boolean up, byte[] firstKey) throws IOException { - this.index = index; + public rowIterator(boolean up, byte[] firstKey) throws IOException { this.up = up; indexIterator = index.rows(up, firstKey); } public rowIterator clone(Object modifier) { try { - return new rowIterator(index, up, (byte[]) modifier); + return new rowIterator(up, (byte[]) modifier); } catch (IOException e) { return null; } diff --git a/source/de/anomic/kelondro/kelondroFlexWidthArray.java b/source/de/anomic/kelondro/kelondroFlexWidthArray.java index d2fe74b3c..232713ee9 100644 --- a/source/de/anomic/kelondro/kelondroFlexWidthArray.java +++ b/source/de/anomic/kelondro/kelondroFlexWidthArray.java @@ -162,7 +162,7 @@ public class kelondroFlexWidthArray implements kelondroArray { // open existing files File file = new File(tabledir, "col.000.list"); - return kelondroCachedRecords.staticsize(file); + return kelondroAbstractRecords.staticsize(file); } public static void delete(File path, String tablename) { diff --git a/source/de/anomic/kelondro/kelondroMHashMap.java b/source/de/anomic/kelondro/kelondroMHashMap.java index d2363e713..225d89168 100644 --- a/source/de/anomic/kelondro/kelondroMHashMap.java +++ b/source/de/anomic/kelondro/kelondroMHashMap.java @@ -45,8 +45,10 @@ import java.util.Iterator; public class kelondroMHashMap { - private int keylen, valuelen, reclen, count; - private byte[] mem; + int keylen; + int valuelen; + int reclen, count; + byte[] mem; private byte[] emptykey; public kelondroMHashMap(int valuelen) { diff --git a/source/de/anomic/kelondro/kelondroRowCollection.java b/source/de/anomic/kelondro/kelondroRowCollection.java index 8e31dc391..5433cb9af 100644 --- a/source/de/anomic/kelondro/kelondroRowCollection.java +++ b/source/de/anomic/kelondro/kelondroRowCollection.java @@ -43,7 +43,7 @@ public class kelondroRowCollection { public static final double growfactor = 1.4; private static final int isortlimit = 20; - private static final Integer dummy = new Integer(0); + static final Integer dummy = new Integer(0); public static final qsortthread sortingthread; static { @@ -538,7 +538,7 @@ public class kelondroRowCollection { } } - private final void qsort(int L, int R, int S, byte[] swapspace) { + final void qsort(int L, int R, int S, byte[] swapspace) { if (R - L < isortlimit) { isort(L, R, swapspace); return; diff --git a/source/de/anomic/kelondro/kelondroSplitTable.java b/source/de/anomic/kelondro/kelondroSplitTable.java index d044fc181..6c4a21dcd 100644 --- a/source/de/anomic/kelondro/kelondroSplitTable.java +++ b/source/de/anomic/kelondro/kelondroSplitTable.java @@ -131,7 +131,7 @@ public class kelondroSplitTable implements kelondroIndex { for (int i = 0; i < l.length; i++) { if (l[i].startsWith(tablename)) { File f = new File(path, l[i]); - if (f.isDirectory()) kelondroFlexTable.delete(path, l[i]); else f.delete(); + if (f.isDirectory()) kelondroFlexWidthArray.delete(path, l[i]); else f.delete(); } } init(true); diff --git a/source/de/anomic/kelondro/kelondroStack.java b/source/de/anomic/kelondro/kelondroStack.java index 854f0942b..6f8ba7a07 100644 --- a/source/de/anomic/kelondro/kelondroStack.java +++ b/source/de/anomic/kelondro/kelondroStack.java @@ -217,7 +217,7 @@ public final class kelondroStack extends kelondroFullRecords { return row().newEntry(n.getValueRow()); } - private void unlinkNode(kelondroNode n) throws IOException { + void unlinkNode(kelondroNode n) throws IOException { // join chaines over node kelondroHandle l = n.getOHHandle(left); kelondroHandle r = n.getOHHandle(right); diff --git a/source/de/anomic/kelondro/kelondroTree.java b/source/de/anomic/kelondro/kelondroTree.java index d8b559897..f1f76e59b 100644 --- a/source/de/anomic/kelondro/kelondroTree.java +++ b/source/de/anomic/kelondro/kelondroTree.java @@ -1507,7 +1507,7 @@ public class kelondroTree extends kelondroCachedRecords implements kelondroIndex } catch (Exception e) { e.printStackTrace(); - try {tt.print();} catch (IOException ee) {} + if (tt != null) try {tt.print();} catch (IOException ee) {} System.out.println("TERMINATED"); } } diff --git a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java b/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java index 7e5217f12..1b7a9607d 100644 --- a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java +++ b/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java @@ -38,7 +38,7 @@ import java.util.Iterator; import java.util.Map; import de.anomic.data.robotsParser; -import de.anomic.kelondro.kelondroFlexTable; +import de.anomic.kelondro.kelondroFlexWidthArray; import de.anomic.plasma.plasmaCrawlEntry; import de.anomic.plasma.plasmaCrawlNURL; import de.anomic.plasma.plasmaCrawlProfile; @@ -57,9 +57,9 @@ import de.anomic.yacy.yacyURL; public class plasmaCrawlQueues { private plasmaSwitchboard sb; - private serverLog log; - private Map workers; // mapping from url hash to Worker thread object - private plasmaProtocolLoader loader; + serverLog log; + Map workers; // mapping from url hash to Worker thread object + plasmaProtocolLoader loader; private ArrayList remoteCrawlProviderHashes; public plasmaCrawlNURL noticeURL; @@ -80,7 +80,7 @@ public class plasmaCrawlQueues { if (errorDBFile.exists()) { // delete the error db to get a fresh each time on startup // this is useful because there is currently no re-use of the data in this table. - if (errorDBFile.isDirectory()) kelondroFlexTable.delete(plasmaPath, "urlError2.db"); else errorDBFile.delete(); + if (errorDBFile.isDirectory()) kelondroFlexWidthArray.delete(plasmaPath, "urlError2.db"); else errorDBFile.delete(); } errorURL = new plasmaCrawlZURL(plasmaPath, "urlError2.db", false); delegatedURL = new plasmaCrawlZURL(plasmaPath, "urlDelegated2.db", true); diff --git a/source/de/anomic/plasma/plasmaCondenser.java b/source/de/anomic/plasma/plasmaCondenser.java index 3f642703e..3c08e440d 100644 --- a/source/de/anomic/plasma/plasmaCondenser.java +++ b/source/de/anomic/plasma/plasmaCondenser.java @@ -324,7 +324,7 @@ public final class plasmaCondenser { public int posInText; // unique handle, is initialized with word position (excluding double occurring words) public int posInPhrase; // position of word in phrase public int numOfPhrase; // number of phrase. 'normal' phrases begin with number 100 - private HashSet hash; // a set of handles to all sentences where this word appears + HashSet hash; // a set of handles to all sentences where this word appears public kelondroBitfield flags; // the flag bits for each word public wordStatProp(int handle, int pip, int nop) { diff --git a/source/de/anomic/plasma/plasmaCrawlBalancer.java b/source/de/anomic/plasma/plasmaCrawlBalancer.java index 75e32bcba..235301f27 100644 --- a/source/de/anomic/plasma/plasmaCrawlBalancer.java +++ b/source/de/anomic/plasma/plasmaCrawlBalancer.java @@ -75,7 +75,7 @@ public class plasmaCrawlBalancer { // class variables private ArrayList urlRAMStack; // a list that is flushed first private kelondroStack urlFileStack; // a file with url hashes - private kelondroIndex urlFileIndex; + kelondroIndex urlFileIndex; private HashMap> domainStacks; // a map from domain name part to Lists with url hashs private File cacheStacksPath; private String stackname; diff --git a/source/de/anomic/plasma/plasmaCrawlLURL.java b/source/de/anomic/plasma/plasmaCrawlLURL.java index 4b405a510..6086b9ea2 100644 --- a/source/de/anomic/plasma/plasmaCrawlLURL.java +++ b/source/de/anomic/plasma/plasmaCrawlLURL.java @@ -95,7 +95,7 @@ public final class plasmaCrawlLURL { private final LinkedList gcrawlResultStack; // 6 - local index: triggered external // the class object - private kelondroIndex urlIndexFile; + kelondroIndex urlIndexFile; public plasmaCrawlLURL(File indexPath) { super(); diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java index 95d63cd78..9e3095332 100644 --- a/source/de/anomic/plasma/plasmaCrawlProfile.java +++ b/source/de/anomic/plasma/plasmaCrawlProfile.java @@ -60,9 +60,9 @@ import de.anomic.yacy.yacyURL; public class plasmaCrawlProfile { - private static HashMap> domsCache = new HashMap>(); + static HashMap> domsCache = new HashMap>(); - private kelondroMapObjects profileTable; + kelondroMapObjects profileTable; private File profileTableFile; public plasmaCrawlProfile(File file) { @@ -72,7 +72,7 @@ public class plasmaCrawlProfile { profileTable = new kelondroMapObjects(dyn, 500); } - private void resetDatabase() { + void resetDatabase() { // deletes the profile database and creates a new one if (profileTable != null) profileTable.close(); if (!(profileTableFile.delete())) throw new RuntimeException("cannot delete crawl profile database"); @@ -252,7 +252,7 @@ public class plasmaCrawlProfile { public static final String XDSTOPW = "xdstopw"; public static final String XPSTOPW = "xpstopw"; - private HashMap mem; + HashMap mem; private Map doms; public entry(String name, yacyURL startURL, String generalFilter, String specificFilter, diff --git a/source/de/anomic/plasma/plasmaCrawlZURL.java b/source/de/anomic/plasma/plasmaCrawlZURL.java index 38901ede0..5848317ad 100644 --- a/source/de/anomic/plasma/plasmaCrawlZURL.java +++ b/source/de/anomic/plasma/plasmaCrawlZURL.java @@ -34,7 +34,7 @@ import java.util.LinkedList; import de.anomic.kelondro.kelondroBase64Order; import de.anomic.kelondro.kelondroEcoTable; -import de.anomic.kelondro.kelondroFlexTable; +import de.anomic.kelondro.kelondroFlexWidthArray; import de.anomic.kelondro.kelondroIndex; import de.anomic.kelondro.kelondroRow; import de.anomic.kelondro.kelondroRowSet; @@ -57,7 +57,7 @@ public class plasmaCrawlZURL { 0); // the class object - private kelondroIndex urlIndex = null; + kelondroIndex urlIndex = null; private LinkedList stack = new LinkedList(); // strings: url public plasmaCrawlZURL(File cachePath, String tablename, boolean startWithEmptyFile) { @@ -66,7 +66,7 @@ public class plasmaCrawlZURL { File f = new File(cachePath, tablename); if (startWithEmptyFile) { if (f.exists()) { - if (f.isDirectory()) kelondroFlexTable.delete(cachePath, tablename); else f.delete(); + if (f.isDirectory()) kelondroFlexWidthArray.delete(cachePath, tablename); else f.delete(); } } urlIndex = new kelondroEcoTable(f, rowdef, kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, 0); diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index b4230f6a0..1c9237a47 100644 --- a/source/de/anomic/plasma/plasmaHTCache.java +++ b/source/de/anomic/plasma/plasmaHTCache.java @@ -99,7 +99,7 @@ public final class plasmaHTCache { private static final int stackLimit = 150; // if we exceed that limit, we do not check idle public static final long oneday = 1000 * 60 * 60 * 24; // milliseconds of a day - private static kelondroMapObjects responseHeaderDB = null; + static kelondroMapObjects responseHeaderDB = null; private static final LinkedList cacheStack = new LinkedList(); private static final Map cacheAge = Collections.synchronizedMap(new TreeMap()); // a - relation public static long curCacheSize = 0; @@ -298,7 +298,7 @@ public final class plasmaHTCache { } } - private static void resetResponseHeaderDB() { + static void resetResponseHeaderDB() { if (responseHeaderDB != null) responseHeaderDB.close(); File dbfile = new File(cachePath, DB_NAME); if (dbfile.exists()) dbfile.delete(); diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java index daeca35a4..0ffc3b1c2 100644 --- a/source/de/anomic/plasma/plasmaSearchEvent.java +++ b/source/de/anomic/plasma/plasmaSearchEvent.java @@ -68,9 +68,9 @@ public final class plasmaSearchEvent { private static final int max_results_preparation = 200; private long eventTime; - private plasmaSearchQuery query; + plasmaSearchQuery query; private plasmaWordIndex wordIndex; - private plasmaSearchRankingProcess rankedCache; // ordered search results, grows dynamically as all the query threads enrich this container + plasmaSearchRankingProcess rankedCache; // ordered search results, grows dynamically as all the query threads enrich this container private Map> rcAbstracts; // cache for index abstracts; word:TreeMap mapping where the embedded TreeMap is a urlhash:peerlist relation private yacySearch[] primarySearchThreads, secondarySearchThreads; private Thread localSearchThread; @@ -80,12 +80,12 @@ public final class plasmaSearchEvent { public TreeMap IACount; public String IAmaxcounthash, IAneardhthash; private resultWorker[] workerThreads; - private kelondroSortStore result; - private kelondroSortStore images; // container to sort images by size - private HashMap failedURLs; // a mapping from a urlhash to a fail reason string + kelondroSortStore result; + kelondroSortStore images; // container to sort images by size + HashMap failedURLs; // a mapping from a urlhash to a fail reason string TreeSet snippetFetchWordHashes; // a set of word hashes that are used to match with the snippets - private long urlRetrievalAllTime; - private long snippetComputationAllTime; + long urlRetrievalAllTime; + long snippetComputationAllTime; @SuppressWarnings("unchecked") private plasmaSearchEvent(plasmaSearchQuery query, @@ -270,7 +270,7 @@ public final class plasmaSearchEvent { } } - private ResultEntry obtainResultEntry(indexURLEntry page, int snippetFetchMode) { + ResultEntry obtainResultEntry(indexURLEntry page, int snippetFetchMode) { // a search result entry needs some work to produce a result Entry: // - check if url entry exists in LURL-db @@ -391,7 +391,7 @@ public final class plasmaSearchEvent { return false; } - private boolean anyRemoteSearchAlive() { + boolean anyRemoteSearchAlive() { // check primary search threads if ((this.primarySearchThreads != null) && (this.primarySearchThreads.length != 0)) { for (int i = 0; i < this.primarySearchThreads.length; i++) { @@ -650,7 +650,7 @@ public final class plasmaSearchEvent { boolean secondarySearchStartet = false; - private void prepareSecondarySearch() { + void prepareSecondarySearch() { if (secondarySearchStartet) return; // don't do this twice if ((rcAbstracts == null) || (rcAbstracts.size() != query.queryHashes.size())) return; // secondary search not possible (yet) diff --git a/source/de/anomic/plasma/plasmaSnippetCache.java b/source/de/anomic/plasma/plasmaSnippetCache.java index 3b336ee69..ef21cad39 100644 --- a/source/de/anomic/plasma/plasmaSnippetCache.java +++ b/source/de/anomic/plasma/plasmaSnippetCache.java @@ -116,7 +116,7 @@ public class plasmaSnippetCache { private String line; private String error; private int errorCode; - private Set remaingHashes; + Set remaingHashes; private yacyURL favicon; public TextSnippet(yacyURL url, String line, int errorCode, Set remaingHashes, String errortext) { diff --git a/source/de/anomic/plasma/plasmaSwitchboardQueue.java b/source/de/anomic/plasma/plasmaSwitchboardQueue.java index f9879f55c..8b0e6165c 100644 --- a/source/de/anomic/plasma/plasmaSwitchboardQueue.java +++ b/source/de/anomic/plasma/plasmaSwitchboardQueue.java @@ -62,9 +62,9 @@ import de.anomic.yacy.yacyURL; public class plasmaSwitchboardQueue { - private kelondroStack sbQueueStack; - private plasmaCrawlProfile profiles; - private plasmaCrawlLURL lurls; + kelondroStack sbQueueStack; + plasmaCrawlProfile profiles; + plasmaCrawlLURL lurls; private File sbQueueStackPath; public plasmaSwitchboardQueue(plasmaCrawlLURL lurls, File sbQueueStackPath, plasmaCrawlProfile profiles) { @@ -191,14 +191,14 @@ public class plasmaSwitchboardQueue { } public class Entry { - private yacyURL url; // plasmaURL.urlStringLength - private String referrerHash; // plasmaURL.urlHashLength - private Date ifModifiedSince; // 6 - private byte flags; // 1 - private String initiator; // yacySeedDB.commonHashLength - private int depth; // plasmaURL.urlCrawlDepthLength - private String profileHandle; // plasmaURL.urlCrawlProfileHandleLength - private String anchorName; // plasmaURL.urlDescrLength + yacyURL url; // plasmaURL.urlStringLength + String referrerHash; // plasmaURL.urlHashLength + Date ifModifiedSince; // 6 + byte flags; // 1 + String initiator; // yacySeedDB.commonHashLength + int depth; // plasmaURL.urlCrawlDepthLength + String profileHandle; // plasmaURL.urlCrawlProfileHandleLength + String anchorName; // plasmaURL.urlDescrLength // computed values private plasmaCrawlProfile.entry profileEntry; diff --git a/source/de/anomic/plasma/plasmaWebStructure.java b/source/de/anomic/plasma/plasmaWebStructure.java index b58aa64c6..f07254576 100644 --- a/source/de/anomic/plasma/plasmaWebStructure.java +++ b/source/de/anomic/plasma/plasmaWebStructure.java @@ -55,7 +55,7 @@ public class plasmaWebStructure { private serverLog log; private File rankingPath, structureFile; private String crlFile, crgFile; - private TreeMap structure; // ',' to {}* + TreeMap structure; // ',' to {}* public plasmaWebStructure(serverLog log, File rankingPath, String crlFile, String crgFile, File structureFile) { this.log = log; @@ -181,7 +181,7 @@ public class plasmaWebStructure { return (refs.length() - 8) / 10; } - private static Map refstr2map(String refs) { + static Map refstr2map(String refs) { if ((refs == null) || (refs.length() <= 8)) return new HashMap(); Map map = new HashMap(); String c; diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java index 07a145770..956d13c35 100644 --- a/source/de/anomic/server/serverCore.java +++ b/source/de/anomic/server/serverCore.java @@ -96,7 +96,7 @@ public final class serverCore extends serverAbstractThread implements serverThre public static final Class[] stringType = {"".getClass()}; // set up some reflection public static final long startupTime = System.currentTimeMillis(); public static final ThreadGroup sessionThreadGroup = new ThreadGroup("sessionThreadGroup"); - private static int sessionCounter = 0; // will be increased with each session and is used to return a hash code + static int sessionCounter = 0; // will be increased with each session and is used to return a hash code // static variables public static final Boolean TERMINATE_CONNECTION = Boolean.FALSE; @@ -122,7 +122,7 @@ public final class serverCore extends serverAbstractThread implements serverThre HashMap denyHost; int commandMaxLength; private int maxBusySessions; - private HashSet busySessions; + HashSet busySessions; /* private static ServerSocketFactory getServerSocketFactory(boolean dflt, File keyfile, String passphrase) { diff --git a/source/de/anomic/xml/crawlHandler.java b/source/de/anomic/xml/crawlHandler.java index f86103623..b40f15624 100644 --- a/source/de/anomic/xml/crawlHandler.java +++ b/source/de/anomic/xml/crawlHandler.java @@ -39,7 +39,7 @@ import org.xml.sax.helpers.DefaultHandler; public class crawlHandler extends DefaultHandler { // statics for item generation and automatic categorization - private static int guidcount = 0; + static int guidcount = 0; private static final String[] startpointTags = new String[]{ "author", // "copyright", // diff --git a/source/de/anomic/xml/rssReader.java b/source/de/anomic/xml/rssReader.java index 28e003e99..3639510fb 100644 --- a/source/de/anomic/xml/rssReader.java +++ b/source/de/anomic/xml/rssReader.java @@ -46,7 +46,7 @@ import de.anomic.server.logging.serverLog; public class rssReader extends DefaultHandler { // statics for item generation and automatic categorization - private static int guidcount = 0; + static int guidcount = 0; private static final String[] tagsDef = new String[]{ "author", // "copyright", // diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.java index 576d7fde9..bf00a05ec 100644 --- a/source/de/anomic/yacy/yacyCore.java +++ b/source/de/anomic/yacy/yacyCore.java @@ -283,7 +283,7 @@ public class yacyCore { } protected class publishThread extends Thread { - private int added; + int added; private yacySeed seed; private final serverSemaphore sync; private final List syncList; diff --git a/source/de/anomic/yacy/yacyNewsQueue.java b/source/de/anomic/yacy/yacyNewsQueue.java index 168da0b4c..0fea9ada4 100644 --- a/source/de/anomic/yacy/yacyNewsQueue.java +++ b/source/de/anomic/yacy/yacyNewsQueue.java @@ -58,7 +58,7 @@ import de.anomic.server.serverDate; public class yacyNewsQueue { private File path; - private kelondroStack queueStack; + kelondroStack queueStack; private yacyNewsDB newsDB; public static final kelondroRow rowdef = new kelondroRow(new kelondroColumn[]{ @@ -144,7 +144,7 @@ public class yacyNewsQueue { return null; } - private yacyNewsRecord b2r(kelondroRow.Entry b) throws IOException { + yacyNewsRecord b2r(kelondroRow.Entry b) throws IOException { if (b == null) return null; String id = b.getColString(0, null); //Date touched = yacyCore.parseUniversalDate(new String(b[1])); diff --git a/source/de/anomic/ymage/ymageBMPParser.java b/source/de/anomic/ymage/ymageBMPParser.java index 64b872aa6..4fd1205bf 100644 --- a/source/de/anomic/ymage/ymageBMPParser.java +++ b/source/de/anomic/ymage/ymageBMPParser.java @@ -42,7 +42,7 @@ public class ymageBMPParser { public static int INFOHEADER_size = 40; // compression tags - private static int BI_RGB = 0; + static int BI_RGB = 0; //private static int BI_RLE8 = 1; //private static int BI_RLE4 = 2; //private static int BI_BITFIELDS = 3; diff --git a/source/screenshot.java b/source/screenshot.java new file mode 100755 index 000000000..6e666e5e0 --- /dev/null +++ b/source/screenshot.java @@ -0,0 +1,38 @@ + +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; + + +public class screenshot { + /* + try { + Robot robot = new Robot(); + + Rectangle area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); + BufferedImage bufferedImage = robot.createScreenCapture(area); + + } catch (AWTException e) { + } + */ + public static void main(String[] args) throws Exception { + + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Dimension screenSize = toolkit.getScreenSize(); + Rectangle screenRect = new Rectangle(screenSize); + // create screen shot + Robot robot = new Robot(); + BufferedImage image = robot.createScreenCapture(screenRect); + String outFileName = "test.png"; + // save captured image to PNG file + ImageIO.write(image, "png", new File(outFileName)); + // give feedback + System.out.println("Saved screen shot (" + image.getWidth() + " x " + image.getHeight() + " pixels) to file \"" + outFileName + "\"."); + + } +}