replaced some toString()

see http://www.yacy-forum.de/viewtopic.php?p=31151#31151

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3345 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 7673f0869b
commit c464157a6e

@ -166,7 +166,7 @@ public class CacheAdmin_p {
if (sentences != null)
while (sentences.hasNext()) {
prop.put("info_type_lines_" + i + "_line",
de.anomic.data.wikiCode.replaceXMLEntities(((StringBuffer) sentences.next()).toString().replaceAll("\n", "").trim()));
de.anomic.data.wikiCode.replaceXMLEntities((new String((StringBuffer) sentences.next())).replaceAll("\n", "").trim()));
i++;
}
prop.put("info_type_lines", i);

@ -211,7 +211,7 @@ public final class message {
Process process=Runtime.getRuntime().exec(sendMail);
PrintWriter email = new PrintWriter(process.getOutputStream());
email.print(emailTxt.toString());
email.print(new String(emailTxt));
email.close();
} catch (Exception e) {
yacyCore.log.logWarning("message: message forwarding via email failed. ",e);

@ -241,7 +241,7 @@ public final class search {
}
if (partitions > 0) sb.requestedQueries = sb.requestedQueries + 1d / (double) partitions; // increase query counter
}
prop.putASIS("indexabstract", indexabstract.toString());
prop.putASIS("indexabstract", new String(indexabstract));
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
@ -298,7 +298,7 @@ public final class search {
StringBuffer refstr = new StringBuffer();
for (int j = 0; j < ws.length; j++)
refstr.append(",").append((String) ws[j]);
prop.putASIS("references", (refstr.length() > 0) ? refstr.substring(1) : refstr.toString());
prop.putASIS("references", (refstr.length() > 0) ? refstr.substring(1) : new String(refstr));
}
// add information about forward peers

@ -215,7 +215,7 @@ public final class transferRWI {
}
}
prop.putASIS("unknownURL", unknownURLs.toString());
prop.putASIS("unknownURL", new String(unknownURLs));
prop.putASIS("result", result);
prop.putASIS("pause", Integer.toString(pause));

