No warning

No warning, if there's a warning, it cannot be called good code
This commit is contained in:
coderfengyun 2014-08-29 08:55:12 +08:00
parent bb12e44f1b
commit ccc212b13f
2 changed files with 7 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import java.nio.charset.Charset;
import java.util.StringTokenizer;
import org.apache.commons.httpclient.ChunkedInputStream;
import org.apache.commons.httpclient.ChunkedOutputStream;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.log4j.Logger;
@ -172,13 +171,13 @@ public class ResponseParser {
ChunkedInputStream chunkedIS = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
chunkedIS = new ChunkedInputStream(in);
int tempByte;
while ((tempByte = chunkedIS.read()) != -1){
while ((tempByte = chunkedIS.read()) != -1) {
out.write(tempByte);
}
return out.toByteArray();
} catch (IOException e) {
// TODO Auto-generated catch block
@ -188,7 +187,7 @@ public class ResponseParser {
if (chunkedIS != null) {
chunkedIS.close();
}
if(out != null){
if (out != null) {
out.close();
}
} catch (IOException e) {

View File

@ -1,7 +1,6 @@
package org.bench4q.recorder;
import java.io.IOException;
import java.net.ServerSocket;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
@ -15,6 +14,7 @@ import org.junit.Test;
public class Test_RequestHandler {
private static final int PORT = 8910;
@Test
public void test() {
try {
@ -34,6 +34,8 @@ public class Test_RequestHandler {
private static class SendRequest implements Runnable {
private HttpClient httpClient = new HttpClient();
@SuppressWarnings("deprecation")
public void run() {
HostConfiguration hostConfiguration = new HostConfiguration();
hostConfiguration.setProxy("127.0.0.1", PORT);