Skip to content

Commit 758dcf2

Browse files
committed
Switch to IntelliJ formatting rules
1 parent 4bb43e4 commit 758dcf2

File tree

360 files changed

+32422
-32826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+32422
-32826
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,7 @@ Of course, Pull Requests are welcome.
279279
Here a the few rules we'd like you to respect if you do so:
280280
281281
* Only edit the code related to the suggested change, so DON'T automatically format the classes you've edited.
282-
* Respect the formatting rules:
283-
* Indent with 4 spaces
284-
* Your PR can contain multiple commits when submitting, but once it's been reviewed, we'll ask you to squash them into a single one
282+
* Use IntelliJ default formatting rules.
285283
* Regarding licensing:
286284
* You must be the original author of the code you suggest.
287285
* You must give the copyright to "the AsyncHttpClient Project"

client/pom.xml

Lines changed: 70 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,73 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<parent>
3-
<groupId>org.asynchttpclient</groupId>
4-
<artifactId>async-http-client-project</artifactId>
5-
<version>2.1.1-SNAPSHOT</version>
6-
</parent>
7-
<modelVersion>4.0.0</modelVersion>
8-
<artifactId>async-http-client</artifactId>
9-
<name>Asynchronous Http Client</name>
10-
<description>The Async Http Client (AHC) classes.</description>
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<parent>
4+
<groupId>org.asynchttpclient</groupId>
5+
<artifactId>async-http-client-project</artifactId>
6+
<version>2.1.1-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
<artifactId>async-http-client</artifactId>
10+
<name>Asynchronous Http Client</name>
11+
<description>The Async Http Client (AHC) classes.</description>
1112

12-
<build>
13-
<plugins>
14-
<plugin>
15-
<artifactId>maven-jar-plugin</artifactId>
16-
<executions>
17-
<execution>
18-
<goals>
19-
<goal>test-jar</goal>
20-
</goals>
21-
</execution>
22-
</executions>
23-
</plugin>
24-
</plugins>
25-
</build>
13+
<build>
14+
<plugins>
15+
<plugin>
16+
<artifactId>maven-jar-plugin</artifactId>
17+
<executions>
18+
<execution>
19+
<goals>
20+
<goal>test-jar</goal>
21+
</goals>
22+
</execution>
23+
</executions>
24+
</plugin>
25+
</plugins>
26+
</build>
2627