@ -174,7 +174,7 @@ public class Diff {
StringBuffer sb = new StringBuffer(this.parts.size() * 20);
for (int j=0; j<this.parts.size(); j++)
sb.append(((Part)this.parts.get(j)).toString()).append("\n");
return sb.toString();
return new String(sb);
}
/**
@ -246,6 +246,6 @@ public class Diff {
}
sb.append("</p>");
}
return sb.toString();
return new String(sb);
}
}

@ -161,7 +161,7 @@ public class listManager {
.append(list[i])
.append(serverCore.crlfString);
}
return writeList(listFile, out.toString()); //(File, String)
return writeList(listFile, new String(out)); //(File, String)
}
public static String getListString(String filename, boolean withcomments) {
@ -192,7 +192,7 @@ public class listManager {
if (br!=null) try { br.close(); } catch (Exception e) {}
}
return temp.toString();
return new String(temp);
}
// get a Directory Listing as a String Array
@ -308,7 +308,7 @@ public class listManager {
}
}
}
return ret.toString();
return new String(ret);
}
public static HashSet string2hashset(String string){
HashSet ret=new HashSet();

@ -558,7 +558,7 @@ public final class userDB {
str.append(this.mem.toString());
}
return str.toString();
return new String(str);
}
}

@ -111,7 +111,7 @@ public class wikiCode {
out.append(transformLine(line, switchboard)).append(
serverCore.crlfString);
}
return directory()+out.toString();
return directory() + new String(out);
} catch (UnsupportedEncodingException e1) {
// can not happen
return null;

@ -129,7 +129,7 @@ public final class httpRemoteProxyConfig {
.append(this.remoteProxyNoProxy);
return toStrBuf.toString();
return new String(toStrBuf);
}
public static httpRemoteProxyConfig init(

@ -1801,7 +1801,7 @@ do upload
toStringBuffer.append((this.status == null) ? "Status: Unknown" : "Status: " + this.status)
.append(" | Headers: ")
.append((this.responseHeader == null) ? "none" : this.responseHeader.toString());
return toStringBuffer.toString();
return new String(toStringBuffer);
}
/**

@ -753,7 +753,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
//tp is from the servlet, fis is the content-only from the servlet
//this resolvs templates in both header and content
o = new serverByteBuffer();
fis=new ByteArrayInputStream(content.toString().getBytes());
fis=new ByteArrayInputStream((new String(content)).getBytes());
httpTemplate.writeTemplate(fis, o, tp, "-UNRESOLVED_PATTERN-".getBytes());
content_s=o.toString();
o = new serverByteBuffer();
@ -947,7 +947,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
if (!conProp.containsKey(httpHeader.CONNECTION_PROP_PROXY_RESPOND_HEADER)) {
// sending back an error message to the client
// if we have not already send an http header
httpd.sendRespondError(conProp,out, 4, httpStatusCode, httpStatusText, errorMessage.toString(),errorExc);
httpd.sendRespondError(conProp,out, 4, httpStatusCode, httpStatusText, new String(errorMessage),errorExc);
} else {
// otherwise we close the connection
this.forceConnectionClose();
@ -955,7 +955,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
// if it is an unexpected error we log it
if (httpStatusCode == 500) {
this.theLogger.logWarning(errorMessage.toString(),e);
this.theLogger.logWarning(new String(errorMessage),e);
}
} catch (Exception ee) {

@ -1546,7 +1546,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
this.userAgentStr.append(browserUserAgent);
}
return this.userAgentStr.toString();
return new String(this.userAgentStr);
}
private void setViaHeader(httpHeader header, String httpVer) {
@ -1564,7 +1564,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
.append("(YaCy ").append(switchboard.getConfig("vString", "0.0")).append(")");
// storing header back
header.put(httpHeader.VIA, viaValue.toString());
header.put(httpHeader.VIA, new String(viaValue));
}
/**
@ -1652,7 +1652,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
this.logMessage.append(mime);
// sending the logging message to the logger
this.proxyLog.logFine(this.logMessage.toString());
this.proxyLog.logFine(new String(this.logMessage));
}
}

@ -229,7 +229,7 @@ public class icapd implements serverHandler {
// icapResHeader.put(icapHeader.CONNECTION, "close");
StringBuffer headerStringBuffer = icapResHeader.toHeaderString("ICAP/1.0",404,null);
out.write(headerStringBuffer.toString().getBytes());
out.write((new String(headerStringBuffer)).getBytes());
out.flush();
}
@ -307,7 +307,7 @@ public class icapd implements serverHandler {
// resHeader.put(icapHeader.CONNECTION, "close");
StringBuffer headerStringBuffer = icapResHeader.toHeaderString("ICAP/1.0",204,null);
out.write(headerStringBuffer.toString().getBytes());
out.write((new String(headerStringBuffer)).getBytes());
out.flush();
} else {
icapResHeader.put(icapHeader.ENCAPSULATED,reqHeader.get(icapHeader.ENCAPSULATED));
@ -315,7 +315,7 @@ public class icapd implements serverHandler {
// icapResHeader.put(icapHeader.CONNECTION, "close");
StringBuffer headerStringBuffer = icapResHeader.toHeaderString("ICAP/1.0",503,null);
out.write(headerStringBuffer.toString().getBytes());
out.write((new String(headerStringBuffer)).getBytes());
out.flush();
}

@ -363,7 +363,7 @@ public class indexURLEntryNew implements indexURLEntry {
core.append(",snippet=").append(crypt.simpleEncode(snippet));
core.append("}");
return core.toString();
return new String(core);
//return "{" + core + ",snippet=" + crypt.simpleEncode(snippet) + "}";
}
@ -379,7 +379,7 @@ public class indexURLEntryNew implements indexURLEntry {
core.insert(0, "{");
core.append("}");
return core.toString();
return new String(core);
//return "{" + core + "}";
}

@ -202,9 +202,9 @@ public class kelondroAttrSeq {
sb.append((char) 13); sb.append((char) 10);
}
if (out.toString().endsWith(".gz")) {
serverFileUtils.writeAndGZip(sb.toString().getBytes(), out);
serverFileUtils.writeAndGZip((new String(sb)).getBytes(), out);
} else {
serverFileUtils.write(sb.toString().getBytes(), out);
serverFileUtils.write((new String(sb)).getBytes(), out);
}
}
@ -352,7 +352,7 @@ public class kelondroAttrSeq {
sb.append(",<"); sb.append(seq_names[i]); sb.append('-'); sb.append(Integer.toString(seq_len[i])); sb.append('>');
}
}
return sb.toString();
return new String(sb);
}
}
@ -444,7 +444,7 @@ public class kelondroAttrSeq {
}
*/
}
return sb.toString();
return new String(sb);
}
}

@ -138,7 +138,7 @@ public class kelondroBase64Order extends kelondroAbstractOrder implements kelond
StringBuffer s = new StringBuffer(length);
s.setLength(length);
while (length > 0) s.setCharAt(--length, alpha[63]);
return s.toString();
return new String(s);
}
return encodeLong(c, length);
}
@ -150,7 +150,7 @@ public class kelondroBase64Order extends kelondroAbstractOrder implements kelond
s.setCharAt(--length, alpha[(byte) (c & 0x3F)]);
c >>= 6;
}
return s.toString();
return new String(s);
}
public final void encodeLong(long c, byte[] b, int offset, int length) {
@ -208,7 +208,7 @@ public class kelondroBase64Order extends kelondroAbstractOrder implements kelond
if (in.length % 3 != 0) out = out.append((in.length % 3 == 2) ? encodeLong((((0XffL & (long) in[pos]) << 8) + (0XffL & (long) in[pos + 1])) << 8, 4).substring(0, 3) : encodeLong((((0XffL & (long) in[pos])) << 8) << 8, 4).substring(0, 2));
if (rfc1113compliant) while (out.length() % 4 > 0) out.append("=");
// return result
return out.toString();
return new String(out);
}
public final String decodeString(String in) {

@ -101,7 +101,7 @@ public class kelondroBitfield implements Cloneable {
public String toString() {
StringBuffer sb = new StringBuffer(length());
for (int i = length() - 1; i >= 0; i--) sb.append((this.get(i)) ? '1' : '0');
return sb.toString();
return new String(sb);
}
public boolean equals(kelondroBitfield x) {

Loading…
Cancel
Save