You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by se...@apache.org on 2008/05/28 17:15:40 UTC
svn commit: r660975 - in
/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio:
protocol/ util/
Author: sebb
Date: Wed May 28 08:15:39 2008
New Revision: 660975
URL: http://svn.apache.org/viewvc?rev=660975&view=rev
Log:
Fix up ineffecient new Integer() constructs; remove unnecessary casts
Modified:
httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java
httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java
httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java
httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java
httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/util/TestBuffers.java
Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java?rev=660975&r1=660974&r2=660975&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java Wed May 28 08:15:39 2008
@@ -267,9 +267,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -280,7 +280,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -299,7 +299,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -411,9 +411,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -436,7 +436,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -448,7 +448,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -562,9 +562,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -587,7 +587,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -599,7 +599,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -720,9 +720,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -744,7 +744,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -756,7 +756,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -873,9 +873,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -898,7 +898,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -910,7 +910,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -1035,9 +1035,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1060,7 +1060,7 @@
EncodingUtils.getAsciiBytes("No content"));
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1072,7 +1072,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
HttpEntity entity = response.getEntity();
if (entity != null) {
@@ -1186,9 +1186,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1206,7 +1206,7 @@
BasicHttpRequest request = null;
if (i < reqNo) {
request = new BasicHttpRequest(method[0], "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return request;
}
@@ -1218,7 +1218,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
list.addResponse(response);
requestCount.decrement();
@@ -1351,9 +1351,9 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1364,7 +1364,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -1383,7 +1383,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -1482,8 +1482,8 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1494,7 +1494,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -1512,7 +1512,7 @@
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -1585,7 +1585,7 @@
new Thread() {
@Override
public void run() {
- try { Thread.sleep(10); } catch(InterruptedException ie) {};
+ try { Thread.sleep(10); } catch(InterruptedException ie) {}
try {
URI uri = new URI(request.getRequestLine().getUri());
trigger.handleException(new HttpException("Error: " + uri.getQuery()));
@@ -1601,8 +1601,8 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1613,7 +1613,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -1631,7 +1631,7 @@
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -1695,8 +1695,8 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1707,7 +1707,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -1725,7 +1725,7 @@
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
if(response.getStatusLine().getStatusCode() == 501)
requestCount.decrement();
@@ -1812,8 +1812,8 @@
NHttpRequestExecutionHandler requestExecutionHandler = new NHttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1831,7 +1831,7 @@
BasicHttpEntityEnclosingRequest post = null;
if (i < reqNo) {
post = new BasicHttpEntityEnclosingRequest("POST", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1842,7 +1842,7 @@
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java?rev=660975&r1=660974&r2=660975&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java Wed May 28 08:15:39 2008
@@ -231,9 +231,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -244,7 +244,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -256,7 +256,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -363,9 +363,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -381,7 +381,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -393,7 +393,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -499,9 +499,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -517,7 +517,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -529,7 +529,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -644,9 +644,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -661,7 +661,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -673,7 +673,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -782,9 +782,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -800,7 +800,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -812,7 +812,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -932,9 +932,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -950,7 +950,7 @@
EncodingUtils.getAsciiBytes("No content"));
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -962,7 +962,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
HttpEntity entity = response.getEntity();
if (entity != null) {
@@ -1069,9 +1069,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1082,7 +1082,7 @@
BasicHttpRequest request = null;
if (i < reqNo) {
request = new BasicHttpRequest(method[0], "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return request;
}
@@ -1094,7 +1094,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
list.addResponse(response);
requestCount.decrement();
Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java?rev=660975&r1=660974&r2=660975&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java Wed May 28 08:15:39 2008
@@ -136,9 +136,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -149,7 +149,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -161,7 +161,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -270,9 +270,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -287,7 +287,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(bytes);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -299,7 +299,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -407,9 +407,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -425,7 +425,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -437,7 +437,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -554,9 +554,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -571,7 +571,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(bytes);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -583,7 +583,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -695,9 +695,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -713,7 +713,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -725,7 +725,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java?rev=660975&r1=660974&r2=660975&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java Wed May 28 08:15:39 2008
@@ -255,9 +255,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -268,7 +268,7 @@
BasicHttpRequest get = null;
if (i < reqNo) {
get = new BasicHttpRequest("GET", "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return get;
}
@@ -280,7 +280,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -392,9 +392,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -410,7 +410,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -422,7 +422,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -533,9 +533,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -551,7 +551,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -563,7 +563,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -827,9 +827,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -844,7 +844,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -856,7 +856,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -970,9 +970,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ByteSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -988,7 +988,7 @@
outgoing.setChunked(true);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1000,7 +1000,7 @@
ByteSequence list = (ByteSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
try {
HttpEntity entity = response.getEntity();
@@ -1122,9 +1122,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1140,7 +1140,7 @@
EncodingUtils.getAsciiBytes("No content"));
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1152,7 +1152,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
HttpEntity entity = response.getEntity();
if (entity != null) {
@@ -1264,9 +1264,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1277,7 +1277,7 @@
BasicHttpRequest request = null;
if (i < reqNo) {
request = new BasicHttpRequest(method[0], "/?" + i);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return request;
}
@@ -1289,7 +1289,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
list.addResponse(response);
requestCount.decrement();
@@ -1408,9 +1408,9 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("LIST", (ResponseSequence) attachment);
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("LIST", attachment);
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1426,7 +1426,7 @@
outgoing.setChunked(i % 2 == 0);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1438,7 +1438,7 @@
ResponseSequence list = (ResponseSequence) context.getAttribute("LIST");
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
HttpEntity entity = response.getEntity();
if (entity != null) {
@@ -1539,8 +1539,8 @@
HttpRequestExecutionHandler requestExecutionHandler = new HttpRequestExecutionHandler() {
public void initalizeContext(final HttpContext context, final Object attachment) {
- context.setAttribute("REQ-COUNT", new Integer(0));
- context.setAttribute("RES-COUNT", new Integer(0));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(0));
+ context.setAttribute("RES-COUNT", Integer.valueOf(0));
}
public void finalizeContext(final HttpContext context) {
@@ -1558,7 +1558,7 @@
NByteArrayEntity outgoing = new NByteArrayEntity(data);
outgoing.setChunked(i % 2 == 0);
post.setEntity(outgoing);
- context.setAttribute("REQ-COUNT", new Integer(i + 1));
+ context.setAttribute("REQ-COUNT", Integer.valueOf(i + 1));
}
return post;
}
@@ -1569,7 +1569,7 @@
int i = ((Integer) context.getAttribute("RES-COUNT")).intValue();
i++;
- context.setAttribute("RES-COUNT", new Integer(i));
+ context.setAttribute("RES-COUNT", Integer.valueOf(i));
HttpEntity entity = response.getEntity();
if (entity != null) {
Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/util/TestBuffers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/util/TestBuffers.java?rev=660975&r1=660974&r2=660975&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/util/TestBuffers.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/util/TestBuffers.java Wed May 28 08:15:39 2008
@@ -137,7 +137,7 @@
public void testBufferInfo() throws Exception {
SimpleOutputBuffer buffer = new SimpleOutputBuffer(8, new DirectByteBufferAllocator());
- BufferInfo bufferinfo = (BufferInfo) buffer;
+ BufferInfo bufferinfo = buffer;
assertEquals(0, bufferinfo.length());
assertEquals(8, bufferinfo.available());