Skip to content

Commit 49b82cb

Browse files
committed
Upgraded HC StyleCheck to version 3; fixed style-check violations (no functional changes)
1 parent aec14c4 commit 49b82cb

File tree

122 files changed

+381
-369
lines changed

Some content is hidden

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

122 files changed

+381
-369
lines changed

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/H2PseudoRequestHeaders.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
*/
3535
public final class H2PseudoRequestHeaders {
3636

37-
public static final String METHOD = ":method";
38-
public static final String SCHEME = ":scheme";
37+
public static final String METHOD = ":method";
38+
public static final String SCHEME = ":scheme";
3939
public static final String AUTHORITY = ":authority";
40-
public static final String PATH = ":path";
40+
public static final String PATH = ":path";
4141

4242
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/H2PseudoResponseHeaders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
*/
3535
public final class H2PseudoResponseHeaders {
3636

37-
public static final String STATUS = ":status";
37+
public static final String STATUS = ":status";
3838

3939
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/config/H2Config.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ public static H2Config.Builder custom() {
110110
return new Builder();
111111
}
112112

113-
private static final int INIT_HEADER_TABLE_SIZE = 4096;
114-
private static final boolean INIT_ENABLE_PUSH = true;
115-
private static final int INIT_MAX_FRAME_SIZE = FrameConsts.MIN_FRAME_SIZE;
116-
private static final int INIT_WINDOW_SIZE = 65535;
117-
private static final int INIT_CONCURRENT_STREAM = 250;
113+
private static final int INIT_HEADER_TABLE_SIZE = 4096;
114+
private static final boolean INIT_ENABLE_PUSH = true;
115+
private static final int INIT_MAX_FRAME_SIZE = FrameConsts.MIN_FRAME_SIZE;
116+
private static final int INIT_WINDOW_SIZE = 65535;
117+
private static final int INIT_CONCURRENT_STREAM = 250;
118118

119119
public static H2Config.Builder initial() {
120120
return new Builder()
@@ -153,7 +153,7 @@ public static class Builder {
153153
this.pushEnabled = INIT_ENABLE_PUSH;
154154
this.maxConcurrentStreams = INIT_CONCURRENT_STREAM;
155155
this.initialWindowSize = INIT_WINDOW_SIZE;
156-
this.maxFrameSize = FrameConsts.MIN_FRAME_SIZE * 4;
156+
this.maxFrameSize = FrameConsts.MIN_FRAME_SIZE * 4;
157157
this.maxHeaderListSize = FrameConsts.MAX_FRAME_SIZE;
158158
this.compressionEnabled = true;
159159
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/config/H2Param.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
*/
3434
public enum H2Param {
3535

36-
HEADER_TABLE_SIZE (0x1),
37-
ENABLE_PUSH (0x2),
38-
MAX_CONCURRENT_STREAMS (0x3),
39-
INITIAL_WINDOW_SIZE (0x4),
40-
MAX_FRAME_SIZE (0x5),
41-
MAX_HEADER_LIST_SIZE (0x6);
36+
HEADER_TABLE_SIZE(0x1),
37+
ENABLE_PUSH(0x2),
38+
MAX_CONCURRENT_STREAMS(0x3),
39+
INITIAL_WINDOW_SIZE(0x4),
40+
MAX_FRAME_SIZE(0x5),
41+
MAX_HEADER_LIST_SIZE(0x6);
4242

4343
int code;
4444

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/DefaultFrameFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ public RawFrame createHeaders(final int streamId, final ByteBuffer payload, fina
5050
@Override
5151
public RawFrame createContinuation(final int streamId, final ByteBuffer payload, final boolean endHeaders) {
5252
Args.positive(streamId, "Stream id");
53-
final int flags = (endHeaders ? FrameFlag.END_HEADERS.value : 0);
53+
final int flags = endHeaders ? FrameFlag.END_HEADERS.value : 0;
5454
return new RawFrame(FrameType.CONTINUATION.getValue(), flags, streamId, payload);
5555
}
5656

5757
@Override
5858
public RawFrame createPushPromise(final int streamId, final ByteBuffer payload, final boolean endHeaders) {
5959
Args.positive(streamId, "Stream id");
60-
final int flags = (endHeaders ? FrameFlag.END_HEADERS.value : 0);
60+
final int flags = endHeaders ? FrameFlag.END_HEADERS.value : 0;
6161
return new RawFrame(FrameType.PUSH_PROMISE.getValue(), flags, streamId, payload);
6262
}
6363

6464
@Override
6565
public RawFrame createData(final int streamId, final ByteBuffer payload, final boolean endStream) {
6666
Args.positive(streamId, "Stream id");
67-
final int flags = (endStream ? FrameFlag.END_STREAM.value : 0);
67+
final int flags = endStream ? FrameFlag.END_STREAM.value : 0;
6868
return new RawFrame(FrameType.DATA.getValue(), flags, streamId, payload);
6969
}
7070

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameFlag.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
*/
3434
public enum FrameFlag {
3535

36-
END_STREAM (0x01),
37-
ACK (0x01),
38-
END_HEADERS (0x04),
39-
PADDED (0x08),
40-
PRIORITY (0x20);
36+
END_STREAM(0x01),
37+
ACK(0x01),
38+
END_HEADERS(0x04),
39+
PADDED(0x08),
40+
PRIORITY(0x20);
4141

4242
final int value;
4343

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameType.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333
*/
3434
public enum FrameType {
3535

36-
DATA (0x00),
37-
HEADERS (0x01),
38-
PRIORITY (0x02),
39-
RST_STREAM (0x03),
40-
SETTINGS (0x04),
41-
PUSH_PROMISE (0x05),
42-
PING (0x06),
43-
GOAWAY (0x07),
44-
WINDOW_UPDATE (0x08),
45-
CONTINUATION (0x09);
36+
DATA(0x00),
37+
HEADERS(0x01),
38+
PRIORITY(0x02),
39+
RST_STREAM(0x03),
40+
SETTINGS(0x04),
41+
PUSH_PROMISE(0x05),
42+
PING(0x06),
43+
GOAWAY(0x07),
44+
WINDOW_UPDATE(0x08),
45+
CONTINUATION(0x09);
4646

4747
int value;
4848

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ HPackHeader decodeLiteralHeader(
238238
nameLen = decodeString(src, buf);
239239
name = buf.toString();
240240
} else {
241-
final HPackHeader existing = this.dynamicTable.getHeader(index);
241+
final HPackHeader existing = this.dynamicTable.getHeader(index);
242242
if (existing == null) {
243243
throw new HPackException("Invalid header index");
244244
}
@@ -258,7 +258,7 @@ HPackHeader decodeLiteralHeader(
258258
HPackHeader decodeIndexedHeader(final ByteBuffer src) throws HPackException {
259259

260260
final int index = decodeInt(src, 7);
261-
final HPackHeader existing = this.dynamicTable.getHeader(index);
261+
final HPackHeader existing = this.dynamicTable.getHeader(index);
262262
if (existing == null) {
263263
throw new HPackException("Invalid header index");
264264
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void encode(final ByteArrayBuffer out, final ByteBuffer src) {
6666
}
6767

6868
if (n > 0) {
69-
current <<= (8 - n);
70-
current |= (0xFF >>> n); // this should be EOS symbol
69+
current <<= 8 - n;
70+
current |= 0xFF >>> n; // this should be EOS symbol
7171
out.append((int) current);
7272
}
7373
}
@@ -93,8 +93,8 @@ void encode(final ByteArrayBuffer out, final CharSequence src, final int off, fi
9393
}
9494

9595
if (n > 0) {
96-
current <<= (8 - n);
97-
current |= (0xFF >>> n); // this should be EOS symbol
96+
current <<= 8 - n;
97+
current |= 0xFF >>> n; // this should be EOS symbol
9898
out.append((int) current);
9999
}
100100
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/DefaultH2RequestConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public List<Header> convert(final HttpRequest message) throws HttpException {
181181
headers.add(new BasicHeader(H2PseudoRequestHeaders.METHOD, message.getMethod(), false));
182182
if (optionMethod) {
183183
headers.add(new BasicHeader(H2PseudoRequestHeaders.AUTHORITY, message.getAuthority(), false));
184-
} else {
184+
} else {
185185
headers.add(new BasicHeader(H2PseudoRequestHeaders.SCHEME, message.getScheme(), false));
186186
if (message.getAuthority() != null) {
187187
headers.add(new BasicHeader(H2PseudoRequestHeaders.AUTHORITY, message.getAuthority(), false));

0 commit comments

Comments
 (0)