diff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.java index 78a997480..a07e21c00 100644 --- a/htroot/AccessTracker_p.java +++ b/htroot/AccessTracker_p.java @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import de.anomic.http.httpHeader; import de.anomic.net.natLib; @@ -128,7 +129,7 @@ public class AccessTracker_p { if ((page == 2) || (page == 4)) { ArrayList> array = (page == 2) ? switchboard.localSearches : switchboard.remoteSearches; Long trackerHandle; - HashMap searchProfile; + HashMap searchProfile; int m = Math.min(maxCount, array.size()); long qcountSum = 0; long qtimeSum = 0; @@ -138,7 +139,7 @@ public class AccessTracker_p { long rtimeSum = 0; for (int entCount = 0; entCount < m; entCount++) { - searchProfile = (HashMap) array.get(array.size() - entCount - 1); + searchProfile = array.get(array.size() - entCount - 1); trackerHandle = (Long) searchProfile.get("time"); // put values in template @@ -154,7 +155,7 @@ public class AccessTracker_p { } else { // remote search prop.putHTML("page_list_" + entCount + "_peername", (String) searchProfile.get("peername")); - prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.anonymizedQueryHashes((Set) searchProfile.get("queryhashes"))); + prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.anonymizedQueryHashes((Set) searchProfile.get("queryhashes"))); } prop.putNum("page_list_" + entCount + "_querycount", ((Integer) searchProfile.get("querycount")).longValue()); prop.putNum("page_list_" + entCount + "_querytime", ((Long) searchProfile.get("querytime")).longValue()); @@ -183,22 +184,22 @@ public class AccessTracker_p { prop.putNum("page_total", (page == 2) ? switchboard.localSearches.size() : switchboard.remoteSearches.size()); } if ((page == 3) || (page == 5)) { - Iterator i = (page == 3) ? switchboard.localSearchTracker.entrySet().iterator() : switchboard.remoteSearchTracker.entrySet().iterator(); + Iterator>> i = (page == 3) ? switchboard.localSearchTracker.entrySet().iterator() : switchboard.remoteSearchTracker.entrySet().iterator(); String host; - TreeSet handles; + TreeSet handles; int entCount = 0; int qphSum = 0; Map.Entry entry; try { while ((entCount < maxCount) && (i.hasNext())) { - entry = (Map.Entry) i.next(); + entry = i.next(); host = (String) entry.getKey(); - handles = (TreeSet) entry.getValue(); + handles = (TreeSet) entry.getValue(); int dateCount = 0; - Iterator ii = handles.iterator(); + Iterator ii = handles.iterator(); while (ii.hasNext()) { - Long timestamp = (Long) ii.next(); + Long timestamp = ii.next(); prop.put("page_list_" + entCount + "_dates_" + dateCount + "_date", serverDate.formatShortSecond(new Date(timestamp.longValue()))); prop.put("page_list_" + entCount + "_dates_" + dateCount + "_timestamp", timestamp.toString()); dateCount++; diff --git a/htroot/Blacklist_p.java b/htroot/Blacklist_p.java index c3c095011..dc84d2fb0 100644 --- a/htroot/Blacklist_p.java +++ b/htroot/Blacklist_p.java @@ -232,7 +232,7 @@ public class Blacklist_p { } // load blacklist data from file - ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); + ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); // delete the old entry from file if (list != null) { @@ -369,7 +369,7 @@ public class Blacklist_p { } // load blacklist data from file - ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); + ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); // delete the old entry from file if (list != null) { @@ -413,7 +413,7 @@ public class Blacklist_p { // Read the blacklist items from file if (blacklistToUse != null) { int entryCount = 0; - final ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); + final ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); // sort them String[] sortedlist = new String[list.size()]; @@ -436,16 +436,16 @@ public class Blacklist_p { if (yacyCore.seedDB != null && yacyCore.seedDB.sizeConnected() > 0) { // no nullpointer error int peerCount = 0; try { - TreeMap hostList = new TreeMap(); - final Iterator e = yacyCore.seedDB.seedsConnected(true, false, null, (float) 0.0); + TreeMap hostList = new TreeMap(); + final Iterator e = yacyCore.seedDB.seedsConnected(true, false, null, (float) 0.0); while (e.hasNext()) { yacySeed seed = (yacySeed) e.next(); if (seed != null) hostList.put(seed.get(yacySeed.NAME, "nameless"),seed.hash); } String peername; - while ((peername = (String) hostList.firstKey()) != null) { - final String Hash = (String) hostList.get(peername); + while ((peername = hostList.firstKey()) != null) { + final String Hash = hostList.get(peername); prop.put(DISABLED + "otherHosts_" + peerCount + "_hash", Hash); prop.putHTML(DISABLED + "otherHosts_" + peerCount + "_name", peername, true); hostList.remove(peername); diff --git a/htroot/News.java b/htroot/News.java index 6ac5363f3..436e5a73c 100644 --- a/htroot/News.java +++ b/htroot/News.java @@ -44,7 +44,6 @@ // if the shell's current path is HTROOT import java.io.IOException; -import java.util.Enumeration; import java.util.Iterator; import java.util.Map; @@ -75,11 +74,11 @@ public class News { prop.put("AUTHENTICATE", "admin log-in"); return prop; // this button needs authentication, force log-in } - Enumeration e = post.keys(); + Iterator e = post.keySet().iterator(); String check; String id; - while (e.hasMoreElements()) { - check = (String) e.nextElement(); + while (e.hasNext()) { + check = e.next(); if ((check.startsWith("del_")) && (post.get(check, "off").equals("on"))) { id = check.substring(4); try { @@ -125,12 +124,12 @@ public class News { } else { int maxCount = Math.min(1000, yacyCore.newsPool.size(tableID)); - Iterator recordIterator = yacyCore.newsPool.recordIterator(tableID, false); + Iterator recordIterator = yacyCore.newsPool.recordIterator(tableID, false); yacyNewsRecord record; yacySeed seed; int i = 0; while ((recordIterator.hasNext()) && (i < maxCount)) { - record = (yacyNewsRecord) recordIterator.next(); + record = recordIterator.next(); if (record == null) continue; seed = yacyCore.seedDB.getConnected(record.originator()); @@ -144,11 +143,11 @@ public class News { prop.put("table_list_" + i + "_rec", (record.received() == null) ? "-" : serverDate.formatShortSecond(record.received())); prop.put("table_list_" + i + "_dis", record.distributed()); - Map attributeMap = record.attributes(); + Map attributeMap = record.attributes(); prop.putHTML("table_list_" + i + "_att", attributeMap.toString()); int j = 0; if (attributeMap.size() > 0) { - Iterator attributeKeys = attributeMap.keySet().iterator(); + Iterator attributeKeys = attributeMap.keySet().iterator(); while (attributeKeys.hasNext()) { String key = (String) attributeKeys.next(); String value = (String) attributeMap.get(key); diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index d98adb901..7e12e5948 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -49,7 +49,6 @@ import java.net.InetSocketAddress; import java.net.SocketException; import java.util.Arrays; -import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -556,26 +555,26 @@ public class SettingsAck_p { if (post.containsKey("parserSettings")) { post.remove("parserSettings"); - Set parserModes = plasmaParser.getParserConfigList().keySet(); - HashMap newConfigList = new HashMap(); - Iterator parserModeIter = parserModes.iterator(); + Set parserModes = plasmaParser.getParserConfigList().keySet(); + HashMap newConfigList = new HashMap(); + Iterator parserModeIter = parserModes.iterator(); while (parserModeIter.hasNext()) { - String currParserMode = (String)parserModeIter.next(); + String currParserMode = parserModeIter.next(); newConfigList.put(currParserMode, new HashSet()); } // looping through all received settings int pos; - Enumeration keyEnum = post.keys(); - while (keyEnum.hasMoreElements()) { - String key = (String) keyEnum.nextElement(); + Iterator keyEnum = post.keySet().iterator(); + while (keyEnum.hasNext()) { + String key = keyEnum.next(); if ((pos = key.indexOf(".")) != -1) { String currParserMode = key.substring(0,pos).trim().toUpperCase(); String currMimeType = key.substring(pos+1).replaceAll("\n", ""); if (parserModes.contains(currParserMode)) { - HashSet currEnabledMimeTypes; + HashSet currEnabledMimeTypes; assert (newConfigList.containsKey(currParserMode)) : "Unexpected Error"; - currEnabledMimeTypes = (HashSet) newConfigList.get(currParserMode); + currEnabledMimeTypes = newConfigList.get(currParserMode); currEnabledMimeTypes.add(currMimeType); } } @@ -585,8 +584,8 @@ public class SettingsAck_p { StringBuffer currEnabledMimesTxt = new StringBuffer(); parserModeIter = newConfigList.keySet().iterator(); while (parserModeIter.hasNext()) { - String currParserMode = (String)parserModeIter.next(); - String[] enabledMimes = plasmaParser.setEnabledParserList(currParserMode, (Set)newConfigList.get(currParserMode)); + String currParserMode = parserModeIter.next(); + String[] enabledMimes = plasmaParser.setEnabledParserList(currParserMode, newConfigList.get(currParserMode)); Arrays.sort(enabledMimes); currEnabledMimesTxt.setLength(0); diff --git a/htroot/Statistics.java b/htroot/Statistics.java index 5fb2bded5..eaf3aaf59 100644 --- a/htroot/Statistics.java +++ b/htroot/Statistics.java @@ -44,10 +44,10 @@ // if the shell's current path is HTROOT import java.net.MalformedURLException; -import java.util.Iterator; -import java.util.Map; +import java.util.HashMap; import de.anomic.http.httpHeader; +import de.anomic.kelondro.kelondroMapObjects; import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; @@ -71,11 +71,11 @@ public class Statistics { prop.put("page_backlinks", "0"); } else { prop.put("page_backlinks", "1"); - Iterator> it = switchboard.facilityDB.maps("backlinks", false, "date"); + kelondroMapObjects.mapIterator it = switchboard.facilityDB.maps("backlinks", false, "date"); int count = 0; int maxCount = 100; boolean dark = true; - Map map; + HashMap map; String urlString; yacyURL url; while ((it.hasNext()) && (count < maxCount)) { diff --git a/source/de/anomic/data/URLFetcherStack.java b/source/de/anomic/data/URLFetcherStack.java index 5f9234170..a72e2353f 100644 --- a/source/de/anomic/data/URLFetcherStack.java +++ b/source/de/anomic/data/URLFetcherStack.java @@ -51,6 +51,7 @@ import de.anomic.kelondro.kelondroBase64Order; import de.anomic.kelondro.kelondroException; import de.anomic.kelondro.kelondroRow; import de.anomic.kelondro.kelondroStack; +import de.anomic.kelondro.kelondroRow.EntryIndex; import de.anomic.server.logging.serverLog; import de.anomic.yacy.yacyURL; @@ -115,15 +116,15 @@ public class URLFetcherStack { public String[] top(int count) { try { - final ArrayList ar = new ArrayList(); - Iterator it = db.contentRows(500); + final ArrayList ar = new ArrayList(); + Iterator it = db.contentRows(500); kelondroRow.EntryIndex ei; for (int i=0; i permissions; private int keylen; public URLLicense(int keylen) { - this.permissions = new HashMap(); + this.permissions = new HashMap(); this.random = new Random(System.currentTimeMillis()); this.keylen = keylen; } @@ -62,7 +62,7 @@ public class URLLicense { public yacyURL releaseLicense(String license) { yacyURL url = null; synchronized (permissions) { - url = (yacyURL) permissions.remove(license); + url = permissions.remove(license); } /* if (url == null) { diff --git a/source/de/anomic/data/blogBoard.java b/source/de/anomic/data/blogBoard.java index 43abfeacf..14b6f1c68 100644 --- a/source/de/anomic/data/blogBoard.java +++ b/source/de/anomic/data/blogBoard.java @@ -52,7 +52,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -109,17 +108,17 @@ public class blogBoard { return wikiBoard.guessAuthor(ip); } - public entry newEntry(String key, byte[] subject, byte[] author, String ip, Date date, byte[] page, ArrayList comments, String commentMode) { + public entry newEntry(String key, byte[] subject, byte[] author, String ip, Date date, byte[] page, ArrayList comments, String commentMode) { return new entry(normalize(key), subject, author, ip, date, page, comments, commentMode); } public class entry { String key; - Map record; + HashMap record; - public entry(String nkey, byte[] subject, byte[] author, String ip, Date date, byte[] page, ArrayList comments, String commentMode) { - record = new HashMap(); + public entry(String nkey, byte[] subject, byte[] author, String ip, Date date, byte[] page, ArrayList comments, String commentMode) { + record = new HashMap(); key = nkey; if (key.length() > keyLength) key = key.substring(0, keyLength); if(date == null) date = new Date(); @@ -132,7 +131,7 @@ public class blogBoard { record.put("ip", ip); if (page == null) record.put("page", ""); else record.put("page", kelondroBase64Order.enhancedCoder.encode(page)); - if (comments == null) record.put("comments", listManager.collection2string(new ArrayList())); + if (comments == null) record.put("comments", listManager.collection2string(new ArrayList())); else record.put("comments", listManager.collection2string(comments)); if (commentMode == null) record.put("commentMode", "1"); else record.put("commentMode", commentMode); @@ -141,10 +140,10 @@ public class blogBoard { //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString()); } - private entry(String key, Map record) { + private entry(String key, HashMap record) { this.key = key; this.record = record; - if (this.record.get("comments")==null) this.record.put("comments", listManager.collection2string(new ArrayList())); + if (this.record.get("comments")==null) this.record.put("comments", listManager.collection2string(new ArrayList())); if (this.record.get("commentMode")==null || this.record.get("commentMode").equals("")) this.record.put("commentMode", "1"); } @@ -153,7 +152,7 @@ public class blogBoard { } public byte[] subject() { - String m = (String) record.get("subject"); + String m = record.get("subject"); if (m == null) return new byte[0]; byte[] b = kelondroBase64Order.enhancedCoder.decode(m, "de.anomic.data.blogBoard.subject()"); if (b == null) return "".getBytes(); @@ -162,7 +161,7 @@ public class blogBoard { public Date date() { try { - String c = (String) record.get("date"); + String c = record.get("date"); if (c == null) { System.out.println("DEBUG - ERROR: date field missing in blogBoard"); return new Date(); @@ -174,7 +173,7 @@ public class blogBoard { } public String timestamp() { - String c = (String) record.get("date"); + String c = record.get("date"); if (c == null) { System.out.println("DEBUG - ERROR: date field missing in blogBoard"); return serverDate.formatShortSecond(); @@ -183,7 +182,7 @@ public class blogBoard { } public byte[] author() { - String m = (String) record.get("author"); + String m = record.get("author"); if (m == null) return new byte[0]; byte[] b = kelondroBase64Order.enhancedCoder.decode(m, "de.anomic.data.blogBoard.author()"); if (b == null) return "".getBytes(); @@ -191,27 +190,27 @@ public class blogBoard { } public byte[] commentsSize() { - ArrayList m = listManager.string2arraylist((String) record.get("comments")); + ArrayList m = listManager.string2arraylist(record.get("comments")); if (m == null) return new byte[0]; byte[] b = Integer.toString(m.size()).getBytes(); if (b == null) return "".getBytes(); return b; } - public ArrayList comments() { - ArrayList m = listManager.string2arraylist((String) record.get("comments")); - if (m == null) return new ArrayList(); + public ArrayList comments() { + ArrayList m = listManager.string2arraylist(record.get("comments")); + if (m == null) return new ArrayList(); return m; } public String ip() { - String a = (String) record.get("ip"); + String a = record.get("ip"); if (a == null) return "127.0.0.1"; return a; } public byte[] page() { - String m = (String) record.get("page"); + String m = record.get("page"); if (m == null) return new byte[0]; byte[] b = kelondroBase64Order.enhancedCoder.decode(m, "de.anomic.data.blogBoard.page()"); if (b == null) return "".getBytes(); @@ -219,20 +218,20 @@ public class blogBoard { } public void addComment(String commentID) { - ArrayList comments = listManager.string2arraylist((String) record.get("comments")); + ArrayList comments = listManager.string2arraylist(record.get("comments")); comments.add(commentID); record.put("comments", listManager.collection2string(comments)); } public boolean removeComment(String commentID) { - ArrayList comments = listManager.string2arraylist((String) record.get("comments")); + ArrayList comments = listManager.string2arraylist(record.get("comments")); boolean success = comments.remove(commentID); record.put("comments", listManager.collection2string(comments)); return success; } public int getCommentMode(){ - return Integer.parseInt((String) record.get("commentMode")); + return Integer.parseInt(record.get("commentMode")); } } @@ -253,7 +252,7 @@ public class blogBoard { private entry read(String key, kelondroMapObjects base) { key = normalize(key); if (key.length() > keyLength) key = key.substring(0, keyLength); - Map record = base.getMap(key); + HashMap record = base.getMap(key); if (record == null) return newEntry(key, "".getBytes(), "anonymous".getBytes(), "127.0.0.1", new Date(), "".getBytes(), null, null); return new entry(key, record); } @@ -342,7 +341,7 @@ public class blogBoard { } catch (IOException e) { } } - public Iterator keys(boolean up) throws IOException { + public Iterator keys(boolean up) throws IOException { return datbase.keys(up, false); } diff --git a/source/de/anomic/data/blogBoardComments.java b/source/de/anomic/data/blogBoardComments.java index e0fb66f70..bff065684 100644 --- a/source/de/anomic/data/blogBoardComments.java +++ b/source/de/anomic/data/blogBoardComments.java @@ -53,7 +53,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import java.util.TimeZone; import javax.xml.parsers.DocumentBuilder; @@ -130,10 +129,10 @@ public class blogBoardComments { public class CommentEntry { String key; - Map record; + HashMap record; public CommentEntry(String nkey, byte[] subject, byte[] author, String ip, Date date, byte[] page) { - record = new HashMap(); + record = new HashMap(); key = nkey; if (key.length() > keyLength) key = key.substring(0, keyLength); if(date == null) date = new Date(); @@ -151,10 +150,10 @@ public class blogBoardComments { //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString()); } - private CommentEntry(String key, Map record) { + private 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())); + if (this.record.get("comments")==null) this.record.put("comments", listManager.collection2string(new ArrayList())); } public String key() { @@ -216,13 +215,11 @@ public class blogBoardComments { } public boolean isAllowed() { - Boolean moderated = (Boolean) record.get("moderated"); - if (moderated == null) return false; - return moderated.booleanValue(); + return (record.get("moderated") != null) && record.get("moderated").equals("true"); } public void allow() { - record.put("moderated", new Boolean(true)); + record.put("moderated", "true"); } } @@ -245,7 +242,7 @@ public class blogBoardComments { private CommentEntry read(String key, kelondroMapObjects base) { key = normalize(key); if (key.length() > keyLength) key = key.substring(0, keyLength); - Map record = base.getMap(key); + HashMap record = base.getMap(key); if (record == null) return newEntry(key, "".getBytes(), "anonymous".getBytes(), "127.0.0.1", new Date(), "".getBytes()); return new CommentEntry(key, record); } @@ -347,7 +344,7 @@ public class blogBoardComments { } catch (IOException e) { } } - public Iterator keys(boolean up) throws IOException { + public Iterator keys(boolean up) throws IOException { return datbase.keys(up, false); } diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index 0903c7c72..85b084eb8 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -102,7 +102,7 @@ public class bookmarksDB { // tags kelondroMapObjects tagsTable; - HashMap tagCache; + HashMap tagCache; // dates kelondroMapObjects datesTable; @@ -114,7 +114,7 @@ public class bookmarksDB { public bookmarksDB(File bookmarksFile, File tagsFile, File datesFile, long preloadTime) { // bookmarks - tagCache=new HashMap(); + tagCache=new HashMap(); bookmarkCache=new HashMap(); bookmarksFile.getParentFile().mkdirs(); //this.bookmarksTable = new kelondroMap(kelondroDyn.open(bookmarksFile, bufferkb * 1024, preloadTime, 12, 256, '_', true, false)); @@ -164,11 +164,11 @@ public class bookmarksDB { Set folders = new TreeSet(); String path = ""; - Iterator it = this.getTagIterator(priv); + Iterator it = this.getTagIterator(priv); Tag tag; while(it.hasNext()){ - tag=(Tag) it.next(); + tag=it.next(); if (tag.getFriendlyName().startsWith("/")) { path = tag.getFriendlyName(); path = cleanTagsString(path); @@ -282,8 +282,8 @@ public class bookmarksDB { } - public Iterator getBookmarksIterator(boolean priv){ - TreeSet set=new TreeSet(new bookmarkComparator(true)); + public Iterator getBookmarksIterator(boolean priv){ + TreeSet set=new TreeSet(new bookmarkComparator(true)); Iterator it=bookmarkIterator(true); Bookmark bm; while(it.hasNext()){ @@ -294,21 +294,21 @@ public class bookmarksDB { } return set.iterator(); } - public Iterator getBookmarksIterator(String tagName, boolean priv){ - TreeSet set=new TreeSet(new bookmarkComparator(true)); + public Iterator getBookmarksIterator(String tagName, boolean priv){ + TreeSet set=new TreeSet(new bookmarkComparator(true)); String tagHash=tagHash(tagName); Tag tag=getTag(tagHash); - Set hashes=new HashSet(); + Set hashes=new HashSet(); if(tag != null){ hashes=getTag(tagHash).getUrlHashes(); } if(priv){ set.addAll(hashes); }else{ - Iterator it=hashes.iterator(); + Iterator it=hashes.iterator(); Bookmark bm; while(it.hasNext()){ - bm=getBookmark((String) it.next()); + bm=getBookmark(it.next()); if(bm.getPublic()){ set.add(bm.getUrlHash()); } @@ -335,7 +335,7 @@ public class bookmarksDB { * @param hash an object of type String, containing a tagHash */ public Tag loadTag(String hash){ // TODO: check if loadTag() could be private - Map map; + HashMap map; Tag ret=null; map = tagsTable.getMap(hash); if(map!=null){ @@ -350,7 +350,7 @@ public class bookmarksDB { */ public Tag getTag(String hash){ if(tagCache.containsKey(hash)){ - return (Tag) tagCache.get(hash); + return tagCache.get(hash); } return loadTag(hash); //null if it does not exists } @@ -377,11 +377,11 @@ public class bookmarksDB { } } public void flushTagCache(){ - Iterator it=tagCache.keySet().iterator(); + Iterator it=tagCache.keySet().iterator(); while(it.hasNext()){ - storeTag((Tag) tagCache.get(it.next())); + storeTag(tagCache.get(it.next())); } - tagCache=new HashMap(); + tagCache=new HashMap(); } public String addTag(Tag tag){ // TODO: is addTag() really needed - check storeTag() and saveTag() //tagsTable.set(tag.getTagName(), tag.getMap()); @@ -404,14 +404,14 @@ public class bookmarksDB { return new HashSet().iterator(); } } - public Iterator getTagIterator(boolean priv){ + public Iterator getTagIterator(boolean priv){ return getTagIterator(priv,1); } - public Iterator getTagIterator(boolean priv, int c){ + public Iterator getTagIterator(boolean priv, int c){ Comparator comp; if (c == SORT_SIZE) comp = new tagSizeComparator(); else comp = new tagComparator(); - TreeSet set=new TreeSet(comp); + TreeSet set=new TreeSet(comp); Iterator it=tagIterator(true); Tag tag; while(it.hasNext()){ @@ -422,11 +422,11 @@ public class bookmarksDB { } return set.iterator(); } - public Iterator getTagIterator(boolean priv, int comp, int max){ + public Iterator getTagIterator(boolean priv, int comp, int max){ if (max==SHOW_ALL) return getTagIterator(priv, comp); - Iterator it = getTagIterator(priv, comp); - TreeSet set=new TreeSet(new tagComparator()); + Iterator it = getTagIterator(priv, comp); + TreeSet set=new TreeSet(new tagComparator()); int count = 0; while (it.hasNext() && count<=max) { set.add(it.next()); @@ -434,25 +434,25 @@ public class bookmarksDB { } return set.iterator(); } - public Iterator getTagIterator(String tagName, boolean priv){ + public Iterator getTagIterator(String tagName, boolean priv){ return getTagIterator(tagName, priv, 1); } - public Iterator getTagIterator(String tagName, boolean priv, int comp){ + public Iterator getTagIterator(String tagName, boolean priv, int comp){ Comparator c; if (comp == SORT_SIZE) c = new tagSizeComparator(); else c = new tagComparator(); - TreeSet set=new TreeSet(c); - Iterator it=null; - Iterator bit=getBookmarksIterator(tagName, priv); + TreeSet set=new TreeSet(c); + Iterator it=null; + Iterator bit=getBookmarksIterator(tagName, priv); Bookmark bm; Tag tag; Set tags; while(bit.hasNext()){ - bm=getBookmark((String)bit.next()); + bm=getBookmark(bit.next()); tags = bm.getTags(); it = tags.iterator(); while (it.hasNext()) { - tag=getTag( tagHash((String) it.next()) ); + tag=getTag( tagHash(it.next()) ); if(priv ||tag.hasPublicItems()){ set.add(tag); } @@ -460,11 +460,11 @@ public class bookmarksDB { } return set.iterator(); } - public Iterator getTagIterator(String tagName, boolean priv, int comp, int max){ + public Iterator getTagIterator(String tagName, boolean priv, int comp, int max){ if (max==SHOW_ALL) return getTagIterator(priv, comp); - Iterator it = getTagIterator(tagName, priv, comp); - TreeSet set=new TreeSet(new tagComparator()); + Iterator it = getTagIterator(tagName, priv, comp); + TreeSet set=new TreeSet(new tagComparator()); int count = 0; while (it.hasNext() && count<=max) { set.add(it.next()); @@ -502,7 +502,7 @@ public class bookmarksDB { // --------------------------------------- public bookmarksDate getDate(String date){ - Map map; + HashMap map; map=datesTable.getMap(date); if(map==null) return new bookmarksDate(date); return new bookmarksDate(date, map); @@ -541,7 +541,7 @@ public class bookmarksDB { removeTag(oldHash); Iterator it = urlHashes.iterator(); Bookmark bookmark; - Set tags = new HashSet(); + Set tags = new HashSet(); String tagsString; while (it.hasNext()) { // looping through all bookmarks which were tagged with oldName bookmark = getBookmark((String) it.next()); @@ -588,7 +588,7 @@ public class bookmarksDB { String title; yacyURL url; Bookmark bm; - Set tags=listManager.string2set(tag); //this allow multiple default tags + Set tags=listManager.string2set(tag); //this allow multiple default tags try { //load the links htmlFilterContentScraper scraper = new htmlFilterContentScraper(baseURL); @@ -672,7 +672,7 @@ public class bookmarksDB { if(attributes.getNamedItem("time")!=null){ time=attributes.getNamedItem("time").getNodeValue(); } - Set tags=new HashSet(); + Set tags=new HashSet(); if(title != null){ bm.setProperty(Bookmark.BOOKMARK_TITLE, title); @@ -721,32 +721,32 @@ public class bookmarksDB { public static final String URL_HASHES="urlHashes"; public static final String TAG_NAME="tagName"; private String tagHash; - private Map mem; + private HashMap mem; private Set urlHashes; - public Tag(String hash, Map map){ + public Tag(String hash, HashMap map){ tagHash=hash; mem=map; if(mem.containsKey(URL_HASHES)) - urlHashes = listManager.string2set((String) mem.get(URL_HASHES)); + urlHashes = listManager.string2set(mem.get(URL_HASHES)); else - urlHashes = new HashSet(); + urlHashes = new HashSet(); } - public Tag(String name, HashSet entries){ + public Tag(String name, HashSet entries){ tagHash=tagHash(name); - mem=new HashMap(); + mem=new HashMap(); //mem.put(URL_HASHES, listManager.arraylist2string(entries)); urlHashes=entries; mem.put(TAG_NAME, name); } public Tag(String name){ tagHash=tagHash(name); - mem=new HashMap(); + mem=new HashMap(); //mem.put(URL_HASHES, ""); - urlHashes=new HashSet(); + urlHashes=new HashSet(); mem.put(TAG_NAME, name); } - public Map getMap(){ + public HashMap getMap(){ mem.put(URL_HASHES, listManager.collection2string(this.urlHashes)); return mem; } @@ -772,7 +772,7 @@ public class bookmarksDB { } return getTagName();*/ if(this.mem.containsKey(TAG_NAME)){ - return (String) this.mem.get(TAG_NAME); + return this.mem.get(TAG_NAME); } return "notagname"; } @@ -780,7 +780,7 @@ public class bookmarksDB { return urlHashes; } public boolean hasPublicItems(){ - Iterator it=getBookmarksIterator(this.getTagHash(), false); + Iterator it=getBookmarksIterator(this.getTagHash(), false); if(it.hasNext()){ return true; } @@ -801,34 +801,34 @@ public class bookmarksDB { */ public class bookmarksDate{ public static final String URL_HASHES="urlHashes"; - private Map mem; + private HashMap mem; String date; public bookmarksDate(String mydate){ //round to seconds, but store as milliseconds (java timestamp) date=String.valueOf((Long.parseLong(mydate)/1000)*1000); - mem=new HashMap(); + mem=new HashMap(); mem.put(URL_HASHES, ""); } - public bookmarksDate(String mydate, Map map){ + public bookmarksDate(String mydate, HashMap map){ //round to seconds, but store as milliseconds (java timestamp) date=String.valueOf((Long.parseLong(mydate)/1000)*1000); mem=map; } - public bookmarksDate(String mydate, ArrayList entries){ + public bookmarksDate(String mydate, ArrayList entries){ //round to seconds, but store as milliseconds (java timestamp) date=String.valueOf((Long.parseLong(mydate)/1000)*1000); - mem=new HashMap(); + mem=new HashMap(); mem.put(URL_HASHES, listManager.collection2string(entries)); } public void add(String urlHash){ - String urlHashes = (String)mem.get(URL_HASHES); - ArrayList list; + String urlHashes = mem.get(URL_HASHES); + ArrayList list; if(urlHashes != null && !urlHashes.equals("")){ list=listManager.string2arraylist(urlHashes); }else{ - list=new ArrayList(); + list=new ArrayList(); } if(!list.contains(urlHash) && urlHash != null && !urlHash.equals("")){ list.add(urlHash); @@ -843,7 +843,7 @@ public class bookmarksDB { }*/ } public void delete(String urlHash){ - ArrayList list=listManager.string2arraylist((String) this.mem.get(URL_HASHES)); + ArrayList list=listManager.string2arraylist(this.mem.get(URL_HASHES)); if(list.contains(urlHash)){ list.remove(urlHash); } @@ -862,10 +862,10 @@ public class bookmarksDB { return date; } public ArrayList getBookmarkList(){ - return listManager.string2arraylist((String)this.mem.get(URL_HASHES)); + return listManager.string2arraylist(this.mem.get(URL_HASHES)); } public int size(){ - return listManager.string2arraylist(((String)this.mem.get(URL_HASHES))).size(); + return listManager.string2arraylist(this.mem.get(URL_HASHES)).size(); } } /** @@ -883,13 +883,13 @@ public class bookmarksDB { private String urlHash; private Set tags; private long timestamp; - public Bookmark(String urlHash, Map map){ + public Bookmark(String urlHash, HashMap map){ super(map); this.urlHash=urlHash; if(map.containsKey(BOOKMARK_TAGS)) tags=listManager.string2set((String) map.get(BOOKMARK_TAGS)); else - tags=new HashSet(); + tags=new HashSet(); loadTimestamp(); } public Bookmark(String url){ @@ -904,14 +904,14 @@ public class bookmarksDB { } entry.put(BOOKMARK_URL, url); this.timestamp=System.currentTimeMillis(); - tags=new HashSet(); + tags=new HashSet(); Bookmark oldBm=getBookmark(this.urlHash); if(oldBm!=null && oldBm.entry.containsKey(BOOKMARK_TIMESTAMP)){ entry.put(BOOKMARK_TIMESTAMP, oldBm.entry.get(BOOKMARK_TIMESTAMP)); //preserve timestamp on edit }else{ entry.put(BOOKMARK_TIMESTAMP, String.valueOf(System.currentTimeMillis())); } - bookmarksDate bmDate=getDate((String) entry.get(BOOKMARK_TIMESTAMP)); + bookmarksDate bmDate=getDate(entry.get(BOOKMARK_TIMESTAMP)); bmDate.add(this.urlHash); bmDate.setDatesTable(); @@ -921,14 +921,14 @@ public class bookmarksDB { super(); this.urlHash=urlHash; entry.put(BOOKMARK_URL, url.toNormalform(false, true)); - tags=new HashSet(); + tags=new HashSet(); timestamp=System.currentTimeMillis(); } public Bookmark(String urlHash, String url){ super(); this.urlHash=urlHash; entry.put(BOOKMARK_URL, url); - tags=new HashSet(); + tags=new HashSet(); timestamp=System.currentTimeMillis(); } @@ -936,20 +936,20 @@ public class bookmarksDB { this((new yacyURL((String)map.map().get(BOOKMARK_URL), null)).hash(), map.map()); } - private Map toMap(){ + private Map toMap(){ entry.put(BOOKMARK_TAGS, listManager.collection2string(tags)); entry.put(BOOKMARK_TIMESTAMP, String.valueOf(this.timestamp)); return entry; } private void loadTimestamp(){ if(entry.containsKey(BOOKMARK_TIMESTAMP)) - this.timestamp=Long.parseLong((String)entry.get(BOOKMARK_TIMESTAMP)); + this.timestamp=Long.parseLong(entry.get(BOOKMARK_TIMESTAMP)); } public String getUrlHash(){ return urlHash; } public String getUrl(){ - return (String) entry.get(BOOKMARK_URL); + return entry.get(BOOKMARK_URL); } public Set getTags(){ return tags; @@ -976,19 +976,19 @@ public class bookmarksDB { } public String getDescription(){ if(entry.containsKey(BOOKMARK_DESCRIPTION)){ - return (String) entry.get(BOOKMARK_DESCRIPTION); + return entry.get(BOOKMARK_DESCRIPTION); } return ""; } public String getTitle(){ if(entry.containsKey(BOOKMARK_TITLE)){ - return (String) entry.get(BOOKMARK_TITLE); + return entry.get(BOOKMARK_TITLE); } - return (String) entry.get(BOOKMARK_URL); + return entry.get(BOOKMARK_URL); } public String getOwner(){ if(entry.containsKey(BOOKMARK_OWNER)){ - return (String) entry.get(BOOKMARK_OWNER); + return entry.get(BOOKMARK_OWNER); } return null; //null means admin } @@ -997,13 +997,13 @@ public class bookmarksDB { } public boolean getPublic(){ if(entry.containsKey(BOOKMARK_PUBLIC)){ - return ((String) entry.get(BOOKMARK_PUBLIC)).equals("public"); + return entry.get(BOOKMARK_PUBLIC).equals("public"); } return false; } public boolean getFeed(){ if(entry.containsKey(BOOKMARK_IS_FEED)){ - return ((String) entry.get(BOOKMARK_IS_FEED)).equals("true"); + return entry.get(BOOKMARK_IS_FEED).equals("true"); } return false; } @@ -1045,7 +1045,7 @@ public class bookmarksDB { // tags.addAll(tags2); // in order for renameTag() to work I had to change this form 'add' to 'set' Iterator it=tags.iterator(); while(it.hasNext()){ - String tagName=(String) it.next(); + String tagName=it.next(); Tag tag=getTag(tagHash(tagName)); if(tag == null){ tag=new Tag(tagName); diff --git a/source/de/anomic/data/diff.java b/source/de/anomic/data/diff.java index 29f92c8e7..8bcc09d78 100644 --- a/source/de/anomic/data/diff.java +++ b/source/de/anomic/data/diff.java @@ -54,7 +54,7 @@ import java.util.ArrayList; */ public class diff { - private final ArrayList /* of Part */ parts = new ArrayList(); + private final ArrayList parts = new ArrayList(); private final Object[] o; private final Object[] n; @@ -191,12 +191,12 @@ public class diff { * @see Part * @return all parts this diff consists of in correct order */ - public Part[] getParts() { return (Part[])this.parts.toArray(new Part[this.parts.size()]); } + public Part[] getParts() { return this.parts.toArray(new Part[this.parts.size()]); } public String toString() { StringBuffer sb = new StringBuffer(this.parts.size() * 20); for (int j=0; j getListSet(String setName) { return string2set(switchboard.getConfig(setName, "")); } @@ -93,7 +93,7 @@ public class listManager { * @param listName name of the element to remove from the ListSet. */ public static void removeFromListSet(String setName, String listName) { - Set listSet = getListSet(setName); + Set listSet = getListSet(setName); if (listSet.size() > 0) { listSet.remove(listName); @@ -112,7 +112,7 @@ public class listManager { * @param newListName */ public static void updateListSet(String setName, String newListName) { - Set listSet = getListSet(setName); + Set listSet = getListSet(setName); listSet.add(newListName); switchboard.setConfig(setName, collection2string(listSet)); @@ -125,7 +125,7 @@ public class listManager { * "listName", false otherwise. */ public static boolean listSetContains(String setName, String listName) { - Set Lists = getListSet(setName); + Set Lists = getListSet(setName); return Lists.contains(listName); } @@ -139,9 +139,9 @@ public class listManager { * @param listFile the file * @return the resulting array as an ArrayList */ - public static ArrayList getListArray(File listFile){ + public static ArrayList getListArray(File listFile){ String line; - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); int count = 0; BufferedReader br = null; try { @@ -269,7 +269,7 @@ public class listManager { } // same as below - public static ArrayList getDirsRecursive(File dir, String notdir){ + public static ArrayList getDirsRecursive(File dir, String notdir){ return getDirsRecursive(dir, notdir, true); } @@ -278,11 +278,11 @@ public class listManager { * * Warning: untested */ - public static ArrayList getDirsRecursive(File dir, String notdir, boolean excludeDotfiles){ + public static ArrayList getDirsRecursive(File dir, String notdir, boolean excludeDotfiles){ final File[] dirList = dir.listFiles(); - final ArrayList resultList = new ArrayList(); - ArrayList recursive; - Iterator iter; + final ArrayList resultList = new ArrayList(); + ArrayList recursive; + Iterator iter; for (int i=0;i col){ StringBuffer str = new StringBuffer(); if (col != null && (col.size() > 0)) { - Iterator it = col.iterator(); - str.append((String) it.next()); + Iterator it = col.iterator(); + str.append(it.next()); while(it.hasNext()) { - str.append(",").append((String) it.next()); + str.append(",").append(it.next()); } } @@ -324,13 +324,13 @@ public class listManager { /** * @see listManager#string2vector(String) */ - public static ArrayList string2arraylist(String string){ - ArrayList l; + public static ArrayList string2arraylist(String string){ + ArrayList l; if (string != null) { - l = new ArrayList(Arrays.asList(string.split(","))); + l = new ArrayList(Arrays.asList(string.split(","))); } else { - l = new ArrayList(); + l = new ArrayList(); } return l; @@ -342,13 +342,13 @@ public class listManager { * @param string list of comma separated Strings * @return resulting Set or empty Set if string is null */ - public static Set string2set(String string){ - HashSet set; + public static Set string2set(String string){ + HashSet set; if (string != null) { - set = new HashSet(Arrays.asList(string.split(","))); + set = new HashSet(Arrays.asList(string.split(","))); } else { - set = new HashSet(); + set = new HashSet(); } return set; @@ -361,13 +361,13 @@ public class listManager { * @param string list of comma separated Strings * @return resulting Vector or empty Vector if string is null */ - public static Vector string2vector(String string){ - Vector v; + public static Vector string2vector(String string){ + Vector v; if (string != null) { - v = new Vector(Arrays.asList(string.split(","))); + v = new Vector(Arrays.asList(string.split(","))); } else { - v = new Vector(); + v = new Vector(); } return v; @@ -382,7 +382,7 @@ public class listManager { String supportedBlacklistTypesStr = abstractURLPattern.BLACKLIST_TYPES_STRING; String[] supportedBlacklistTypes = supportedBlacklistTypesStr.split(","); - ArrayList blacklistFiles = new ArrayList(supportedBlacklistTypes.length); + ArrayList blacklistFiles = new ArrayList(supportedBlacklistTypes.length); for (int i=0; i < supportedBlacklistTypes.length; i++) { blacklistFile blFile = new blacklistFile( switchboard.getConfig( @@ -393,7 +393,7 @@ public class listManager { plasmaSwitchboard.urlBlacklist.clear(); plasmaSwitchboard.urlBlacklist.loadList( - (blacklistFile[])blacklistFiles.toArray(new blacklistFile[blacklistFiles.size()]), + blacklistFiles.toArray(new blacklistFile[blacklistFiles.size()]), "/"); // switchboard.urlBlacklist.clear(); diff --git a/source/de/anomic/data/messageBoard.java b/source/de/anomic/data/messageBoard.java index 9ddb65397..e24e0d722 100644 --- a/source/de/anomic/data/messageBoard.java +++ b/source/de/anomic/data/messageBoard.java @@ -47,7 +47,6 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import java.util.TimeZone; import de.anomic.kelondro.kelondroBase64Order; @@ -110,13 +109,13 @@ public class messageBoard { public class entry { String key; // composed by category and date - Map record; // contains author, target hash, subject and message + HashMap record; // contains author, target hash, subject and message public entry(String category, String authorName, String authorHash, String recName, String recHash, String subject, byte[] message) { - record = new HashMap(); + record = new HashMap(); key = category; if (key.length() > categoryLength) key = key.substring(0, categoryLength); while (key.length() < categoryLength) key += "_"; @@ -138,7 +137,7 @@ public class messageBoard { record.put("read", "false"); } - private entry(String key, Map record) { + private entry(String key, HashMap record) { this.key = key; this.record = record; } @@ -162,44 +161,44 @@ public class messageBoard { } public String author() { - String a = (String) record.get("author"); + String a = record.get("author"); if (a == null) return "anonymous"; return a; } public String recipient() { - String a = (String) record.get("recipient"); + String a = record.get("recipient"); if (a == null) return "anonymous"; return a; } public String authorHash() { - String a = (String) record.get("ahash"); + String a = record.get("ahash"); if (a == null) return null; return a; } public String recipientHash() { - String a = (String) record.get("rhash"); + String a = record.get("rhash"); if (a == null) return null; return a; } public String subject() { - String s = (String) record.get("subject"); + String s = record.get("subject"); if (s == null) return ""; return s; } public byte[] message() { - String m = (String) record.get("message"); + String m = record.get("message"); if (m == null) return new byte[0]; record.put("read", "true"); return kelondroBase64Order.enhancedCoder.decode(m, "de.anomic.data.messageBoard.message()"); } public boolean read() { - String r = (String) record.get("read"); + String r = record.get("read"); if (r == null) return false; if (r.equals("false")) return false; return true; @@ -217,7 +216,7 @@ public class messageBoard { } public entry read(String key) { - Map record = database.getMap(key); + HashMap record = database.getMap(key); return new entry(key, record); } @@ -228,14 +227,14 @@ public class messageBoard { } } - public Iterator keys(String category, boolean up) throws IOException { + public Iterator keys(String category, boolean up) throws IOException { //return database.keys(); return new catIter(category, up); } - public class catIter implements Iterator { + public class catIter implements Iterator { - Iterator allIter = null; + Iterator allIter = null; String nextKey = null; String category = ""; @@ -257,7 +256,7 @@ public class messageBoard { return nextKey != null; } - public Object next() { + public String next() { String next = nextKey; findNext(); return next; diff --git a/source/de/anomic/data/robotsParser.java b/source/de/anomic/data/robotsParser.java index 3dc260ff0..2882f5223 100644 --- a/source/de/anomic/data/robotsParser.java +++ b/source/de/anomic/data/robotsParser.java @@ -110,6 +110,7 @@ public final class robotsParser{ } } + @SuppressWarnings("unchecked") public static Object[] parse(byte[] robotsTxt) throws IOException { if ((robotsTxt == null)||(robotsTxt.length == 0)) return new Object[]{new ArrayList(0),null,null}; ByteArrayInputStream bin = new ByteArrayInputStream(robotsTxt); @@ -118,8 +119,8 @@ public final class robotsParser{ } public static Object[] parse(BufferedReader reader) throws IOException{ - ArrayList deny4AllAgents = new ArrayList(); - ArrayList deny4YaCyAgent = new ArrayList(); + ArrayList deny4AllAgents = new ArrayList(); + ArrayList deny4YaCyAgent = new ArrayList(); int pos; String line = null, lineUpper = null, sitemap = null; @@ -223,7 +224,7 @@ public final class robotsParser{ } } - ArrayList denyList = (rule4YaCyFound)?deny4YaCyAgent:deny4AllAgents; + ArrayList denyList = (rule4YaCyFound) ? deny4YaCyAgent : deny4AllAgents; return new Object[]{denyList,sitemap,crawlDelay}; } @@ -292,6 +293,7 @@ public final class robotsParser{ return crawlDelay; } + @SuppressWarnings("unchecked") public static boolean isDisallowed(yacyURL nexturl) { if (nexturl == null) throw new IllegalArgumentException(); @@ -341,17 +343,17 @@ public final class robotsParser{ } if ((robotsTxt4Host==null)||((robotsTxt4Host!=null)&&(result!=null))) { - ArrayList denyPath = null; + ArrayList denyPath = null; String sitemap = null; Integer crawlDelay = null; if (accessCompletelyRestricted) { - denyPath = new ArrayList(); + denyPath = new ArrayList(); denyPath.add("/"); } else { // parsing the robots.txt Data and converting it into an arraylist try { Object[] parserResult = robotsParser.parse(robotsTxt); - denyPath = (ArrayList) parserResult[0]; + denyPath = (ArrayList) parserResult[0]; sitemap = (String) parserResult[1]; crawlDelay = (Integer) parserResult[2]; } catch (IOException e) { diff --git a/source/de/anomic/data/translator.java b/source/de/anomic/data/translator.java index 5f7e461f1..02e5b065f 100644 --- a/source/de/anomic/data/translator.java +++ b/source/de/anomic/data/translator.java @@ -77,18 +77,18 @@ import de.anomic.tools.yFormatter; * Uses a Property like file with phrases or single words to translate a string or a file * */ public class translator { - public static String translate(String source, Hashtable translationList){ - Enumeration keys = translationList.keys(); + public static String translate(String source, Hashtable translationList){ + Enumeration keys = translationList.keys(); String result = source; String key = ""; while(keys.hasMoreElements()){ - key = (String)keys.nextElement(); + key = keys.nextElement(); Pattern pattern = Pattern.compile(key); Matcher matcher = pattern.matcher(result); - if(matcher.find()){ - result = matcher.replaceAll((String)translationList.get(key)); - }else{ - //Filename not availible, but it will be printed in Log + if (matcher.find()) { + result = matcher.replaceAll(translationList.get(key)); + } else { + //Filename not available, but it will be printed in Log //after all untranslated Strings as "Translated file: " serverLog.logFine("TRANSLATOR", "Unused String: "+key); } @@ -100,12 +100,12 @@ public class translator { * @param translationFile the File, which contains the Lists * @return a Hashtable, which contains for each File a Hashtable with translations. */ - public static Hashtable loadTranslationsLists(File translationFile){ - Hashtable lists = new Hashtable(); //list of translationLists for different files. - Hashtable translationList = new Hashtable(); //current Translation Table + public static Hashtable> loadTranslationsLists(File translationFile){ + Hashtable> lists = new Hashtable>(); //list of translationLists for different files. + Hashtable translationList = new Hashtable(); //current Translation Table - ArrayList list = listManager.getListArray(translationFile); - Iterator it = list.iterator(); + ArrayList list = listManager.getListArray(translationFile); + Iterator it = list.iterator(); String line = ""; String[] splitted; String forFile=""; @@ -128,9 +128,9 @@ public class translator { forFile=line.substring(6); } if(lists.containsKey(forFile)){ - translationList=(Hashtable) lists.get(forFile); + translationList=lists.get(forFile); }else{ - translationList=new Hashtable(); + translationList=new Hashtable(); } } } @@ -139,11 +139,11 @@ public class translator { } public static boolean translateFile(File sourceFile, File destFile, File translationFile){ - Hashtable translationList = (Hashtable)loadTranslationsLists(translationFile).get(sourceFile.getName()); + Hashtable translationList = loadTranslationsLists(translationFile).get(sourceFile.getName()); return translateFile(sourceFile, destFile, translationList); } - public static boolean translateFile(File sourceFile, File destFile, Hashtable translationList){ + public static boolean translateFile(File sourceFile, File destFile, Hashtable translationList){ String content = ""; String line = ""; @@ -176,16 +176,16 @@ public class translator { } public static boolean translateFiles(File sourceDir, File destDir, File baseDir, File translationFile, String extensions){ - Hashtable translationLists = loadTranslationsLists(translationFile); + Hashtable> translationLists = loadTranslationsLists(translationFile); return translateFiles(sourceDir, destDir, baseDir, translationLists, extensions); } - public static boolean translateFiles(File sourceDir, File destDir, File baseDir, Hashtable translationLists, String extensions){ + public static boolean translateFiles(File sourceDir, File destDir, File baseDir, Hashtable> translationLists, String extensions){ destDir.mkdirs(); File[] sourceFiles = sourceDir.listFiles(); - Vector exts=listManager.string2vector(extensions); + Vector exts=listManager.string2vector(extensions); boolean rightExtension; - Iterator it; + Iterator it; String relativePath; for(int i=0;i dirList=listManager.getDirsRecursive(sourceDir, notdir); dirList.add(sourceDir); - Iterator it=dirList.iterator(); + Iterator it=dirList.iterator(); File file=null; File file2=null; while(it.hasNext()){ - file=(File)it.next(); + file=it.next(); //cuts the sourcePath and prepends the destPath file2=new File(destDir, file.getPath().substring(sourceDir.getPath().length())); if(file.isDirectory() && !file.getName().equals(notdir)){ @@ -238,9 +238,9 @@ public class translator { return true; } - public static HashMap langMap(serverSwitch env) { + public static HashMap langMap(serverSwitch env) { String[] ms = env.getConfig("locale.lang", "").split(","); - HashMap map = new HashMap(); + HashMap map = new HashMap(); int p; for (int i = 0; i < ms.length; i++) { p = ms[i].indexOf("/"); diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java index 7dda0d24f..ec3989eee 100644 --- a/source/de/anomic/data/userDB.java +++ b/source/de/anomic/data/userDB.java @@ -71,8 +71,8 @@ public final class userDB { kelondroMapObjects userTable; private final File userTableFile; private long preloadTime; - private HashMap ipUsers = new HashMap(); - private HashMap cookieUsers = new HashMap(); + private HashMap ipUsers = new HashMap(); + private HashMap cookieUsers = new HashMap(); public userDB(File userTableFile, long preloadTime) { this.userTableFile = userTableFile; @@ -107,12 +107,12 @@ public final class userDB { if(userName.length()>128){ userName=userName.substring(0, 127); } - Map record = userTable.getMap(userName); + HashMap record = userTable.getMap(userName); if (record == null) return null; return new Entry(userName, record); } - public Entry createEntry(String userName, HashMap userProps) throws IllegalArgumentException{ + public Entry createEntry(String userName, HashMap userProps) throws IllegalArgumentException{ Entry entry = new Entry(userName,userProps); return entry; } @@ -200,7 +200,7 @@ public final class userDB { */ public Entry ipAuth(String ip) { if(this.ipUsers.containsKey(ip)){ - String user=(String)this.ipUsers.get(ip); + String user=this.ipUsers.get(ip); Entry entry=this.getEntry(user); Long entryTimestamp=entry.getLastAccess(); if(entryTimestamp == null || (System.currentTimeMillis()-entryTimestamp.longValue()) > (1000*60*10) ){ //no timestamp or older than 10 Minutes @@ -327,11 +327,11 @@ 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 Map mem; + private HashMap mem; private String userName; private Calendar oldDate, newDate; - public Entry(String userName, Map mem) throws IllegalArgumentException { + public Entry(String userName, HashMap mem) throws IllegalArgumentException { if ((userName == null) || (userName.length() == 0)) throw new IllegalArgumentException("Username needed."); if(userName.length()>128){ @@ -342,7 +342,7 @@ public final class userDB { if (this.userName.length() < USERNAME_MIN_LENGTH) throw new IllegalArgumentException("Username to short. Length should be >= " + USERNAME_MIN_LENGTH); - if (mem == null) this.mem = new HashMap(); + if (mem == null) this.mem = new HashMap(); else this.mem = mem; if (!mem.containsKey(AUTHENTICATION_METHOD))this.mem.put(AUTHENTICATION_METHOD,"yacy"); @@ -355,21 +355,21 @@ public final class userDB { } public String getFirstName() { - return (this.mem.containsKey(USER_FIRSTNAME)?(String)this.mem.get(USER_FIRSTNAME):null); + return (this.mem.containsKey(USER_FIRSTNAME)?this.mem.get(USER_FIRSTNAME):null); } public String getLastName() { - return (this.mem.containsKey(USER_LASTNAME)?(String)this.mem.get(USER_LASTNAME):null); + return (this.mem.containsKey(USER_LASTNAME)?this.mem.get(USER_LASTNAME):null); } public String getAddress() { - return (this.mem.containsKey(USER_ADDRESS)?(String)this.mem.get(USER_ADDRESS):null); + return (this.mem.containsKey(USER_ADDRESS)?this.mem.get(USER_ADDRESS):null); } public long getTimeUsed() { if (this.mem.containsKey(TIME_USED)) { try{ - return Long.valueOf((String)this.mem.get(TIME_USED)).longValue(); + return Long.valueOf(this.mem.get(TIME_USED)).longValue(); }catch(NumberFormatException e){ return 0; } @@ -383,7 +383,7 @@ public final class userDB { public long getTimeLimit() { if (this.mem.containsKey(TIME_LIMIT)) { try{ - return Long.valueOf((String)this.mem.get(TIME_LIMIT)).longValue(); + return Long.valueOf(this.mem.get(TIME_LIMIT)).longValue(); }catch(NumberFormatException e){ return 0; } @@ -396,7 +396,7 @@ public final class userDB { public long getTrafficSize() { if (this.mem.containsKey(TRAFFIC_SIZE)) { - return Long.valueOf((String)this.mem.get(TRAFFIC_SIZE)).longValue(); + return Long.valueOf(this.mem.get(TRAFFIC_SIZE)).longValue(); } try { this.setProperty(TRAFFIC_SIZE,"0"); @@ -407,7 +407,7 @@ public final class userDB { } public Long getTrafficLimit() { - return (this.mem.containsKey(TRAFFIC_LIMIT)?Long.valueOf((String)this.mem.get(TRAFFIC_LIMIT)):null); + return (this.mem.containsKey(TRAFFIC_LIMIT)?Long.valueOf(this.mem.get(TRAFFIC_LIMIT)):null); } public long updateTrafficSize(long responseSize) { @@ -424,7 +424,7 @@ public final class userDB { } public Long getLastAccess() { - return (this.mem.containsKey(LAST_ACCESS)?Long.valueOf((String)this.mem.get(LAST_ACCESS)):null); + return (this.mem.containsKey(LAST_ACCESS)?Long.valueOf(this.mem.get(LAST_ACCESS)):null); } public int surfRight(){ @@ -484,10 +484,10 @@ public final class userDB { } public String getMD5EncodedUserPwd() { - return (this.mem.containsKey(MD5ENCODED_USERPWD_STRING)?(String)this.mem.get(MD5ENCODED_USERPWD_STRING):null); + return (this.mem.containsKey(MD5ENCODED_USERPWD_STRING)?this.mem.get(MD5ENCODED_USERPWD_STRING):null); } - public Map getProperties() { + public Map getProperties() { return this.mem; } @@ -497,10 +497,10 @@ public final class userDB { } public String getProperty(String propName, String defaultValue) { - return (this.mem.containsKey(propName)?(String)this.mem.get(propName):defaultValue); + return (this.mem.containsKey(propName)?this.mem.get(propName):defaultValue); } public boolean hasRight(String rightName){ - return (this.mem.containsKey(rightName)?((String)this.mem.get(rightName)).equals("true"):false); + return (this.mem.containsKey(rightName)?this.mem.get(rightName).equals("true"):false); } /** * @deprecated use hasRight(UPLOAD_RIGHT) instead @@ -545,7 +545,7 @@ public final class userDB { return this.hasRight(BOOKMARK_RIGHT); } public boolean isLoggedOut(){ - return (this.mem.containsKey(LOGGED_OUT)?((String)this.mem.get(LOGGED_OUT)).equals("true"):false); + return (this.mem.containsKey(LOGGED_OUT)?this.mem.get(LOGGED_OUT).equals("true"):false); } public void logout(String ip, String logintoken){ logout(ip); @@ -578,19 +578,19 @@ public final class userDB { } - public Iterator iterator(boolean up) { + public Iterator iterator(boolean up) { // enumerates users try { return new userIterator(up); } catch (IOException e) { - return new HashSet().iterator(); + return new HashSet().iterator(); } } - public class userIterator implements Iterator { + public class userIterator implements Iterator { // the iterator iterates all userNames - kelondroCloneableIterator userIter; + kelondroCloneableIterator userIter; userDB.Entry nextEntry; public userIterator(boolean up) throws IOException { @@ -605,7 +605,7 @@ public final class userDB { return false; } } - public Object next() { + public Entry next() { try { return getEntry((String) this.userIter.next()); } catch (kelondroException e) { diff --git a/source/de/anomic/data/wikiBoard.java b/source/de/anomic/data/wikiBoard.java index 574132667..1f31a0df0 100644 --- a/source/de/anomic/data/wikiBoard.java +++ b/source/de/anomic/data/wikiBoard.java @@ -47,7 +47,6 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import java.util.TimeZone; import de.anomic.kelondro.kelondroBase64Order; @@ -69,7 +68,7 @@ public class wikiBoard { private kelondroMapObjects datbase = null; private kelondroMapObjects bkpbase = null; - private static HashMap authors = new HashMap(); + private static HashMap authors = new HashMap(); public wikiBoard(File actpath, File bkppath, long preloadTime) { new File(actpath.getParent()).mkdirs(); @@ -120,7 +119,7 @@ public class wikiBoard { } public static String guessAuthor(String ip) { - String author = (String) authors.get(ip); + String author = authors.get(ip); //yacyCore.log.logDebug("DEBUG: guessing author for ip = " + ip + " is '" + author + "', authors = " + authors.toString()); return author; } @@ -136,10 +135,10 @@ public class wikiBoard { public class entry { String key; - Map record; + HashMap record; public entry(String subject, String author, String ip, String reason, byte[] page) throws IOException { - record = new HashMap(); + record = new HashMap(); key = subject; if (key.length() > keyLength) key = key.substring(0, keyLength); record.put("date", dateString()); @@ -157,7 +156,7 @@ public class wikiBoard { //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString()); } - private entry(String key, Map record) { + private entry(String key, HashMap record) { this.key = key; this.record = record; } @@ -168,7 +167,7 @@ public class wikiBoard { public Date date() { try { - String c = (String) record.get("date"); + String c = record.get("date"); if (c == null) { System.out.println("DEBUG - ERROR: date field missing in wikiBoard"); return new Date(); @@ -182,7 +181,7 @@ public class wikiBoard { } public String author() { - String a = (String) record.get("author"); + String a = record.get("author"); if (a == null) return "anonymous"; byte[] b = kelondroBase64Order.enhancedCoder.decode(a, "de.anomic.data.wikiBoard.author()"); if (b == null) return "anonymous"; @@ -190,7 +189,7 @@ public class wikiBoard { } public String reason() { - String r = (String) record.get("reason"); + String r = record.get("reason"); if (r == null) return ""; byte[] b = kelondroBase64Order.enhancedCoder.decode(r, "de.anomic.data.wikiBoard.reason()"); if (b == null) return "unknown"; @@ -198,7 +197,7 @@ public class wikiBoard { } public byte[] page() { - String m = (String) record.get("page"); + String m = record.get("page"); if (m == null) return new byte[0]; byte[] b = kelondroBase64Order.enhancedCoder.decode(m, "de.anomic.data.wikiBoard.page()"); if (b == null) return "".getBytes(); @@ -211,7 +210,7 @@ public class wikiBoard { private Date getAncestorDate() { try { - String c = (String) record.get("date"); + String c = record.get("date"); if (c == null) return null; synchronized (SimpleFormatter) { return SimpleFormatter.parse(c); @@ -244,7 +243,7 @@ public class wikiBoard { } private String getChildName() { - String c = (String) record.get("child"); + String c = record.get("child"); if (c == null) return null; byte[] subject = kelondroBase64Order.enhancedCoder.decode(c, "de.anomic.data.wikiBoard.getChildName()"); if (subject == null) return null; @@ -252,7 +251,7 @@ public class wikiBoard { } public boolean hasChild() { - String c = (String) record.get("child"); + String c = record.get("child"); if (c == null) return false; byte[] subject = kelondroBase64Order.enhancedCoder.decode(c, "de.anomic.data.wikiBoard.hasChild()"); return (subject != null); @@ -295,7 +294,7 @@ public class wikiBoard { try { key = normalize(key); if (key.length() > keyLength) key = key.substring(0, keyLength); - Map record = base.getMap(key); + HashMap record = base.getMap(key); if (record == null) return newEntry(key, "anonymous", "127.0.0.1", "New Page", "".getBytes()); return new entry(key, record); } catch (IOException e) { @@ -317,11 +316,11 @@ public class wikiBoard { } */ - public Iterator keys(boolean up) throws IOException { + public Iterator keys(boolean up) throws IOException { return datbase.keys(up, false); } - public Iterator keysBkp(boolean up) throws IOException { + public Iterator keysBkp(boolean up) throws IOException { return bkpbase.keys(up, false); } } diff --git a/source/de/anomic/data/wikiCode.java b/source/de/anomic/data/wikiCode.java index 4da3b6d94..16714c86e 100644 --- a/source/de/anomic/data/wikiCode.java +++ b/source/de/anomic/data/wikiCode.java @@ -64,7 +64,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser { /* Table properties */ private static final String[] tps = { "rowspan", "colspan", "vspace", "hspace", "cellspacing", "cellpadding", "border" }; - private static final HashMap/* */ ps = new HashMap(); + private static final HashMap/* */ ps = new HashMap(); static { Arrays.sort(tps); String[] array; @@ -95,7 +95,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser { private int preindented = 0; //needed for indented
s
     private int escindented = 0;                //needed for indented [=s
     private int headlines = 0;                  //number of headlines in page
-    private ArrayList dirElements = new ArrayList();    //list of headlines used to create diectory of page
+    private ArrayList dirElements = new ArrayList();    //list of headlines used to create diectory of page
 
     /** Constructor of the class wikiCode */
     public wikiCode(plasmaSwitchboard switchboard){
@@ -221,7 +221,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                         (key.equals("summary")) ||
                         (key.equals("bgcolor") && value.matches("#{0,1}[0-9a-fA-F]{1,6}|[a-zA-Z]{3,}")) ||
                         ((key.equals("width") || key.equals("height")) && value.matches("\\d+%{0,1}")) ||
-                        ((posVals = (String[])ps.get(key)) != null && Arrays.binarySearch(posVals, value) >= 0) ||
+                        ((posVals = ps.get(key)) != null && Arrays.binarySearch(posVals, value) >= 0) ||
                         (Arrays.binarySearch(tps, key) >= 0 && value.matches("\\d+"))
                 ) {
                     addPair(key, value, sb);
diff --git a/source/de/anomic/http/httpHeader.java b/source/de/anomic/http/httpHeader.java
index fd88932d4..76e7da5a5 100644
--- a/source/de/anomic/http/httpHeader.java
+++ b/source/de/anomic/http/httpHeader.java
@@ -265,7 +265,7 @@ public final class httpHeader extends TreeMap implements Map reverseMappingCache) {
-        // this creates a new TreeMap with a case insesitive mapping
+        // this creates a new TreeMap with a case insensitive mapping
         // to provide a put-method that translates given keys into their
         // 'proper' appearance, a translation cache is needed.
         // upon instantiation, such a mapping cache can be handed over
diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.java
index 118afb30f..be22d5c89 100644
--- a/source/de/anomic/http/httpTemplate.java
+++ b/source/de/anomic/http/httpTemplate.java
@@ -59,7 +59,6 @@ import java.io.PushbackInputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 
 import de.anomic.server.serverByteBuffer;
@@ -229,14 +228,14 @@ public final class httpTemplate {
         return false;
     }
 
-    public static void writeTemplate(InputStream in, OutputStream out, Hashtable pattern, byte[] dflt) throws IOException {
+    public static void writeTemplate(InputStream in, OutputStream out, HashMap pattern, byte[] dflt) throws IOException {
         writeTemplate(in, out, pattern, dflt, new byte[0]);
     }
 
     /**
      * Reads a input stream, and writes the data with replaced templates on a output stream
      */
-    public static byte[] writeTemplate(InputStream in, OutputStream out, Hashtable pattern, byte[] dflt, byte[] prefix) throws IOException {
+    public static byte[] writeTemplate(InputStream in, OutputStream out, HashMap pattern, byte[] dflt, byte[] prefix) throws IOException {
         PushbackInputStream pis = new PushbackInputStream(in, 100);
         ByteArrayOutputStream keyStream;
         byte[] key;
@@ -487,7 +486,7 @@ public final class httpTemplate {
         return structure.getBytes();
     }
 
-    public static byte[] replacePattern(String key, Hashtable pattern, byte dflt[]) {
+    public static byte[] replacePattern(String key, HashMap pattern, byte dflt[]) {
         byte[] replacement;
         Object value;
         if (pattern.containsKey(key)) {
@@ -515,7 +514,7 @@ public final class httpTemplate {
         // arg1 = test input; arg2 = replacement for pattern 'test'; arg3 = default replacement
         try {
             InputStream i = new ByteArrayInputStream(args[0].getBytes());
-            Hashtable h = new Hashtable();
+            HashMap h = new HashMap();
             h.put("test", args[1]);
             writeTemplate(new PushbackInputStream(i, 100), System.out, h, args[2].getBytes());
             System.out.flush();
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java
index 73ded67d9..0c17920d8 100644
--- a/source/de/anomic/http/httpc.java
+++ b/source/de/anomic/http/httpc.java
@@ -61,7 +61,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Date;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -835,13 +834,13 @@ public final class httpc {
         if (args.size() != 0) {
             // we have values for the POST, start with one boundary
             String key, value;
-            Enumeration e = args.keys();
-            while (e.hasMoreElements()) {
+            Iterator e = args.keySet().iterator();
+            while (e.hasNext()) {
                 // start with a boundary
                 out.write(boundary.getBytes("UTF-8"));
                 out.write(serverCore.CRLF);
                 // write value
-                key = (String) e.nextElement();
+                key = e.next();
                 value = args.get(key, "");
                 if ((files != null) && (files.containsKey(key))) {
                     // we are about to write a file
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java
index 4c90d83af..a16abdaab 100644
--- a/source/de/anomic/http/httpdFileHandler.java
+++ b/source/de/anomic/http/httpdFileHandler.java
@@ -90,7 +90,6 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URLDecoder;
 import java.util.Date;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -394,10 +393,10 @@ public final class httpdFileHandler {
             // check for cross site scripting - attacks in request arguments
             if (argc > 0) {
                 // check all values for occurrences of script values
-                Enumeration e = args.elements(); // enumeration of values
+                Iterator e = args.values().iterator(); // enumeration of values
                 String val;
-                while (e.hasMoreElements()) {
-                    val = e.nextElement();
+                while (e.hasNext()) {
+                    val = e.next();
                     if ((val != null) && (val.indexOf("= 0)) {
                         // deny request
                         httpd.sendRespondError(conProp,out,4,403,null,"bad post values",null);
diff --git a/source/de/anomic/kelondro/kelondroAbstractRA.java b/source/de/anomic/kelondro/kelondroAbstractRA.java
index aab3df449..1bea5439f 100644
--- a/source/de/anomic/kelondro/kelondroAbstractRA.java
+++ b/source/de/anomic/kelondro/kelondroAbstractRA.java
@@ -49,9 +49,9 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.TreeMap;
 
 import de.anomic.server.serverByteBuffer;
 
@@ -213,11 +213,11 @@ abstract class kelondroAbstractRA implements kelondroRA {
         write(bb.getBytes());
     }
 
-    public Map readMap() throws IOException {
+    public HashMap readMap() throws IOException {
         this.seek(0);
         byte[] b = readFully();
         BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(b)));
-        final TreeMap map = new TreeMap();
+        final HashMap map = new HashMap();
         String line;
         int pos;
         while ((line = br.readLine()) != null) { // very slow readLine????
diff --git a/source/de/anomic/kelondro/kelondroMapObjects.java b/source/de/anomic/kelondro/kelondroMapObjects.java
index 1b9c24a33..650e5b8af 100644
--- a/source/de/anomic/kelondro/kelondroMapObjects.java
+++ b/source/de/anomic/kelondro/kelondroMapObjects.java
@@ -172,7 +172,7 @@ public class kelondroMapObjects extends kelondroObjects {
         this.elementCount = 0;
     }
     
-    public synchronized void set(String key, Map newMap) throws IOException {
+    public synchronized void set(String key, HashMap newMap) throws IOException {
         assert (key != null);
         assert (key.length() > 0);
         assert (newMap != null);
@@ -267,7 +267,7 @@ public class kelondroMapObjects extends kelondroObjects {
         super.remove(key);
     }
     
-    public Map getMap(String key) {
+    public HashMap getMap(String key) {
         try {
             kelondroObjectsMapEntry mapEntry = (kelondroObjectsMapEntry) super.get(key);
             if (mapEntry == null) return null;
@@ -347,7 +347,7 @@ public class kelondroMapObjects extends kelondroObjects {
         super.close();
     }
     
-    public class mapIterator implements Iterator> {
+    public class mapIterator implements Iterator> {
         // enumerates Map-Type elements
         // the key is also included in every map that is returned; it's key is 'key'
 
@@ -363,9 +363,9 @@ public class kelondroMapObjects extends kelondroObjects {
             return (!(finish)) && (keyIterator != null) && (keyIterator.hasNext());
         }
 
-        public Map next() {
+        public HashMap next() {
             String nextKey;
-            Map map;
+            HashMap map;
             while (keyIterator.hasNext()) {
                 nextKey = keyIterator.next();
                 if (nextKey == null) {
diff --git a/source/de/anomic/kelondro/kelondroMapTable.java b/source/de/anomic/kelondro/kelondroMapTable.java
index 7d0bbe00f..89895cdf7 100644
--- a/source/de/anomic/kelondro/kelondroMapTable.java
+++ b/source/de/anomic/kelondro/kelondroMapTable.java
@@ -97,7 +97,7 @@ public class kelondroMapTable {
         tTables.put(tablename, Tree);
     }
 
-    public synchronized void update(String tablename, String key, Map map) throws IOException {
+    public synchronized void update(String tablename, String key, HashMap map) throws IOException {
         kelondroMapObjects table = (kelondroMapObjects) mTables.get(tablename);
         if (table == null) throw new RuntimeException("kelondroTables.update: map table '" + tablename + "' does not exist.");
         if (key.length() > table.keySize()) key = key.substring(0, table.keySize());
diff --git a/source/de/anomic/kelondro/kelondroObjectsMapEntry.java b/source/de/anomic/kelondro/kelondroObjectsMapEntry.java
index 9e2849139..0b6b33101 100644
--- a/source/de/anomic/kelondro/kelondroObjectsMapEntry.java
+++ b/source/de/anomic/kelondro/kelondroObjectsMapEntry.java
@@ -29,17 +29,16 @@ package de.anomic.kelondro;
 
 import java.io.IOException;
 import java.util.HashMap;
-import java.util.Map;
 
 public class kelondroObjectsMapEntry implements kelondroObjectsEntry {
 
-    protected Map entry;
+    protected HashMap entry;
     
     public kelondroObjectsMapEntry() {
         this.entry = new HashMap();
     }
     
-    public kelondroObjectsMapEntry(Map map) {
+    public kelondroObjectsMapEntry(HashMap map) {
         this.entry = map;
     }
     
@@ -63,7 +62,7 @@ public class kelondroObjectsMapEntry implements kelondroObjectsEntry {
         }
     }
     
-    public Map map() {
+    public HashMap map() {
         return this.entry;
     }
 
diff --git a/source/de/anomic/kelondro/kelondroRA.java b/source/de/anomic/kelondro/kelondroRA.java
index e7eb06722..3b045220b 100644
--- a/source/de/anomic/kelondro/kelondroRA.java
+++ b/source/de/anomic/kelondro/kelondroRA.java
@@ -51,6 +51,7 @@
 package de.anomic.kelondro;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 
 public interface kelondroRA {
@@ -92,7 +93,7 @@ public interface kelondroRA {
     public String readLine() throws IOException;
 
     public void writeMap(Map props, String comment) throws IOException;
-    public Map readMap() throws IOException;
+    public HashMap readMap() throws IOException;
 
     public void writeArray(byte[] b) throws IOException;
     public byte[] readArray() throws IOException;
diff --git a/source/de/anomic/plasma/cache/IResourceInfo.java b/source/de/anomic/plasma/cache/IResourceInfo.java
index d33bae533..b15ed2d78 100644
--- a/source/de/anomic/plasma/cache/IResourceInfo.java
+++ b/source/de/anomic/plasma/cache/IResourceInfo.java
@@ -49,7 +49,7 @@
 package de.anomic.plasma.cache;
 
 import java.util.Date;
-import java.util.Map;
+import java.util.TreeMap;
 
 import de.anomic.yacy.yacyURL;
 
@@ -61,7 +61,7 @@ public interface IResourceInfo {
     /**
      * @return the resource information
      */
-    public Map getMap();
+    public TreeMap getMap();
     
     /**
      * @return the URL of this content
diff --git a/source/de/anomic/plasma/cache/ftp/ResourceInfo.java b/source/de/anomic/plasma/cache/ftp/ResourceInfo.java
index 5ee849eaf..11e741246 100644
--- a/source/de/anomic/plasma/cache/ftp/ResourceInfo.java
+++ b/source/de/anomic/plasma/cache/ftp/ResourceInfo.java
@@ -47,8 +47,8 @@
 package de.anomic.plasma.cache.ftp;
 
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
 
 import de.anomic.plasma.cache.IResourceInfo;
 import de.anomic.plasma.cache.ResourceInfoFactory;
@@ -60,7 +60,7 @@ public class ResourceInfo implements IResourceInfo {
     public static final String MODIFICATION_DATE = "modificationDate";
     
     private yacyURL objectURL, refererURL;
-    private HashMap propertyMap; 
+    private TreeMap propertyMap; 
     
     /**
      * Constructor used by the {@link ResourceInfoFactory}
@@ -76,7 +76,7 @@ public class ResourceInfo implements IResourceInfo {
         this.refererURL = null;
         
         // create the http header object
-        this.propertyMap =  new HashMap(objectInfo);
+        this.propertyMap =  new TreeMap(objectInfo);
     }    
     
     public ResourceInfo(yacyURL objectURL, yacyURL refererUrl, String mimeType, Date fileDate) {
@@ -86,7 +86,7 @@ public class ResourceInfo implements IResourceInfo {
         this.objectURL = objectURL;
         
         // create the http header object
-        this.propertyMap =  new HashMap();
+        this.propertyMap =  new TreeMap();
         if (refererUrl != null) 
             this.refererURL = refererUrl;
         if (mimeType != null) 
@@ -95,7 +95,7 @@ public class ResourceInfo implements IResourceInfo {
             this.propertyMap.put(MODIFICATION_DATE, Long.toString(fileDate.getTime()));
     }
     
-    public Map getMap() {
+    public TreeMap getMap() {
         return this.propertyMap;
     }
 
diff --git a/source/de/anomic/plasma/cache/http/ResourceInfo.java b/source/de/anomic/plasma/cache/http/ResourceInfo.java
index 963fa37db..54d408f80 100644
--- a/source/de/anomic/plasma/cache/http/ResourceInfo.java
+++ b/source/de/anomic/plasma/cache/http/ResourceInfo.java
@@ -50,6 +50,7 @@ package de.anomic.plasma.cache.http;
 
 import java.util.Date;
 import java.util.Map;
+import java.util.TreeMap;
 
 import de.anomic.http.httpHeader;
 import de.anomic.plasma.plasmaHTCache;
@@ -90,7 +91,7 @@ public class ResourceInfo implements IResourceInfo {
         this.responseHeader = responseHeaders;
     }
     
-    public Map getMap() {
+    public TreeMap getMap() {
         return this.responseHeader;
     }
     
diff --git a/source/de/anomic/plasma/dbImport/AbstractImporter.java b/source/de/anomic/plasma/dbImport/AbstractImporter.java
index eead33e16..f4fd13948 100644
--- a/source/de/anomic/plasma/dbImport/AbstractImporter.java
+++ b/source/de/anomic/plasma/dbImport/AbstractImporter.java
@@ -37,7 +37,7 @@ public abstract class AbstractImporter extends Thread implements dbImporter{
     /**
      * @see dbImporter#init(HashMap)
      */
-    public void init(HashMap initparams) throws ImporterException {
+    public void init(HashMap initparams) throws ImporterException {
         // initializing the logger and setting a more verbose thread name
         this.log = new serverLog("IMPORT_" + this.jobType + "_" + this.jobID);
         this.setName("IMPORT_" + this.jobType + "_" + this.jobID);
diff --git a/source/de/anomic/plasma/dbImport/SitemapImporter.java b/source/de/anomic/plasma/dbImport/SitemapImporter.java
index 945bbbef8..65eceaeda 100644
--- a/source/de/anomic/plasma/dbImport/SitemapImporter.java
+++ b/source/de/anomic/plasma/dbImport/SitemapImporter.java
@@ -101,7 +101,7 @@ public class SitemapImporter extends AbstractImporter implements dbImporter {
 	 * @see dbImporter#init(HashMap)
 	 * @see AbstractImporter#init(HashMap)
 	 */
-	public void init(HashMap initParams) throws ImporterException {
+	public void init(HashMap initParams) throws ImporterException {
         super.init(initParams);
         
         if (initParams == null || initParams.size() == 0) throw new IllegalArgumentException("Init parameters are missing");
diff --git a/source/de/anomic/plasma/dbImport/dbImportManager.java b/source/de/anomic/plasma/dbImport/dbImportManager.java
index 542bfe0ac..12bbe231f 100644
--- a/source/de/anomic/plasma/dbImport/dbImportManager.java
+++ b/source/de/anomic/plasma/dbImport/dbImportManager.java
@@ -7,7 +7,7 @@ import de.anomic.server.logging.serverLog;
 
 public class dbImportManager {
 
-    public final Vector finishedJobs = new Vector();
+    public final Vector finishedJobs = new Vector();
     public final ThreadGroup runningJobs = new ThreadGroup("ImporterThreads");
     public  int currMaxJobNr = 0;
     private plasmaSwitchboard sb;
diff --git a/source/de/anomic/plasma/dbImport/dbImporter.java b/source/de/anomic/plasma/dbImport/dbImporter.java
index 708cae188..1b44e0b09 100644
--- a/source/de/anomic/plasma/dbImport/dbImporter.java
+++ b/source/de/anomic/plasma/dbImport/dbImporter.java
@@ -25,6 +25,6 @@ public interface dbImporter {
     public String getError();
     public String getStatus();    
     //public void init(File plasmaPath, File indexPrimaryPath, File indexSecondaryPath, int cacheSize, long preloadTime);
-    public void init(HashMap initParams) throws ImporterException;
+    public void init(HashMap initParams) throws ImporterException;
     public void startIt();    
 }
diff --git a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
index 728b97fec..856f6a70b 100644
--- a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
+++ b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
@@ -5,7 +5,6 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.TreeMap;
 
 import de.anomic.plasma.plasmaCrawlEntry;
 import de.anomic.plasma.plasmaCrawlNURL;
@@ -47,7 +46,7 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor
         return theStatus.toString();
     }
 
-    public void init(HashMap initParams) throws ImporterException {
+    public void init(HashMap initParams) throws ImporterException {
         super.init(initParams);
         
         if (initParams == null || initParams.size() == 0) throw new IllegalArgumentException("Init parameters are missing");
@@ -110,6 +109,7 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor
         this.importProfileDB = new plasmaCrawlProfile(profileDbFile, 300);
     }
 
+    @SuppressWarnings("unchecked")
     public void run() {
         try {   
             // waiting on init thread to finish
@@ -178,7 +178,7 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor
                                 if (sourceEntry != null) {
                                     this.profileCount++;
                                     this.importProfileHandleCache.add(profileHandle);
-                                    this.sb.profilesActiveCrawls.newEntry((TreeMap)((TreeMap)sourceEntry.map()).clone());
+                                    this.sb.profilesActiveCrawls.newEntry((HashMap) sourceEntry.map().clone());
                                 } else {
                                     this.log.logWarning("Profile '" + profileHandle + "' of url entry '" + nextHash + "' unknown.");
                                     continue;
diff --git a/source/de/anomic/plasma/dbImport/plasmaDbImporter.java b/source/de/anomic/plasma/dbImport/plasmaDbImporter.java
index 74d383566..77c4462dd 100644
--- a/source/de/anomic/plasma/dbImport/plasmaDbImporter.java
+++ b/source/de/anomic/plasma/dbImport/plasmaDbImporter.java
@@ -8,8 +8,8 @@ import java.util.TreeSet;
 
 import de.anomic.index.indexContainer;
 import de.anomic.index.indexRWIEntry;
+import de.anomic.index.indexRWIRowEntry;
 import de.anomic.index.indexURLEntry;
-import de.anomic.kelondro.kelondroNaturalOrder;
 import de.anomic.plasma.plasmaSwitchboard;
 import de.anomic.plasma.plasmaWordIndex;
 import de.anomic.server.serverDate;
@@ -69,7 +69,7 @@ public class plasmaDbImporter extends AbstractImporter implements dbImporter {
      * @throws ImporterException 
      * @see dbImporter#init(HashMap)
      */
-    public void init(HashMap initParams) throws ImporterException {
+    public void init(HashMap initParams) throws ImporterException {
         super.init(initParams);
         
         if (initParams == null || initParams.size() == 0) throw new IllegalArgumentException("Init parameters are missing");
@@ -147,15 +147,15 @@ public class plasmaDbImporter extends AbstractImporter implements dbImporter {
             this.log.logInfo("Home word index contains " + homeWordIndex.size() + " words and " + homeWordIndex.loadedURL.size() + " URLs.");
             this.log.logInfo("Import word index contains " + this.importWordIndex.size() + " words and " + this.importWordIndex.loadedURL.size() + " URLs.");                        
             
-            HashSet unknownUrlBuffer = new HashSet();
-            HashSet importedUrlBuffer = new HashSet();
+            HashSet unknownUrlBuffer = new HashSet();
+            HashSet importedUrlBuffer = new HashSet();
 			
             // iterate over all words from import db
             //Iterator importWordHashIterator = this.importWordIndex.wordHashes(this.wordChunkStartHash, plasmaWordIndex.RL_WORDFILES, false);
-            Iterator indexContainerIterator = this.importWordIndex.indexContainerSet(this.wordChunkStartHash, false, false, 100).iterator();
+            Iterator indexContainerIterator = this.importWordIndex.indexContainerSet(this.wordChunkStartHash, false, false, 100).iterator();
             while (!isAborted() && indexContainerIterator.hasNext()) {
                 
-                TreeSet entityUrls = new TreeSet(new kelondroNaturalOrder(true));
+                TreeSet entityUrls = new TreeSet();
                 indexContainer newContainer = null;
                 try {
                     this.wordCounter++;
@@ -164,7 +164,7 @@ public class plasmaDbImporter extends AbstractImporter implements dbImporter {
                     
                     // loop throug the entities of the container and get the
                     // urlhash
-                    Iterator importWordIdxEntries = newContainer.entries();
+                    Iterator importWordIdxEntries = newContainer.entries();
                     indexRWIEntry importWordIdxEntry;
                     while (importWordIdxEntries.hasNext()) {
                         // testing if import process was aborted
@@ -176,10 +176,10 @@ public class plasmaDbImporter extends AbstractImporter implements dbImporter {
                         entityUrls.add(urlHash);
                     }
 
-                    Iterator urlIter = entityUrls.iterator();
+                    Iterator urlIter = entityUrls.iterator();
                     while (urlIter.hasNext()) {	
                         if (isAborted()) break;
-                        String urlHash = (String) urlIter.next();
+                        String urlHash = urlIter.next();
 
                         if (importedUrlBuffer.contains(urlHash)) {
                             // already known url
@@ -253,7 +253,7 @@ public class plasmaDbImporter extends AbstractImporter implements dbImporter {
 
                 if (!indexContainerIterator.hasNext()) {
                     // We may not be finished yet, try to get the next chunk of wordHashes
-                    TreeSet containers = this.importWordIndex.indexContainerSet(this.wordHash, false, false, 100);
+                    TreeSet containers = this.importWordIndex.indexContainerSet(this.wordHash, false, false, 100);
                     indexContainerIterator = containers.iterator();
                     // Make sure we don't get the same wordhash twice, but don't skip a word
                     if ((indexContainerIterator.hasNext())&&(!this.wordHash.equals(((indexContainer) indexContainerIterator.next()).getWordHash()))) {
diff --git a/source/de/anomic/plasma/parser/bzip/bzipParser.java b/source/de/anomic/plasma/parser/bzip/bzipParser.java
index 747d2ad64..a1089c8c4 100644
--- a/source/de/anomic/plasma/parser/bzip/bzipParser.java
+++ b/source/de/anomic/plasma/parser/bzip/bzipParser.java
@@ -84,7 +84,7 @@ public class bzipParser extends AbstractParser implements Parser {
         this.parserName = "Bzip 2 UNIX Compressed File Parser";
     }
     
-    public Hashtable getSupportedMimeTypes() {
+    public Hashtable getSupportedMimeTypes() {
         return SUPPORTED_MIME_TYPES;
     }
     
diff --git a/source/de/anomic/plasma/parser/doc/docParser.java b/source/de/anomic/plasma/parser/doc/docParser.java
index a3ef93d30..3d047cd32 100644
--- a/source/de/anomic/plasma/parser/doc/docParser.java
+++ b/source/de/anomic/plasma/parser/doc/docParser.java
@@ -110,7 +110,7 @@ public class docParser extends AbstractParser implements Parser {
 		}        
 	}
 
-	public java.util.Hashtable getSupportedMimeTypes() {
+	public java.util.Hashtable getSupportedMimeTypes() {
 		return docParser.SUPPORTED_MIME_TYPES;
 	}
 
diff --git a/source/de/anomic/plasma/parser/gzip/gzipParser.java b/source/de/anomic/plasma/parser/gzip/gzipParser.java
index 085e95598..f914e76fc 100644
--- a/source/de/anomic/plasma/parser/gzip/gzipParser.java
+++ b/source/de/anomic/plasma/parser/gzip/gzipParser.java
@@ -79,7 +79,7 @@ public class gzipParser extends AbstractParser implements Parser {
         this.parserName = "GNU Zip Compressed Archive Parser";
     }
     
-    public Hashtable getSupportedMimeTypes() {
+    public Hashtable getSupportedMimeTypes() {
         return SUPPORTED_MIME_TYPES;
     }
     
diff --git a/source/de/anomic/plasma/parser/mimeType/mimeTypeParser.java b/source/de/anomic/plasma/parser/mimeType/mimeTypeParser.java
index 4b4417f24..b234262b1 100644
--- a/source/de/anomic/plasma/parser/mimeType/mimeTypeParser.java
+++ b/source/de/anomic/plasma/parser/mimeType/mimeTypeParser.java
@@ -103,6 +103,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
         this.parserName = "MimeType Parser"; 
     }
     
+    @SuppressWarnings("unchecked")
     public String getMimeType (File sourceFile) {
         String mimeType = null;
         
@@ -111,9 +112,9 @@ public class mimeTypeParser extends AbstractParser implements Parser {
             
             // if a match was found we can return the new mimeType
             if (match!=null) {
-                Collection subMatches = match.getSubMatches();
+                Collection subMatches = match.getSubMatches();
                 if ((subMatches != null) && (!subMatches.isEmpty())) {
-                    mimeType = ((MagicMatch) subMatches.iterator().next()).getMimeType();
+                    mimeType = subMatches.iterator().next().getMimeType();
                 } else {
                     mimeType = match.getMimeType();
                 }
@@ -125,6 +126,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
         return null;        
     }
     
+    @SuppressWarnings("unchecked")
     public plasmaParserDocument parse(yacyURL location, String mimeType, String charset, File sourceFile) throws ParserException, InterruptedException {
         
         String orgMimeType = mimeType;
@@ -134,7 +136,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
             // adding current thread to loop detection list
             Integer loopDepth = null;
             if (threadLoopDetection.containsKey(Thread.currentThread())) {
-                loopDepth = (Integer) threadLoopDetection.get(Thread.currentThread());                
+                loopDepth = threadLoopDetection.get(Thread.currentThread());                
             } else {
                 loopDepth = new Integer(0);
             }
@@ -149,9 +151,9 @@ public class mimeTypeParser extends AbstractParser implements Parser {
             
             // if a match was found we can return the new mimeType
             if (match!=null) {
-                Collection subMatches = match.getSubMatches();
+                Collection subMatches = match.getSubMatches();
                 if ((subMatches != null) && (!subMatches.isEmpty())) {
-                    mimeType = ((MagicMatch) subMatches.iterator().next()).getMimeType();
+                    mimeType = subMatches.iterator().next().getMimeType();
                     if ((mimeType == null)||(mimeType.length() == 0)) mimeType = match.getMimeType();
                 } else {
                     mimeType = match.getMimeType();
@@ -177,7 +179,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
             
             throw new ParserException("Unexpected error while detect mimetype of resource. " + e.getMessage(),location); 
         } finally {
-            Integer loopDepth = (Integer) threadLoopDetection.get(Thread.currentThread());                
+            Integer loopDepth = threadLoopDetection.get(Thread.currentThread());                
             if (loopDepth.intValue() <= 1) {
                 threadLoopDetection.remove(Thread.currentThread());
             } else {
@@ -200,7 +202,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
         
     }
     
-    public java.util.Hashtable getSupportedMimeTypes() {
+    public java.util.Hashtable getSupportedMimeTypes() {
         return mimeTypeParser.SUPPORTED_MIME_TYPES;
     }
     
diff --git a/source/de/anomic/plasma/parser/mimeType/odtDetector.java b/source/de/anomic/plasma/parser/mimeType/odtDetector.java
index 1b709ce38..fecc9239d 100644
--- a/source/de/anomic/plasma/parser/mimeType/odtDetector.java
+++ b/source/de/anomic/plasma/parser/mimeType/odtDetector.java
@@ -76,6 +76,7 @@ public class odtDetector implements MagicDetector {
         return "0.1";
     }
 
+    @SuppressWarnings("unchecked")
     public String[] process(byte[] data, int offset, int length, long bitmask, char comparator, String mimeType, Map params) {
         File dstFile = null;
         try {
@@ -89,6 +90,7 @@ public class odtDetector implements MagicDetector {
         }
     }
 
+    @SuppressWarnings("unchecked")
     public String[] process(File file, int offset, int length, long bitmask, char comparator, String mimeType, Map params) {
         try {
             // opening the zip file
diff --git a/source/de/anomic/plasma/parser/mimeType/rssDetector.java b/source/de/anomic/plasma/parser/mimeType/rssDetector.java
index 6fef8041e..54ebf1e74 100644
--- a/source/de/anomic/plasma/parser/mimeType/rssDetector.java
+++ b/source/de/anomic/plasma/parser/mimeType/rssDetector.java
@@ -74,6 +74,7 @@ public class rssDetector implements MagicDetector {
         return "0.1";
     }
 
+    @SuppressWarnings("unchecked")
     public String[] process(File file, int offset, int length, long bitmask, char comparator, String mimeType, Map params) {
         FileInputStream fileInput = null;
         try {
@@ -86,6 +87,7 @@ public class rssDetector implements MagicDetector {
         }
     }
 
+    @SuppressWarnings("unchecked")
     public String[] process(byte[] data, int offset, int length, long bitmask, char comparator, String mimeType, Map params) {
         ByteArrayInputStream input = new ByteArrayInputStream(data);
         return detect(input);
diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java
index 57cd12758..1bfd12a96 100644
--- a/source/de/anomic/plasma/plasmaCrawlProfile.java
+++ b/source/de/anomic/plasma/plasmaCrawlProfile.java
@@ -140,7 +140,7 @@ public class plasmaCrawlProfile {
         } catch (IOException e) {}
     }
     
-    public entry newEntry(Map mem) {
+    public entry newEntry(HashMap mem) {
         entry ne = new entry(mem);
         try {
             profileTable.set(ne.handle(), ne.map());
@@ -204,7 +204,7 @@ public class plasmaCrawlProfile {
     }
     
     public entry getEntry(String handle) {
-        Map m = profileTable.getMap(handle);
+        HashMap m = profileTable.getMap(handle);
         if (m == null) return null;
         return new entry(m);
     }
@@ -254,7 +254,7 @@ public class plasmaCrawlProfile {
         public static final String XDSTOPW          = "xdstopw";
         public static final String XPSTOPW          = "xpstopw";
         
-        private Map mem;
+        private HashMap mem;
         private Map doms;
         
         public entry(String name, yacyURL startURL, String generalFilter, String specificFilter,
@@ -301,13 +301,13 @@ public class plasmaCrawlProfile {
             return str.toString();
         }        
         
-        public entry(Map mem) {
+        public entry(HashMap mem) {
             this.mem = mem;
             this.doms = (HashMap) domsCache.get(this.mem.get(HANDLE));
             if (this.doms == null) this.doms = new HashMap();
         }
         
-        public Map map() {
+        public HashMap map() {
             return mem;
         }
         public String handle() {
diff --git a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java b/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
index b74bff761..dc067d6d1 100644
--- a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
+++ b/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
@@ -53,7 +53,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Map;
 
 import de.anomic.kelondro.kelondroDyn;
 import de.anomic.kelondro.kelondroException;
@@ -103,7 +102,7 @@ public class plasmaCrawlRobotsTxt {
     
     public Entry getEntry(String hostName) {
         try {
-            Map record = this.robotsTable.getMap(hostName);
+            HashMap record = this.robotsTable.getMap(hostName);
             if (record == null) return null;
             return new Entry(hostName, record);
         } catch (kelondroException e) {
@@ -147,11 +146,11 @@ public class plasmaCrawlRobotsTxt {
         public static final String CRAWL_DELAY = "crawlDelay";
         
         // this is a simple record structure that hold all properties of a single crawl start
-        Map mem;
+        HashMap mem;
         private LinkedList disallowPathList;
         String hostName;
         
-        public Entry(String hostName, Map mem) {
+        public Entry(String hostName, HashMap mem) {
             this.hostName = hostName.toLowerCase();
             this.mem = mem; 
             
diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java
index c7b7cc083..1037f6f28 100644
--- a/source/de/anomic/plasma/plasmaHTCache.java
+++ b/source/de/anomic/plasma/plasmaHTCache.java
@@ -63,6 +63,7 @@ import java.lang.StringBuffer;
 import java.net.InetAddress;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -345,7 +346,7 @@ public final class plasmaHTCache {
     public static Entry pop() {
         synchronized (cacheStack) {
         if (cacheStack.size() > 0)
-            return (Entry) cacheStack.removeFirst();
+            return cacheStack.removeFirst();
         return null;
         }
     }
@@ -1130,7 +1131,9 @@ public final class plasmaHTCache {
     public boolean writeResourceInfo() {
         if (this.resInfo == null) return false;
         try {
-            responseHeaderDB.set(this.url.hash(), this.resInfo.getMap());
+            HashMap hm = new HashMap();
+            hm.putAll(this.resInfo.getMap());
+            responseHeaderDB.set(this.url.hash(), hm);
         } catch (Exception e) {
             resetResponseHeaderDB();
             return false;
diff --git a/source/de/anomic/server/serverCodings.java b/source/de/anomic/server/serverCodings.java
index 4a852a58a..f4ae5f629 100644
--- a/source/de/anomic/server/serverCodings.java
+++ b/source/de/anomic/server/serverCodings.java
@@ -176,10 +176,10 @@ public final class serverCodings {
 	return p;
     }
     
-    public static Map string2map(String string, String separator) {
+    public static HashMap string2map(String string, String separator) {
         // this can be used to parse a Map.toString() into a Map again
         if (string == null) return null;
-        Map map = Collections.synchronizedMap(new HashMap());
+        HashMap map = new HashMap();
         int pos;
         if ((pos = string.indexOf("{")) >= 0) string = string.substring(pos + 1).trim();
         if ((pos = string.lastIndexOf("}")) >= 0) string = string.substring(0, pos).trim();
diff --git a/source/de/anomic/server/serverObjects.java b/source/de/anomic/server/serverObjects.java
index 036a70e07..1e5c7b478 100644
--- a/source/de/anomic/server/serverObjects.java
+++ b/source/de/anomic/server/serverObjects.java
@@ -68,15 +68,15 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.InetAddress;
 import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 
 import de.anomic.data.htmlTools;
 import de.anomic.plasma.plasmaSwitchboard;
 import de.anomic.tools.yFormatter;
 
-public class serverObjects extends Hashtable implements Cloneable {
+public class serverObjects extends HashMap implements Cloneable {
 
     private static final long serialVersionUID = 1L;
     private boolean localized = true; 
@@ -280,10 +280,10 @@ public class serverObjects extends Hashtable implements Cloneabl
         // the keyMapper may contain regular expressions as defined in String.matches
         // this method is particulary useful when parsing the result of checkbox forms
         ArrayList v = new ArrayList();
-        Enumeration e = keys();
+        Iterator e = keySet().iterator();
         String key;
-        while (e.hasMoreElements()) {
-            key = e.nextElement();
+        while (e.hasNext()) {
+            key = e.next();
             if (key.matches(keyMapper)) v.add((String) get(key));
         }
         // make a String[]
@@ -294,10 +294,10 @@ public class serverObjects extends Hashtable implements Cloneabl
 
     // put all elements of another hashtable into the own table
     public void putAll(serverObjects add) {
-        Enumeration e = add.keys();
+        Iterator e = add.keySet().iterator();
         String k;
-        while (e.hasMoreElements()) {
-            k = e.nextElement();
+        while (e.hasNext()) {
+            k = e.next();
             put(k, add.get(k));
         }
     }
@@ -307,11 +307,11 @@ public class serverObjects extends Hashtable implements Cloneabl
         BufferedOutputStream fos = null;
         try {
             fos = new BufferedOutputStream(new FileOutputStream(f));
-            Enumeration e = keys();
+            Iterator e = keySet().iterator();
             String key, value;
-            while (e.hasMoreElements()) {
-                key = e.nextElement();
-                value = ((String) get(key)).replaceAll("\n", "\\\\n");  
+            while (e.hasNext()) {
+                key = e.next();
+                value = get(key).replaceAll("\n", "\\\\n");  
                 fos.write((key + "=" + value + "\r\n").getBytes());
             }
         } finally {
diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java
index 75ec3a4c8..17ad265c0 100644
--- a/source/de/anomic/yacy/yacySeed.java
+++ b/source/de/anomic/yacy/yacySeed.java
@@ -64,11 +64,9 @@ import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.net.InetAddress;
-import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.Random;
 import java.util.Set;
 
@@ -180,12 +178,12 @@ public class yacySeed {
     /** the peer-hash */
     public String hash;
     /** a set of identity founding values, eg. IP, name of the peer, YaCy-version, ...*/
-    private final Map dna;
+    private final HashMap dna;
     public int available;
     public int selectscore = -1; // only for debugging
     public String alternativeIP = null;
 
-    public yacySeed(String theHash, Map theDna) {
+    public yacySeed(String theHash, HashMap theDna) {
         // create a seed with a pre-defined hash map
         this.hash = theHash;
         this.dna = theDna;
@@ -195,7 +193,7 @@ public class yacySeed {
     }
 
     public yacySeed(String theHash) {
-        this.dna = Collections.synchronizedMap(new HashMap());
+        this.dna = new HashMap();
 
         // settings that can only be computed by originating peer:
         // at first startup -
@@ -359,7 +357,7 @@ public class yacySeed {
     }
 
     /** @return the DNA-map of this peer */
-    public final Map getMap() {
+    public final HashMap getMap() {
         return this.dna;
     }
 
@@ -793,7 +791,7 @@ public class yacySeed {
         if (seedStr == null) { return null; }
         final String seed = crypt.simpleDecode(seedStr, key);
         if (seed == null) { return null; }
-        final Map dna = serverCodings.string2map(seed, ",");
+        final HashMap dna = serverCodings.string2map(seed, ",");
         final String hash = (String) dna.remove(yacySeed.HASH);
         final yacySeed resultSeed = new yacySeed(hash, dna);
         if (properTest) {
diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java
index 1737d64b8..640a2001f 100644
--- a/source/de/anomic/yacy/yacySeedDB.java
+++ b/source/de/anomic/yacy/yacySeedDB.java
@@ -421,7 +421,7 @@ public final class yacySeedDB {
         //seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
         try {
             nameLookupCache.put(seed.getName(), seed);
-            Map seedPropMap = seed.getMap();
+            HashMap seedPropMap = seed.getMap();
             synchronized(seedPropMap) {
                 seedActiveDB.set(seed.hash, seedPropMap);
             }
@@ -448,7 +448,7 @@ public final class yacySeedDB {
         } catch (Exception e) {}
         //seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
         try {
-            Map seedPropMap = seed.getMap();
+            HashMap seedPropMap = seed.getMap();
             synchronized(seedPropMap) {
                 seedPassiveDB.set(seed.hash, seedPropMap);
             }
@@ -474,7 +474,7 @@ public final class yacySeedDB {
     if (seed.isProper() != null) return;
     //seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
         try {
-            Map seedPropMap = seed.getMap();
+            HashMap seedPropMap = seed.getMap();
             synchronized(seedPropMap) {
                 seedPotentialDB.set(seed.hash, seedPropMap);
             }
@@ -531,7 +531,7 @@ public final class yacySeedDB {
     private yacySeed get(String hash, kelondroMapObjects database) {
         if (hash == null) return null;
         if ((this.mySeed != null) && (hash.equals(mySeed.hash))) return mySeed;
-        Map entry = database.getMap(hash);
+        HashMap entry = database.getMap(hash);
         if (entry == null) return null;
         return new yacySeed(hash, entry);
     }
@@ -962,7 +962,7 @@ public final class yacySeedDB {
         
         public yacySeed internalNext() {
             if ((it == null) || (!(it.hasNext()))) return null;
-            Map dna = it.next();
+            HashMap dna = it.next();
             if (dna == null) return null;
             String hash = (String) dna.remove("key");
             //while (hash.length() < commonHashLength) { hash = hash + "_"; }