From 820a03f9d633b9ce758d022e821f838aa68224b4 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 1 Oct 2008 20:20:39 +0000 Subject: [PATCH] - removed some warnings - used fix in SVN 5233 for ysearch.java and search.java git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5237 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- build.properties | 2 +- htroot/yacy/search.java | 1 + htroot/yacy/user/ysearch.java | 1 + .../de/anomic/plasma/plasmaSearchQuery.java | 1 + source/de/anomic/yacy/yacySearch.java | 1 + source/de/anomic/yacy/yacyTray.java | 19 ++++++++++--------- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/build.properties b/build.properties index 448a4a14e..3649dbc70 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ javacSource=1.5 javacTarget=1.5 # Release Configuration -releaseVersion=0.604 +releaseVersion=0.605 stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz embReleaseFile=yacy_emb_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java index 1f7a545df..c30dcbc27 100644 --- a/htroot/yacy/search.java +++ b/htroot/yacy/search.java @@ -93,6 +93,7 @@ public final class search { String agent = header.get("User-Agent"); if (agent == null) agent = System.getProperty("user.language"); language = (agent == null) ? "en" : iso639.userAgentLanguageDetection(agent); + if (language == null) language = "en"; } final int partitions = post.getInt("partitions", 30); String profile = post.get("profile", ""); // remote profile hand-over diff --git a/htroot/yacy/user/ysearch.java b/htroot/yacy/user/ysearch.java index 4a1d57c04..d9e817b05 100644 --- a/htroot/yacy/user/ysearch.java +++ b/htroot/yacy/user/ysearch.java @@ -138,6 +138,7 @@ public class ysearch { String agent = header.get("User-Agent"); if (agent == null) agent = System.getProperty("user.language"); String language = (agent == null) ? "en" : iso639.userAgentLanguageDetection(agent); + if (language == null) language = "en"; // SEARCH //final boolean indexDistributeGranted = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true"); diff --git a/source/de/anomic/plasma/plasmaSearchQuery.java b/source/de/anomic/plasma/plasmaSearchQuery.java index a31a8b6f0..d80fcbedd 100644 --- a/source/de/anomic/plasma/plasmaSearchQuery.java +++ b/source/de/anomic/plasma/plasmaSearchQuery.java @@ -137,6 +137,7 @@ public final class plasmaSearchQuery { this.linesPerPage = Math.min((specialRights) ? 1000 : 10, lines); this.offset = Math.min((specialRights) ? 10000 : 100, offset); this.urlMask = urlMask; + assert language != null; this.targetlang = language; this.domType = domType; this.zonecode = domainzone; diff --git a/source/de/anomic/yacy/yacySearch.java b/source/de/anomic/yacy/yacySearch.java index cf305f0cc..e722d79c9 100644 --- a/source/de/anomic/yacy/yacySearch.java +++ b/source/de/anomic/yacy/yacySearch.java @@ -295,6 +295,7 @@ public class yacySearch extends Thread { //if (wordIndex.seedDB.mySeed() == null || wordIndex.seedDB.mySeed().getPublicAddress() == null) { return null; } // prepare seed targets and threads + assert language != null; final yacySeed[] targetPeers = (clusterselection == null) ? selectSearchTargets(wordIndex.seedDB, wordIndex.peerActions, plasmaSearchQuery.hashes2Set(wordhashes), targets) : selectClusterPeers(wordIndex.seedDB, clusterselection); if (targetPeers == null) return new yacySearch[0]; targets = targetPeers.length; diff --git a/source/de/anomic/yacy/yacyTray.java b/source/de/anomic/yacy/yacyTray.java index 1a7ad884a..67371d170 100644 --- a/source/de/anomic/yacy/yacyTray.java +++ b/source/de/anomic/yacy/yacyTray.java @@ -65,7 +65,7 @@ public final class yacyTray { trayClickAction(); } }; - ti = new nativeTrayIcon(sb, iconpath, al, setupPopupMenu()); + ti = new nativeTrayIcon(iconpath, al, setupPopupMenu()); ti.addToSystemTray(); isShown = true; @@ -160,7 +160,6 @@ public final class yacyTray { } class nativeTrayIcon { - private plasmaSwitchboard sb; private Object SystemTray; private Object TrayIcon; private Class SystemTrayClass; @@ -179,10 +178,9 @@ class nativeTrayIcon { } - public nativeTrayIcon(final plasmaSwitchboard sb, String IconPath, ActionListener al, PopupMenu menu) { - if(!isSupported()) - return; - this.sb = sb; + @SuppressWarnings("unchecked") + public nativeTrayIcon(String IconPath, ActionListener al, PopupMenu menu) { + if(!isSupported()) return; final Image i = Toolkit.getDefaultToolkit().getImage(IconPath); @@ -232,7 +230,8 @@ class nativeTrayIcon { } } - public void addToSystemTray() { + @SuppressWarnings("unchecked") + public void addToSystemTray() { try { // with reflections: this.SystemTray.add(this.TrayIcon) Class partypes1[] = new Class[1]; @@ -247,7 +246,8 @@ class nativeTrayIcon { } } - public void removeFromSystemTray() { + @SuppressWarnings("unchecked") + public void removeFromSystemTray() { try { // with reflections: this.SystemTray.remove(this.TrayIcon) Class partypes1[] = new Class[1]; @@ -262,7 +262,8 @@ class nativeTrayIcon { } } - public void displayBalloonMessage(final String title, final String message) { + @SuppressWarnings("unchecked") + public void displayBalloonMessage(final String title, final String message) { try { // with reflections: this.TrayIcon.displayBalloonMessage(title, message, TrayIcon.MessageType.NONE) Class partypes1[] = new Class[3];