hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r936330 - /httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java
Date Wed, 21 Apr 2010 14:39:11 GMT
Author: sebb
Date: Wed Apr 21 14:39:11 2010
New Revision: 936330

URL: http://svn.apache.org/viewvc?rev=936330&view=rev
Log:
Unnecessary casts

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java?rev=936330&r1=936329&r2=936330&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestHttpMessageParser.java
Wed Apr 21 14:39:11 2010
@@ -78,7 +78,7 @@ public class TestHttpMessageParser exten
         HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
         NHttpMessageParser<HttpRequest> requestParser = new DefaultHttpRequestParser(inbuf,
null, requestFactory, params);
         requestParser.fillBuffer(newChannel("GET /whatever HTTP/1.1\r\nSome header: stuff\r\n\r\n"));
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNotNull(request);
         assertEquals("/whatever", request.getRequestLine().getUri());
         assertEquals(1, request.getAllHeaders().length);
@@ -91,13 +91,13 @@ public class TestHttpMessageParser exten
         NHttpMessageParser<HttpRequest> requestParser = new DefaultHttpRequestParser(inbuf,
null, requestFactory, params);
 
         requestParser.fillBuffer(newChannel("GET /whatev"));
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("er HTTP/1.1\r"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\nSome header: stuff\r\n\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
 
         assertNotNull(request);
         assertEquals("/whatever", request.getRequestLine().getUri());
@@ -112,22 +112,22 @@ public class TestHttpMessageParser exten
         NHttpMessageParser<HttpRequest> requestParser = new DefaultHttpRequestParser(inbuf,
null, requestFactory, params);
 
         requestParser.fillBuffer(newChannel("GET /whatev"));
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("er HTTP/1.1\r"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\nSome header: stuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("   more\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\tstuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
 
         assertNotNull(request);
         assertEquals("/whatever", request.getRequestLine().getUri());
@@ -142,19 +142,19 @@ public class TestHttpMessageParser exten
         NHttpMessageParser<HttpRequest> requestParser = new DefaultHttpRequestParser(inbuf,
null, requestFactory, params);
 
         requestParser.fillBuffer(newChannel("GET /whatev"));
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("er HTTP/1.1\r"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\n  Some header: stuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("   more stuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
 
         assertNotNull(request);
         assertEquals("/whatever", request.getRequestLine().getUri());
@@ -169,22 +169,22 @@ public class TestHttpMessageParser exten
         NHttpMessageParser<HttpRequest> requestParser = new DefaultHttpRequestParser(inbuf,
null, requestFactory, params);
 
         requestParser.fillBuffer(newChannel("GET /whatev"));
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("er HTTP/1.1\r"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\n  Some header: stuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("      \r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("      more stuff\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNull(request);
         requestParser.fillBuffer(newChannel("\r\n"));
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
 
         assertNotNull(request);
         assertEquals("/whatever", request.getRequestLine().getUri());
@@ -201,7 +201,7 @@ public class TestHttpMessageParser exten
         ReadableByteChannel channel = newChannel("GET /whatever HTTP/1.0");
         requestParser.fillBuffer(channel);
         requestParser.fillBuffer(channel);
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNotNull(request);
         assertEquals(HttpVersion.HTTP_1_0, request.getRequestLine().getProtocolVersion());
     }
@@ -215,7 +215,7 @@ public class TestHttpMessageParser exten
         ReadableByteChannel channel = newChannel("GET /whatever HTTP/1.0\r\nHeader: whatever");
         requestParser.fillBuffer(channel);
         requestParser.fillBuffer(channel);
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNotNull(request);
         assertEquals(1, request.getAllHeaders().length);
         assertEquals("whatever", request.getFirstHeader("Header").getValue());
@@ -277,7 +277,7 @@ public class TestHttpMessageParser exten
         
         ReadableByteChannel channel = newChannel("GET /whatever HTTP/1.0\r\nHeader: one\r\n\r\n");
         requestParser.fillBuffer(channel);
-        HttpRequest request = (HttpRequest) requestParser.parse();
+        HttpRequest request = requestParser.parse();
         assertNotNull(request);
         assertEquals(1, request.getAllHeaders().length);
         assertEquals("one", request.getFirstHeader("Header").getValue());
@@ -286,7 +286,7 @@ public class TestHttpMessageParser exten
 
         channel = newChannel("GET /whatever HTTP/1.0\r\nHeader: two\r\n\r\n");
         requestParser.fillBuffer(channel);
-        request = (HttpRequest) requestParser.parse();
+        request = requestParser.parse();
         assertNotNull(request);
         assertEquals(1, request.getAllHeaders().length);
         assertEquals("two", request.getFirstHeader("Header").getValue());



Mime
View raw message