- 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.possibleAccidentalBooleanAssignment=warning
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.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore

@ -138,7 +138,7 @@ public class Surftips {
try{
if(Switchboard.urlBlacklist.isListed(BlacklistType.SURFTIPS ,new DigestURI(url)))
continue;
}catch(final MalformedURLException e){continue;};
}catch(final MalformedURLException e){continue;}
title = row.getColUTF8(1);
description = row.getColUTF8(2);
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) {
int count = 0;;
int count = 0;
String root = "/";
int style = 0;

@ -66,7 +66,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
INFO ("<info"),
METADATA ("<metadata");
private static StringBuilder buffer = new StringBuilder(25);;
private static StringBuilder buffer = new StringBuilder(25);
private String tag;
private XBEL(String t) {
@ -77,7 +77,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
}
public String endTag(boolean empty) {
buffer.setLength(0);
buffer.append(tag);
buffer.append(this.tag);
if(empty) {
buffer.append('/');
} else {
@ -88,7 +88,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
}
public String startTag(boolean att) {
buffer.setLength(0);
buffer.append(tag);
buffer.append(this.tag);
if(!att)
buffer.append('>');
return buffer.toString();
@ -127,6 +127,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.folder.append(this.RootFolder);
}
@Override
public void run() {
try {
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 {
// 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
@ -154,6 +156,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.bmkRef.clear();
}
@Override
public void startElement(final String uri, final String name, String tag, final Attributes atts) throws SAXException {
YMarkDate date = new YMarkDate();
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) {
if (tag == null) return;
tag = tag.toLowerCase();
@ -230,7 +234,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
this.bmk.put(YMarkEntry.BOOKMARK.FOLDERS.key(), this.folder.toString());
try {
this.bookmarks.put(this.bmk);
bmk = new YMarkEntry();
this.bmk = new YMarkEntry();
} catch (InterruptedException e) {
Log.logException(e);
}
@ -240,7 +244,7 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
// go up one folder
//TODO: get rid of .toString.equals()
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;
} 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) {
if (parse_value) {
buffer.append(ch, start, length);
switch(outer_state) {
if (this.parse_value) {
this.buffer.append(ch, start, length);
switch(this.outer_state) {
case BOOKMARK:
switch(inner_state) {
switch(this.inner_state) {
case DESC:
this.bmk.put(YMarkEntry.BOOKMARK.DESC.key(), buffer.toString().trim());
this.bmk.put(YMarkEntry.BOOKMARK.DESC.key(), this.buffer.toString().trim());
break;
case TITLE:
this.bmk.put(YMarkEntry.BOOKMARK.TITLE.key(), buffer.toString().trim());
this.bmk.put(YMarkEntry.BOOKMARK.TITLE.key(), this.buffer.toString().trim());
break;
default:
break;
}
break;
case FOLDER:
switch(inner_state) {
switch(this.inner_state) {
case DESC:
break;
case TITLE:
@ -309,6 +314,6 @@ public class YMarkXBELImporter extends DefaultHandler implements Runnable {
if(url)
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.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.UnsupportedEncodingException;
import org.apache.commons.httpclient.HttpMethod;
/**
* <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
byte buffer[] = new byte[1024];
while (inStream.read(buffer) >= 0) {
;
}
}
}

@ -52,7 +52,7 @@ public class UPnP {
private final static String mappedName = "YaCy";
private final static String mappedProtocol = "TCP";
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,
set the net.yacy.upnp.ddos.matchip system property to false to avoid this check
@ -181,7 +181,8 @@ public class UPnP {
protected static class Handler implements DiscoveryEventHandler {
public void eventSSDPAlive(String usn, String udn, String nt, String maxAge, URL location) {
@Override
public void eventSSDPAlive(String usn, String udn, String nt, String maxAge, URL location) {
InternetGatewayDevice[] newIGD = { null };
boolean error = false;
String errorMsg = null;
@ -207,7 +208,8 @@ public class UPnP {
Listener.unregister();
}
public void eventSSDPByeBye(String usn, String udn, String nt) {}
@Override
public void eventSSDPByeBye(String usn, String udn, String nt) {}
}

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

@ -152,7 +152,7 @@ public class Word {
public static final byte[] hash2private(final byte[] hash, byte privateType) {
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
return p;
}

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

@ -151,8 +151,8 @@ public abstract class AbstractThread extends Thread implements WorkflowThread {
}
@Override
public void open() {}; // dummy definition; should be overriden
public void open() {} // dummy definition; should be overriden
@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_HOST_REGEX = 7;
protected enum listTypes { type1 };
protected enum listTypes { type1 }
protected class FilterEntry implements Comparable<FilterEntry> {
public String path;

@ -216,7 +216,7 @@ public final class yacy {
try {
channel = new RandomAccessFile(f,"rw").getChannel();
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 newconf = "DATA/SETTINGS/yacy.conf".replace("/", File.separator);

Loading…
Cancel
Save