misc bugfixes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7201 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 44874f2cb9
commit be6b48311c

@ -168,8 +168,10 @@ public class HTTPClient {
// uncompress gzip
((AbstractHttpClient) httpClient).addResponseInterceptor(new GzipResponseInterceptor());
idledConnectionEvictor = new IdledConnectionEvictor(clientConnectionManager);
idledConnectionEvictor.start();
if (idledConnectionEvictor == null) {
idledConnectionEvictor = new IdledConnectionEvictor(clientConnectionManager);
idledConnectionEvictor.start();
}
return httpClient;
}

@ -53,7 +53,7 @@ public class ImageReferenceVars extends AbstractReference implements ImageRefere
posinphrase, posofphrase,
urlcomps, urllength, virtualAge,
wordsintext, wordsintitle;
ArrayList<Integer> positions;
private final ArrayList<Integer> positions;
public double termFrequency;
public ImageReferenceVars(
@ -309,7 +309,7 @@ public class ImageReferenceVars extends AbstractReference implements ImageRefere
if (this.virtualAge > (v = other.virtualAge)) this.virtualAge = v;
if (this.wordsintext > (v = other.wordsintext)) this.wordsintext = v;
if (this.phrasesintext > (v = other.phrasesintext)) this.phrasesintext = v;
this.positions = a(Math.min(min(this.positions), min(other.positions)));
if (other.positions != null) a(this.positions, Math.min(min(this.positions), min(other.positions)));
if (this.posinphrase > (v = other.posinphrase)) this.posinphrase = v;
if (this.posofphrase > (v = other.posofphrase)) this.posofphrase = v;
if (this.lastModified > (w = other.lastModified)) this.lastModified = w;
@ -331,7 +331,7 @@ public class ImageReferenceVars extends AbstractReference implements ImageRefere
if (this.virtualAge < (v = other.virtualAge)) this.virtualAge = v;
if (this.wordsintext < (v = other.wordsintext)) this.wordsintext = v;
if (this.phrasesintext < (v = other.phrasesintext)) this.phrasesintext = v;
this.positions = a(Math.max(max(this.positions), max(other.positions)));
if (other.positions != null) a(this.positions, Math.max(max(this.positions), max(other.positions)));
if (this.posinphrase < (v = other.posinphrase)) this.posinphrase = v;
if (this.posofphrase < (v = other.posofphrase)) this.posofphrase = v;
if (this.lastModified < (w = other.lastModified)) this.lastModified = w;

@ -60,7 +60,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
posinphrase, posofphrase,
urlcomps, urllength, virtualAge,
wordsintext, wordsintitle;
ArrayList<Integer> positions;
private final ArrayList<Integer> positions;
public double termFrequency;
public WordReferenceVars(
@ -317,7 +317,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
if (this.virtualAge > (v = other.virtualAge)) this.virtualAge = v;
if (this.wordsintext > (v = other.wordsintext)) this.wordsintext = v;
if (this.phrasesintext > (v = other.phrasesintext)) this.phrasesintext = v;
this.positions = this.positions == null ? other.positions : other.positions == null ? this.positions : a(Math.min(min(this.positions), min(other.positions)));
if (other.positions != null) a(this.positions, Math.min(min(this.positions), min(other.positions)));
if (this.posinphrase > (v = other.posinphrase)) this.posinphrase = v;
if (this.posofphrase > (v = other.posofphrase)) this.posofphrase = v;
if (this.lastModified > (w = other.lastModified)) this.lastModified = w;
@ -339,7 +339,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
if (this.virtualAge < (v = other.virtualAge)) this.virtualAge = v;
if (this.wordsintext < (v = other.wordsintext)) this.wordsintext = v;
if (this.phrasesintext < (v = other.phrasesintext)) this.phrasesintext = v;
this.positions = this.positions == null ? other.positions : other.positions == null ? this.positions : a(Math.max(max(this.positions), max(other.positions)));
if (other.positions != null) a(this.positions, Math.max(max(this.positions), max(other.positions)));
if (this.posinphrase < (v = other.posinphrase)) this.posinphrase = v;
if (this.posofphrase < (v = other.posofphrase)) this.posofphrase = v;
if (this.lastModified < (w = other.lastModified)) this.lastModified = w;

@ -31,12 +31,13 @@ import java.util.ArrayList;
public abstract class AbstractReference implements Reference {
protected static ArrayList<Integer> a(int i) {
ArrayList<Integer> l = new ArrayList<Integer>(1);
l.add(i);
return l;
protected static void a(ArrayList<Integer> a, int i) {
assert a != null;
a.clear();
a.add(i);
}
protected static int max(ArrayList<Integer> a) {
assert a != null;
assert !a.isEmpty();
if (a.size() == 1) return a.get(0);
if (a.size() == 2) return Math.max(a.get(0), a.get(1));
@ -45,6 +46,7 @@ public abstract class AbstractReference implements Reference {
return r;
}
protected static int min(ArrayList<Integer> a) {
assert a != null;
assert !a.isEmpty();
if (a.size() == 1) return a.get(0);
if (a.size() == 2) return Math.min(a.get(0), a.get(1));

Loading…
Cancel
Save