problems with code style

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6153 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2009-06-29 22:22:35 +00:00
parent adf01c676e
commit 93dfb51fd4
10 changed files with 37 additions and 38 deletions

8
.checkstyle Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="false">
<local-check-config name="easy" location="internal_config__1246313062720.xml" type="internal" description=""/>
<fileset name="all" enabled="true" check-config-name="Sun Checks" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>

View File

@ -118,7 +118,8 @@ public class DCEntry extends TreeMap<String, String> {
public String language() { public String language() {
String l = this.get("language"); String l = this.get("language");
if (l == null) l = this.get("dc:language"); if (l == null) l = this.get("dc:language");
if (l == null) return url().language(); else return l; if (l == null) return url().language();
return l;
} }
public String title() { public String title() {

View File

@ -114,9 +114,9 @@ public class IndexingStack {
} }
if (sbQueueStack.size() < sizeBefore) { if (sbQueueStack.size() < sizeBefore) {
return new QueueEntry(b); return new QueueEntry(b);
} else {
Log.logSevere("IndexingStack", "sbQueueStack " + sbQueueStack.filename + " does not shrink after pot() != null; trying pop()");
} }
Log.logSevere("IndexingStack", "sbQueueStack " + sbQueueStack.filename + " does not shrink after pot() != null; trying pop()");
sizeBefore = sbQueueStack.size(); sizeBefore = sbQueueStack.size();
b = sbQueueStack.pop(); b = sbQueueStack.pop();
if (b == null) { if (b == null) {

View File

@ -37,9 +37,6 @@ import de.anomic.server.serverCore;
public class httpRequestHeader extends httpHeader { public class httpRequestHeader extends httpHeader {
// request header properties // request header properties
public static final String ACCEPT = "Accept";
public static final String ACCEPT_CHARSET = "Accept-Charset";
public static final String ACCEPT_LANGUAGE = "Accept-Language";
public static final String CONNECTION = "Connection"; public static final String CONNECTION = "Connection";
public static final String PROXY_CONNECTION = "Proxy-Connection"; public static final String PROXY_CONNECTION = "Proxy-Connection";
@ -58,7 +55,6 @@ public class httpRequestHeader extends httpHeader {
public static final String COOKIE = "Cookie"; public static final String COOKIE = "Cookie";
public static final String ACCEPT_ENCODING = "Accept-Encoding";
public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
public static final String IF_RANGE = "If-Range"; public static final String IF_RANGE = "If-Range";
public static final String REFERER = "Referer"; public static final String REFERER = "Referer";

View File

@ -460,7 +460,7 @@ public class ArrayStack implements BLOB {
* @throws IOException * @throws IOException
*/ */
public synchronized CloneableIterator<byte[]> keys(boolean up, boolean rotating) throws IOException { public synchronized CloneableIterator<byte[]> keys(boolean up, boolean rotating) throws IOException {
assert rotating = false; assert rotating == false;
final List<CloneableIterator<byte[]>> c = new ArrayList<CloneableIterator<byte[]>>(blobs.size()); final List<CloneableIterator<byte[]>> c = new ArrayList<CloneableIterator<byte[]>>(blobs.size());
final Iterator<blobItem> i = blobs.iterator(); final Iterator<blobItem> i = blobs.iterator();
while (i.hasNext()) { while (i.hasNext()) {
@ -726,11 +726,10 @@ public class ArrayStack implements BLOB {
FileUtils.deletedelete(f1); FileUtils.deletedelete(f1);
if (f2.renameTo(newFile)) return newFile; if (f2.renameTo(newFile)) return newFile;
return f2; return f2;
} else {
FileUtils.deletedelete(f1);
FileUtils.deletedelete(f2);
return null;
} }
FileUtils.deletedelete(f1);
FileUtils.deletedelete(f2);
return null;
} else if (!i2.hasNext()) { } else if (!i2.hasNext()) {
FileUtils.deletedelete(f2); FileUtils.deletedelete(f2);
if (f1.renameTo(newFile)) return newFile; if (f1.renameTo(newFile)) return newFile;

View File

@ -206,12 +206,11 @@ public class HandleMap implements Iterable<Row.Entry> {
newentry.setCol(1, a); newentry.setCol(1, a);
index.addUnique(newentry); index.addUnique(newentry);
return 1; return 1;
} else {
long i = indexentry.getColLong(1) + a;
indexentry.setCol(1, i);
index.put(indexentry);
return i;
} }
long i = indexentry.getColLong(1) + a;
indexentry.setCol(1, i);
index.put(indexentry);
return i;
} }
public synchronized long inc(final byte[] key) { public synchronized long inc(final byte[] key) {

View File

@ -264,12 +264,11 @@ public final class FileUtils {
return bb; return bb;
} }
return b; return b;
} else {
final ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
copy(source, baos, count);
baos.close();
return baos.toByteArray();
} }
final ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
copy(source, baos, count);
baos.close();
return baos.toByteArray();
} }
public static byte[] read(final File source) throws IOException { public static byte[] read(final File source) throws IOException {

View File

@ -178,8 +178,6 @@ public class UPnP {
} }
private static class Handler implements DiscoveryEventHandler { private static class Handler implements DiscoveryEventHandler {
private final Log log = UPnP.log;
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 };

View File

@ -481,17 +481,17 @@ public final class Condenser {
public final static boolean invisible(final char c) { public final static boolean invisible(final char c) {
final int type = Character.getType(c); final int type = Character.getType(c);
if( if (
(type == Character.LOWERCASE_LETTER) (type == Character.LOWERCASE_LETTER)
|| (type == Character.DECIMAL_DIGIT_NUMBER) || (type == Character.DECIMAL_DIGIT_NUMBER)
|| (type == Character.UPPERCASE_LETTER) || (type == Character.UPPERCASE_LETTER)
|| (type == Character.MODIFIER_LETTER) || (type == Character.MODIFIER_LETTER)
|| (type == Character.OTHER_LETTER) || (type == Character.OTHER_LETTER)
|| (type == Character.TITLECASE_LETTER) || (type == Character.TITLECASE_LETTER)
|| (htmlFilterContentScraper.punctuation(c))) || (htmlFilterContentScraper.punctuation(c))) {
return false; return false;
else }
return true; return true;
} }
public static Enumeration<StringBuilder> wordTokenizer(final String s, final String charset) { public static Enumeration<StringBuilder> wordTokenizer(final String s, final String charset) {

View File

@ -377,11 +377,10 @@ public class Dispatcher {
return null; return null;
} }
return chunk; return chunk;
} else {
this.log.logInfo("STORE: Chunk " + new String(chunk.primaryTarget()) + " has not enough targets left. This transmission has failed, putting back index to backend");
chunk.restore();
return null;
} }
this.log.logInfo("STORE: Chunk " + new String(chunk.primaryTarget()) + " has not enough targets left. This transmission has failed, putting back index to backend");
chunk.restore();
return null;
} }
public void close() { public void close() {