Permalink
Browse files

tabs -> spaces; removed trailing whilespaces; updated stylecheck defi…

…nitions

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk@1425285 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent bf40506 commit 20da309ce1c06cc4c86b73c8f957782958968edc @ok2c ok2c committed Dec 22, 2012
Showing with 210 additions and 211 deletions.
  1. +15 −16 hc-checkstyle.xml
  2. +1 −1 httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkConnection.java
  3. +5 −5 httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
  4. +2 −2 httpcore-ab/src/main/java/org/apache/http/benchmark/CountingInputStream.java
  5. +2 −2 httpcore-ab/src/main/java/org/apache/http/benchmark/CountingOutputStream.java
  6. +1 −1 httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
  7. +1 −1 httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
  8. +1 −1 httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLMode.java
  9. +1 −1 httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionHandle.java
  10. +1 −1 httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageParserFactory.java
  11. +1 −1 httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageWriterFactory.java
  12. +1 −1 httpcore-nio/src/main/java/org/apache/http/nio/entity/ContentListener.java
  13. +3 −3 httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java
  14. +1 −1 httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java
  15. +1 −1 httpcore-nio/src/main/java/org/apache/http/nio/reactor/SocketAccessor.java
  16. +6 −6 httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
  17. +20 −20 httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java
  18. +4 −4 httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestUriHttpAsyncRequestHandlerMapper.java
  19. +9 −9 httpcore/src/main/java/org/apache/http/entity/ContentType.java
  20. +2 −2 httpcore/src/main/java/org/apache/http/entity/StringEntity.java
  21. +1 −1 httpcore/src/main/java/org/apache/http/impl/entity/DisallowIdentityContentLengthStrategy.java
  22. +1 −1 httpcore/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java
  23. +1 −1 httpcore/src/main/java/org/apache/http/impl/entity/EntitySerializer.java
  24. +3 −3 httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageWriter.java
  25. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
  26. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java
  27. +5 −5 httpcore/src/main/java/org/apache/http/impl/io/ChunkedOutputStream.java
  28. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/HttpRequestParser.java
  29. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/HttpRequestWriter.java
  30. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/HttpResponseParser.java
  31. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/HttpResponseWriter.java
  32. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/SessionInputBufferImpl.java
  33. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java
  34. +1 −1 httpcore/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java
  35. +1 −1 httpcore/src/main/java/org/apache/http/io/EofSensor.java
  36. +1 −1 httpcore/src/main/java/org/apache/http/io/HttpMessageParserFactory.java
  37. +1 −1 httpcore/src/main/java/org/apache/http/io/HttpMessageWriterFactory.java
  38. +2 −2 httpcore/src/main/java/org/apache/http/io/SessionInputBuffer.java
  39. +3 −3 httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
  40. +1 −1 httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java
  41. +1 −1 httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java
  42. +1 −1 httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java
  43. +1 −1 httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java
  44. +1 −1 httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
  45. +3 −3 httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
  46. +29 −29 httpcore/src/main/java/org/apache/http/pool/PoolStats.java
  47. +1 −1 httpcore/src/main/java/org/apache/http/protocol/HTTP.java
  48. +1 −1 httpcore/src/main/java/org/apache/http/protocol/RequestContent.java
  49. +1 −1 httpcore/src/main/java/org/apache/http/protocol/ResponseContent.java
  50. +1 −1 httpcore/src/main/java/org/apache/http/protocol/SyncBasicHttpContext.java
  51. +1 −1 httpcore/src/main/java/org/apache/http/protocol/UriHttpRequestHandlerMapper.java
  52. +10 −10 httpcore/src/main/java/org/apache/http/util/Args.java
  53. +2 −2 httpcore/src/main/java/org/apache/http/util/Asserts.java
  54. +5 −5 httpcore/src/main/java/org/apache/http/util/EntityUtils.java
  55. +21 −21 httpcore/src/main/java/org/apache/http/util/VersionInfo.java
  56. +3 −3 httpcore/src/test/java/org/apache/http/impl/SessionInputBufferMock.java
  57. +4 −4 httpcore/src/test/java/org/apache/http/impl/SessionOutputBufferMock.java
  58. +2 −2 httpcore/src/test/java/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
  59. +2 −2 httpcore/src/test/java/org/apache/http/impl/io/TestSessionInOutBuffers.java
  60. +4 −4 httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
  61. +1 −1 httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
  62. +4 −4 httpcore/src/test/java/org/apache/http/protocol/TestUriHttpRequestHandlerMapper.java
  63. +2 −2 httpcore/src/test/java/org/apache/http/testserver/LoggingBHttpClientConnection.java
  64. +2 −2 httpcore/src/test/java/org/apache/http/testserver/LoggingBHttpServerConnection.java