27-
<dependencies>
28-
<dependency>
29-
<groupId>org.asynchttpclient</groupId>
30-
<artifactId>async-http-client-netty-utils</artifactId>
31-
<version>${project.version}</version>
32-
</dependency>
33-
<dependency>
34-
<groupId>io.netty</groupId>
35-
<artifactId>netty-codec-http</artifactId>
36-
</dependency>
37-
<dependency>
38-
<groupId>io.netty</groupId>
39-
<artifactId>netty-handler</artifactId>
40-
</dependency>
41-
<dependency>
42-
<groupId>io.netty</groupId>
43-
<artifactId>netty-codec-socks</artifactId>
44-
</dependency>
45-
<dependency>
46-
<groupId>io.netty</groupId>
47-
<artifactId>netty-handler-proxy</artifactId>
48-
</dependency>
49-
<dependency>
50-
<groupId>io.netty</groupId>
51-
<artifactId>netty-transport-native-epoll</artifactId>
52-
<classifier>linux-x86_64</classifier>
53-
</dependency>
54-
<dependency>
55-
<groupId>io.netty</groupId>
56-
<artifactId>netty-resolver-dns</artifactId>
57-
</dependency>
58-
<dependency>
59-
<groupId>org.reactivestreams</groupId>
60-
<artifactId>reactive-streams</artifactId>
61-
</dependency>
62-
<dependency>
63-
<groupId>com.typesafe.netty</groupId>
64-
<artifactId>netty-reactive-streams</artifactId>
65-
</dependency>
66-
<dependency>
67-
<groupId>io.reactivex.rxjava2</groupId>
68-
<artifactId>rxjava</artifactId>
69-
<scope>test</scope>
70-
</dependency>
71-
</dependencies>
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.asynchttpclient</groupId>
31+
<artifactId>async-http-client-netty-utils</artifactId>
32+
<version>${project.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>io.netty</groupId>
36+
<artifactId>netty-codec-http</artifactId>
37+
</dependency>
38+
<dependency>
39+
<groupId>io.netty</groupId>
40+
<artifactId>netty-handler</artifactId>
41+
</dependency>
42+
<dependency>
43+
<groupId>io.netty</groupId>
44+
<artifactId>netty-codec-socks</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>io.netty</groupId>
48+
<artifactId>netty-handler-proxy</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>io.netty</groupId>
52+
<artifactId>netty-transport-native-epoll</artifactId>
53+
<classifier>linux-x86_64</classifier>
54+
</dependency>
55+
<dependency>
56+
<groupId>io.netty</groupId>
57+
<artifactId>netty-resolver-dns</artifactId>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.reactivestreams</groupId>
61+
<artifactId>reactive-streams</artifactId>
62+
</dependency>
63+
<dependency>
64+
<groupId>com.typesafe.netty</groupId>
65+
<artifactId>netty-reactive-streams</artifactId>
66+
</dependency>
67+
<dependency>
68+
<groupId>io.reactivex.rxjava2</groupId>
69+
<artifactId>rxjava</artifactId>
70+
<scope>test</scope>
71+
</dependency>
72+
</dependencies>
7273
</project>

client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java

Lines changed: 76 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.asynchttpclient;
1818

1919
import io.netty.handler.codec.http.HttpHeaders;
20-
2120
import org.asynchttpclient.handler.ProgressAsyncHandler;
2221
import org.slf4j.Logger;
2322
import org.slf4j.LoggerFactory;
@@ -29,100 +28,94 @@
2928
* callback, all doing nothing except returning
3029
* {@link org.asynchttpclient.AsyncHandler.State#CONTINUE}
3130
*
32-
* @param <T>
33-
* Type of the value that will be returned by the associated
31+
* @param <T> Type of the value that will be returned by the associated
3432
* {@link java.util.concurrent.Future}
3533
*/
3634
public abstract class AsyncCompletionHandler<T> implements AsyncHandler<T>, ProgressAsyncHandler<T> {
3735

38-
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncCompletionHandler.class);
39-
private final Response.ResponseBuilder builder = new Response.ResponseBuilder();
36+
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncCompletionHandler.class);
37+
private final Response.ResponseBuilder builder = new Response.ResponseBuilder();
4038

41-
@Override
42-
public State onStatusReceived(HttpResponseStatus status) throws Exception {
43-
builder.reset();
44-
builder.accumulate(status);
45-
return State.CONTINUE;
46-
}
39+
@Override
40+
public State onStatusReceived(HttpResponseStatus status) throws Exception {
41+
builder.reset();
42+
builder.accumulate(status);
43+
return State.CONTINUE;
44+
}
4745

48-
@Override
49-
public State onHeadersReceived(HttpHeaders headers) throws Exception {
50-
builder.accumulate(headers);
51-
return State.CONTINUE;
52-
}
46+
@Override
47+
public State onHeadersReceived(HttpHeaders headers) throws Exception {
48+
builder.accumulate(headers);
49+
return State.CONTINUE;
50+
}
5351

54-
@Override
55-
public State onBodyPartReceived(HttpResponseBodyPart content) throws Exception {
56-
builder.accumulate(content);
57-
return State.CONTINUE;
58-
}
52+
@Override
53+
public State onBodyPartReceived(HttpResponseBodyPart content) throws Exception {
54+
builder.accumulate(content);
55+
return State.CONTINUE;
56+
}
5957

60-
@Override
61-
public State onTrailingHeadersReceived(HttpHeaders headers) throws Exception {
62-
builder.accumulate(headers);
63-
return State.CONTINUE;
64-
}
58+
@Override
59+
public State onTrailingHeadersReceived(HttpHeaders headers) throws Exception {
60+
builder.accumulate(headers);
61+
return State.CONTINUE;
62+
}
6563

66-
@Override
67-
public final T onCompleted() throws Exception {
68-
return onCompleted(builder.build());
69-
}
64+
@Override
65+
public final T onCompleted() throws Exception {
66+
return onCompleted(builder.build());
67+
}
7068

71-
@Override
72-
public void onThrowable(Throwable t) {
73-
LOGGER.debug(t.getMessage(), t);
74-
}
69+
@Override
70+
public void onThrowable(Throwable t) {
71+
LOGGER.debug(t.getMessage(), t);
72+
}
7573

76-
/**
77-
* Invoked once the HTTP response processing is finished.
78-
*
79-
* @param response
80-
* The {@link Response}
81-
* @return T Value that will be returned by the associated
82-
* {@link java.util.concurrent.Future}
83-
* @throws Exception
84-
* if something wrong happens
85-
*/
86-
abstract public T onCompleted(Response response) throws Exception;
74+
/**
75+
* Invoked once the HTTP response processing is finished.
76+
*
77+
* @param response The {@link Response}
78+
* @return T Value that will be returned by the associated
79+
* {@link java.util.concurrent.Future}
80+
* @throws Exception if something wrong happens
81+
*/
82+
abstract public T onCompleted(Response response) throws Exception;
8783

88-
/**
89-
* Invoked when the HTTP headers have been fully written on the I/O socket.
90-
*
91-
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
92-
* or ABORT the current processing.
93-
*/
94-
@Override
95-
public State onHeadersWritten() {
96-
return State.CONTINUE;
97-
}
84+
/**
85+
* Invoked when the HTTP headers have been fully written on the I/O socket.
86+
*
87+
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
88+
* or ABORT the current processing.
89+
*/
90+
@Override
91+
public State onHeadersWritten() {
92+
return State.CONTINUE;
93+
}
9894

99-
/**
100-
* Invoked when the content (a {@link java.io.File}, {@link String} or
101-
* {@link java.io.InputStream} has been fully written on the I/O socket.
102-
*
103-
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
104-
* or ABORT the current processing.
105-
*/
106-
@Override
107-
public State onContentWritten() {
108-
return State.CONTINUE;
109-
}
95+
/**
96+
* Invoked when the content (a {@link java.io.File}, {@link String} or
97+
* {@link java.io.InputStream} has been fully written on the I/O socket.
98+
*
99+
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
100+
* or ABORT the current processing.
101+
*/
102+
@Override
103+
public State onContentWritten() {
104+
return State.CONTINUE;
105+
}
110106

111-
/**
112-
* Invoked when the I/O operation associated with the {@link Request} body as
113-
* been progressed.
114-
*
115-
* @param amount
116-
* The amount of bytes to transfer
117-
* @param current
118-
* The amount of bytes transferred
119-
* @param total
120-
* The total number of bytes transferred
121-
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
122-
* or ABORT the current processing.
123-
*/
124-
@Override
125-
public State onContentWriteProgress(long amount, long current, long total) {
126-
return State.CONTINUE;
127-
}
107+
/**
108+
* Invoked when the I/O operation associated with the {@link Request} body as
109+
* been progressed.
110+
*
111+
* @param amount The amount of bytes to transfer
112+
* @param current The amount of bytes transferred
113+
* @param total The total number of bytes transferred
114+
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
115+
* or ABORT the current processing.
116+
*/
117+
@Override
118+
public State onContentWriteProgress(long amount, long current, long total) {
119+
return State.CONTINUE;
120+
}
128121
}

client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
* Simple {@link AsyncHandler} of type {@link Response}
2222
*/
2323
public class AsyncCompletionHandlerBase extends AsyncCompletionHandler<Response> {
24-
/**
25-
* {@inheritDoc}
26-
*/
27-
@Override
28-
public Response onCompleted(Response response) throws Exception {
29-
return response;
30-
}
24+
/**
25+
* {@inheritDoc}
26+
*/
27+
@Override
28+
public Response onCompleted(Response response) throws Exception {
29+
return response;
30+
}
3131
}

0 commit comments

Comments
 (0)