- removed unnecessary semicolons

- added default case for switch
pull/1/head
Michael Peter Christen 13 years ago
parent 132afaf687
commit 5bd3c90907

@ -55,7 +55,7 @@ org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore

@ -138,7 +138,7 @@ public class Surftips {
try{ try{
if(Switchboard.urlBlacklist.isListed(BlacklistType.SURFTIPS ,new DigestURI(url))) if(Switchboard.urlBlacklist.isListed(BlacklistType.SURFTIPS ,new DigestURI(url)))
continue; continue;
}catch(final MalformedURLException e){continue;}; }catch(final MalformedURLException e){continue;}
title = row.getColUTF8(1); title = row.getColUTF8(1);
description = row.getColUTF8(2); description = row.getColUTF8(2);
if ((url == null) || (title == null) || (description == null)) continue; if ((url == null) || (title == null) || (description == null)) continue;

@ -21,7 +21,7 @@ public class xbel {
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
int count = 0;; int count = 0;
String root = "/"; String root = "/";
int style = 0; int style = 0;

@ -66,7 +66,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
INFO ("<info"), INFO ("<info"),
METADATA ("<metadata"); METADATA ("<metadata");
private static StringBuilder buffer = new StringBuilder(25);; private static StringBuilder buffer = new StringBuilder(25);
private String tag; private String tag;
private XBEL(String t) { private XBEL(String t) {
@ -77,7 +77,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
} }
public String endTag(boolean empty) { public String endTag(boolean empty) {
buffer.setLength(0); buffer.setLength(0);
buffer.append(tag); buffer.append(this.tag);
if(empty) { if(empty) {
buffer.append('/'); buffer.append('/');
} else { } else {
@ -88,7 +88,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
} }
public String startTag(boolean att) { public String startTag(boolean att) {
buffer.setLength(0); buffer.setLength(0);
buffer.append(tag); buffer.append(this.tag);
if(!att) if(!att)
buffer.append('>'); buffer.append('>');
return buffer.toString(); return buffer.toString();
@ -127,6 +127,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.folder.append(this.RootFolder); this.folder.append(this.RootFolder);
} }
@Override
public void run() { public void run() {
try { try {
this.xmlReader.parse(new InputSource(this.bmk_file)); this.xmlReader.parse(new InputSource(this.bmk_file));
@ -146,6 +147,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
} }
} }
@Override
public void endDocument() throws SAXException { public void endDocument() throws SAXException {
// put alias references in the bookmark queue to ensure that folders get updated // put alias references in the bookmark queue to ensure that folders get updated
// we do that at endDocument to ensure all referenced bookmarks already exist // we do that at endDocument to ensure all referenced bookmarks already exist
@ -154,6 +156,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.bmkRef.clear(); this.bmkRef.clear();
} }
@Override
public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException { public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException {
YMarkDate date = new YMarkDate(); YMarkDate date = new YMarkDate();
if (tag == null) return; if (tag == null) return;
@ -221,6 +224,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
} }
} }
@Override
public void endElement(final String uri, final String name, String tag) { public void endElement(final String uri, final String name, String tag) {
if (tag == null) return; if (tag == null) return;
tag = tag.toLowerCase(); tag = tag.toLowerCase();
@ -230,7 +234,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.bmk.put(YMarkEntry.BOOKMARK.FOLDERS.key(), this.folder.toString()); this.bmk.put(YMarkEntry.BOOKMARK.FOLDERS.key(), this.folder.toString());
try { try {
this.bookmarks.put(this.bmk); this.bookmarks.put(this.bmk);
bmk = new YMarkEntry(); this.bmk = new YMarkEntry();
} catch (InterruptedException e) { } catch (InterruptedException e) {
Log.logException(e); Log.logException(e);
} }
@ -240,7 +244,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
// go up one folder // go up one folder
//TODO: get rid of .toString.equals() //TODO: get rid of .toString.equals()
if(!this.folder.toString().equals(this.RootFolder)) { if(!this.folder.toString().equals(this.RootFolder)) {
folder.setLength(folder.lastIndexOf(YMarkUtil.FOLDERS_SEPARATOR)); this.folder.setLength(this.folder.lastIndexOf(YMarkUtil.FOLDERS_SEPARATOR));
} }
this.outer_state = XBEL.FOLDER; this.outer_state = XBEL.FOLDER;
} else if (XBEL.INFO.tag().equals(tag)) { } else if (XBEL.INFO.tag().equals(tag)) {
@ -250,24 +254,25 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
} }
} }
@Override
public void characters(final char ch[], final int start, final int length) { public void characters(final char ch[], final int start, final int length) {
if (parse_value) { if (this.parse_value) {
buffer.append(ch, start, length); this.buffer.append(ch, start, length);
switch(outer_state) { switch(this.outer_state) {
case BOOKMARK: case BOOKMARK:
switch(inner_state) { switch(this.inner_state) {
case DESC: case DESC:
this.bmk.put(YMarkEntry.BOOKMARK.DESC.key(), buffer.toString().trim()); this.bmk.put(YMarkEntry.BOOKMARK.DESC.key(), this.buffer.toString().trim());
break; break;
case TITLE: case TITLE:
this.bmk.put(YMarkEntry.BOOKMARK.TITLE.key(), buffer.toString().trim()); this.bmk.put(YMarkEntry.BOOKMARK.TITLE.key(), this.buffer.toString().trim());
break; break;
default: default:
break; break;
} }
break; break;
case FOLDER: case FOLDER:
switch(inner_state) { switch(this.inner_state) {
case DESC: case DESC:
break; break;
case TITLE: case TITLE:
@ -309,6 +314,6 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
if(url) if(url)
this.ref.put(YMarkEntry.BOOKMARK.URL.key(), this.bmk.get(YMarkEntry.BOOKMARK.URL.key())); this.ref.put(YMarkEntry.BOOKMARK.URL.key(), this.bmk.get(YMarkEntry.BOOKMARK.URL.key()));
this.ref.put(YMarkEntry.BOOKMARK.FOLDERS.key(), this.folderstring.toString()); this.ref.put(YMarkEntry.BOOKMARK.FOLDERS.key(), this.folderstring.toString());
this.bmkRef.put(id, ref); this.bmkRef.put(id, this.ref);
} }
} }

@ -38,6 +38,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import org.apache.commons.httpclient.HttpMethod;
/** /**
* <p>Transparently coalesces chunks of a HTTP stream that uses * <p>Transparently coalesces chunks of a HTTP stream that uses
@ -451,7 +453,6 @@ public class ChunkedInputStream extends InputStream {
// read and discard the remainder of the message // read and discard the remainder of the message
byte buffer[] = new byte[1024]; byte buffer[] = new byte[1024];
while (inStream.read(buffer) >= 0) { while (inStream.read(buffer) >= 0) {
;
} }
} }
} }

@ -52,7 +52,7 @@ public class UPnP {
private final static String mappedName = "YaCy"; private final static String mappedName = "YaCy";
private final static String mappedProtocol = "TCP"; private final static String mappedProtocol = "TCP";
private static int mappedPort = 0; private static int mappedPort = 0;
private static String localHostIP = null;; private static String localHostIP = null;
/* Discovery message sender IP /10.100.100.2 does not match device description IP /192.168.1.254 skipping message, /* Discovery message sender IP /10.100.100.2 does not match device description IP /192.168.1.254 skipping message,
set the net.yacy.upnp.ddos.matchip system property to false to avoid this check set the net.yacy.upnp.ddos.matchip system property to false to avoid this check
@ -181,6 +181,7 @@ public class UPnP {
protected static class Handler implements DiscoveryEventHandler { protected static class Handler implements DiscoveryEventHandler {
@Override
public void eventSSDPAlive(String usn, String udn, String nt, String maxAge, URL location) { public void eventSSDPAlive(String usn, String udn, String nt, String maxAge, URL location) {
InternetGatewayDevice[] newIGD = { null }; InternetGatewayDevice[] newIGD = { null };
boolean error = false; boolean error = false;
@ -207,6 +208,7 @@ public class UPnP {
Listener.unregister(); Listener.unregister();
} }
@Override
public void eventSSDPByeBye(String usn, String udn, String nt) {} public void eventSSDPByeBye(String usn, String udn, String nt) {}
} }

@ -46,7 +46,7 @@ public class RSSReader extends DefaultHandler {
private final RSSFeed theChannel; private final RSSFeed theChannel;
private Type type; private Type type;
public enum Type { rss, atom, rdf, none }; public enum Type { rss, atom, rdf, none }
private RSSReader(final int maxsize) { private RSSReader(final int maxsize) {
this.theChannel = new RSSFeed(maxsize); this.theChannel = new RSSFeed(maxsize);

@ -152,7 +152,7 @@ public class Word {
public static final byte[] hash2private(final byte[] hash, byte privateType) { public static final byte[] hash2private(final byte[] hash, byte privateType) {
byte[] p = new byte[commonHashLength]; byte[] p = new byte[commonHashLength];
p[0] = highByte; p[1] = highByte; p[2] = highByte; ; p[3] = highByte; ; p[4] = highByte; p[5] = privateType; p[0] = highByte; p[1] = highByte; p[2] = highByte; p[3] = highByte; p[4] = highByte; p[5] = privateType;
System.arraycopy(hash, 0, p, 6, commonHashLength - 6); // 36 bits left for private hashes should be enough System.arraycopy(hash, 0, p, 6, commonHashLength - 6); // 36 bits left for private hashes should be enough
return p; return p;
} }

@ -253,6 +253,12 @@ public final class Column implements Cloneable, Serializable {
s.append('-'); s.append('-');
s.append(this.cellwidth); s.append(this.cellwidth);
break; break;
default:
s.append("String ");
s.append(this.nickname);
s.append('-');
s.append(this.cellwidth);
break;
} }
switch (this.encoder) { switch (this.encoder) {
@ -262,6 +268,9 @@ public final class Column implements Cloneable, Serializable {
case encoder_b256: case encoder_b256:
s.append(" {b256}"); s.append(" {b256}");
break; break;
default:
s.append(" {b256}");
break;
} }
return s.toString(); return s.toString();
} }

@ -151,8 +151,8 @@ public abstract class AbstractThread extends Thread implements WorkflowThread {
} }
@Override @Override
public void open() {}; // dummy definition; should be overriden public void open() {} // dummy definition; should be overriden
@Override @Override
public void close() {}; // dummy definition; should be overriden public void close() {} // dummy definition; should be overriden
} }

@ -34,7 +34,7 @@ public class FilterEngine {
public static final int ERR_DOUBLE_OCCURANCE = 6; public static final int ERR_DOUBLE_OCCURANCE = 6;
public static final int ERR_HOST_REGEX = 7; public static final int ERR_HOST_REGEX = 7;
protected enum listTypes { type1 }; protected enum listTypes { type1 }
protected class FilterEntry implements Comparable<FilterEntry> { protected class FilterEntry implements Comparable<FilterEntry> {
public String path; public String path;

@ -216,7 +216,7 @@ public final class yacy {
try { try {
channel = new RandomAccessFile(f,"rw").getChannel(); channel = new RandomAccessFile(f,"rw").getChannel();
lock = channel.tryLock(); // lock yacy.running lock = channel.tryLock(); // lock yacy.running
} catch (final Exception e) { }; } catch (final Exception e) { }
final String oldconf = "DATA/SETTINGS/httpProxy.conf".replace("/", File.separator); final String oldconf = "DATA/SETTINGS/httpProxy.conf".replace("/", File.separator);
final String newconf = "DATA/SETTINGS/yacy.conf".replace("/", File.separator); final String newconf = "DATA/SETTINGS/yacy.conf".replace("/", File.separator);

Loading…
Cancel
Save