Findbugs all over #2

Mostly char encoding
Use StringWriter rather than OSW->BAOS->String
This commit is contained in:
zzz
2015-07-12 16:06:49 +00:00
parent 914cc120ad
commit 1f9bb046f5
25 changed files with 76 additions and 68 deletions

View File

@ -1,20 +1,19 @@
package net.i2p.router.web;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
public class ConfigPeerHelper extends HelperBase {
public ConfigPeerHelper() {}
public String getBlocklistSummary() {
ByteArrayOutputStream baos = new ByteArrayOutputStream(4*1024);
StringWriter sw = new StringWriter(4*1024);
try {
_context.blocklist().renderStatusHTML(new OutputStreamWriter(baos));
_context.blocklist().renderStatusHTML(sw);
} catch (IOException ioe) {
ioe.printStackTrace();
}
return new String(baos.toByteArray());
return sw.toString();
}
}