View
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
@@ -33,12 +33,11 @@
<module name="FileLength">
<property name="max" value="3000" />
</module>
- <!--<module name="FileTabCharacter">
+ <module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="[ \t]+$"/>
<property name="message" value="Trailing whitespace"/>
</module>
- -->
</module>
@@ -36,7 +36,7 @@
class BenchmarkConnection extends DefaultBHttpClientConnection {
private final Stats stats;
-
+
BenchmarkConnection(int bufsize, final Stats stats) {
super(bufsize);
this.stats = stats;
@@ -86,8 +86,8 @@ public BenchmarkWorker(
this.targetHost = targetHost;
this.config = config;
this.httpProcessor = new ImmutableHttpProcessor(
- new RequestContent(),
- new RequestTargetHost(),
+ new RequestContent(),
+ new RequestTargetHost(),
new RequestConnControl(),
new RequestUserAgent("HttpCore-AB/1.1"),
new RequestExpectContinue());
@@ -122,18 +122,18 @@ public void run() {
try {
resetHeader(request);
if (!conn.isOpen()) {
-
+
Socket socket;
if (socketFactory != null) {
socket = socketFactory.createSocket();
} else {
socket = new Socket();
}
-
+
int timeout = config.getSocketTimeout();
socket.setSoTimeout(timeout);
socket.connect(new InetSocketAddress(hostname, port), timeout);
-
+
conn.bind(socket);
}
@@ -33,7 +33,7 @@
class CountingInputStream extends FilterInputStream {
private final Stats stats;
-
+
CountingInputStream(final InputStream instream, final Stats stats) {
super(instream);
this.stats = stats;
@@ -74,5 +74,5 @@ public long skip(long n) throws IOException {
}
return bytesRead;
}
-
+
}
@@ -33,7 +33,7 @@
class CountingOutputStream extends FilterOutputStream {
private final Stats stats;
-
+
CountingOutputStream(final OutputStream outstream, final Stats stats) {
super(outstream);
this.stats = stats;
@@ -56,5 +56,5 @@ public void write(byte[] b, int off, int len) throws IOException {
this.out.write(b, off, len);
this.stats.incTotalBytesSent(len);
}
-
+
}
@@ -137,7 +137,7 @@ public void closed(final NHttpServerConnection conn) {
KeyManager[] keymanagers = kmfactory.getKeyManagers();
SSLContext sslcontext = SSLContext.getInstance("TLS");
sslcontext.init(keymanagers, null, null);
- connFactory = new SSLNHttpServerConnectionFactory(sslcontext,
+ connFactory = new SSLNHttpServerConnectionFactory(sslcontext,
null, ConnectionConfig.DEFAULT);
} else {
connFactory = new DefaultNHttpServerConnectionFactory(
@@ -353,7 +353,7 @@ public synchronized String toString() {
buffer.append("]");
return buffer.toString();
}
-
+
public Socket getSocket() {
Channel channel = this.channel;
if (channel instanceof SocketChannel) {
@@ -29,7 +29,7 @@
/**
* @since 4.0
- *
+ *
* @deprecated (4.2)
*/
@Deprecated
@@ -36,7 +36,7 @@
* operations on that session.
*
* @since 4.0
- *
+ *
* @deprecated (4.2) use {@link IOSessionImpl}
*/
@Deprecated
@@ -33,7 +33,7 @@
/**
* Factory for {@link NHttpMessageParser} instances.
- *
+ *
* @since 4.3
*/
public interface NHttpMessageParserFactory<T extends HttpMessage> {
@@ -32,7 +32,7 @@
/**
* Factory for {@link NHttpMessageWriter} instances.
- *
+ *
* @since 4.3
*/
public interface NHttpMessageWriterFactory<T extends HttpMessage> {
@@ -36,7 +36,7 @@
* A listener for available data on a non-blocking {@link ConsumingNHttpEntity}.
*
* @since 4.0
- *
+ *
* @deprecated (4.2)
*/
@Deprecated
@@ -73,7 +73,7 @@
* Creates a NStringEntity with the specified content and content type.
*
* @param s content to be used. Not {@code null}.
- * @param contentType content type to be used. May be {@code null}, in which case
+ * @param contentType content type to be used. May be {@code null}, in which case
* {@link ContentType#TEXT_PLAIN} is assumed.
*
* @throws IllegalArgumentException if the string parameter is null
@@ -109,7 +109,7 @@ public NStringEntity(final String s, final ContentType contentType) {
* is {@link HTTP#DEF_CONTENT_CHARSET} is assumed
*
* @throws IllegalArgumentException if the string parameter is null
- * @throws UnsupportedCharsetException Thrown when the named charset is not available in
+ * @throws UnsupportedCharsetException Thrown when the named charset is not available in
* this instance of the Java virtual machine
*/
public NStringEntity(final String s, final String charset)
@@ -126,7 +126,7 @@ public NStringEntity(final String s, final String charset)
* is {@link HTTP#DEF_CONTENT_CHARSET} is assumed
*
* @throws IllegalArgumentException if the string parameter is null
- *
+ *
* @since 4.2
*/
public NStringEntity(final String s, final Charset charset) {
@@ -98,7 +98,7 @@ protected String getRequestPath(final HttpRequest request) {
}
return uriPath;
}
-
+
/**
* Looks up a handler matching the given request URI.
*
@@ -38,7 +38,7 @@
/**
* Return the underlying socket
- *
+ *
* @return - the underlying Socket, may be <code>null</code>.
*/
Socket getSocket();
@@ -588,13 +588,13 @@ public String toString() {
buffer.append("]");
return buffer.toString();
}
-
+
public Socket getSocket(){
- if (this.session instanceof SocketAccessor){
- return ((SocketAccessor) this.session).getSocket();
- } else {
- return null;
- }
+ if (this.session instanceof SocketAccessor){
+ return ((SocketAccessor) this.session).getSocket();
+ } else {
+ return null;
+ }
}
private class InternalByteChannel implements ByteChannel {
@@ -90,10 +90,10 @@ public void tearDown() throws Exception {
@Test
public void testResponsePrematureTermination() throws Exception {
-
+
final CountDownLatch latch = new CountDownLatch(1);
final HttpAsyncResponseProducer responseProducer = new HttpAsyncResponseProducer() {
-
+
public HttpResponse generateResponse() {
HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -102,25 +102,25 @@ public HttpResponse generateResponse() {
response.setEntity(entity);
return response;
}
-
+
public void close() throws IOException {
latch.countDown();
}
-
+
public void responseCompleted(final HttpContext context) {
}
-
+
public void produceContent(
final ContentEncoder encoder, final IOControl ioctrl) throws IOException {
// suspend output
ioctrl.suspendOutput();
}
-
+
public void failed(final Exception ex) {
}
};
-
+
UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {
@@ -131,13 +131,13 @@ public void failed(final Exception ex) {
}
public void handle(
- final HttpRequest data,
- final HttpAsyncExchange httpExchange,
+ final HttpRequest data,
+ final HttpAsyncExchange httpExchange,
final HttpContext context)
throws HttpException, IOException {
httpExchange.submitResponse(responseProducer);
}
-
+
});
this.server.start(registry);
@@ -154,9 +154,9 @@ public void handle(
writer.write("Host: localhost\r\n");
writer.write("\r\n");
writer.flush();
-
+
Thread.sleep(250);
-
+
writer.close();
} finally {
socket.close();
@@ -167,16 +167,16 @@ public void handle(
@Test
public void testRequestCancelled() throws Exception {
-
+
final CountDownLatch latch = new CountDownLatch(1);
final Cancellable cancellable = new Cancellable() {
-
+
public boolean cancel() {
latch.countDown();
return true;
}
};
-
+
UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {
@@ -187,14 +187,14 @@ public boolean cancel() {
}
public void handle(
- final HttpRequest data,
- final HttpAsyncExchange httpExchange,
+ final HttpRequest data,
+ final HttpAsyncExchange httpExchange,
final HttpContext context)
throws HttpException, IOException {
httpExchange.setCallback(cancellable);
// do not submit a response;
}
-
+
});
this.server.start(registry);
@@ -211,9 +211,9 @@ public void handle(
writer.write("Host: localhost\r\n");
writer.write("\r\n");
writer.flush();
-
+
Thread.sleep(250);
-
+
writer.close();
} finally {
socket.close();
Oops, something went wrong.

0 comments on commit 20da309

Please sign in to comment.