8000 google-java-format 1.4 (#408) · chakra-coder/rsocket-java@41d3a45 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41d3a45

Browse files
qweekyschimke
authored andcommitted
google-java-format 1.4 (rsocket#408)
* google-java-format 1.4 upgrade google-java-format to version 1.4 * update format
1 parent 3d58a9c commit 41d3a45

File tree

16 files changed

+129
-47
lines changed

16 files changed

+129
-47
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ description = 'RSocket: stream oriented messaging passing with Reactive Stream s
3030

3131
buildScan { licenseAgreementUrl = 'https://gradle.com/terms-of-service'; licenseAgree = 'yes' }
3232

33+
googleJavaFormat {
34+
toolVersion = '1.4'
35+
}
36+
3337
subprojects {
3438
apply plugin: 'java'
3539
apply plugin: 'maven'

rsocket-core/src/jmh/java/io/rsocket/FragmentationPerf.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@Fork(
2222
value = 1,
2323
jvmArgsAppend = {"-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder"}
24-
) //, "-Dio.netty.leakDetection.level=advanced"})
24+
) // , "-Dio.netty.leakDetection.level=advanced"})
2525
@Warmup(iterations = 10)
2626
@Measurement(iterations = 10_000)
2727
@State(Scope.Thread)
@@ -84,7 +84,7 @@ public void smallFragmentationFrameReassembler(Input input) {
8484
Frame frame = smallFragmentAssembler.reassemble();
8585
input.bh.consume(frame);
8686
frame.release();
87-
//input.smallFragmentAssembler.clear();
87+
// input.smallFragmentAssembler.clear();
8888
}
8989

9090
private static ByteBuffer createRandomBytes(int size) {

rsocket-core/src/main/java/io/rsocket/RSocketClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class RSocketClient implements RSocket {
7979
this.receivers = new IntObjectHashMap<>(256, 0.9f);
8080
this.missedAckCounter = new AtomicInteger();
8181

82-
// DO NOT Change the order here. The Send processor must be subscribed to before receiving connections
82+
// DO NOT Change the order here. The Send processor must be subscribed to before receiving
83+
// connections
8384
this.sendProcessor = EmitterProcessor.create();
8485

8586
if (!Duration.ZERO.equals(tickPeriod)) {

rsocket-core/src/main/java/io/rsocket/RSocketServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class RSocketServer implements RSocket {
5656
this.sendingSubscriptions = new IntObjectHashMap<>();
5757
this.channelProcessors = new IntObjectHashMap<>();
5858

59-
// DO NOT Change the order here. The Send processor must be subscribed to before receiving connections
59+
// DO NOT Change the order here. The Send processor must be subscribed to before receiving
60+
// connections
6061
this.sendProcessor = EmitterProcessor.create();
6162

6263
connection

rsocket-core/src/main/java/io/rsocket/frame/FrameHeaderFlyweight.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ public static void encodeLength(final ByteBuf byteBuf, final int offset, final i
285285
if ((length & ~FRAME_LENGTH_MASK) != 0) {
286286
throw new IllegalArgumentException("Length is larger than 24 bits");
287287
}
288-
// Write each byte separately in reverse order, this mean we can write 1 << 23 without overflowing.
288+
// Write each byte separately in reverse order, this mean we can write 1 << 23 without
289+
// overflowing.
289290
byteBuf.setByte(offset, length >> 16);
290291
byteBuf.setByte(offset + 1, length >> 8);
291292
byteBuf.setByte(offset + 2, length);

rsocket-core/src/main/java/io/rsocket/resume/ResumeUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static boolean isTracked(FrameType frameType) {
1111
case REQUEST_STREAM:
1212
case REQUEST_RESPONSE:
1313
case FIRE_AND_FORGET:
14-
//case METADATA_PUSH:
14+
// case METADATA_PUSH:
1515
case REQUEST_N:
1616
case CANCEL:
1717
case ERROR:

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/client/JavaClientDriver.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ public void runTest(TckClientTest test) {
151151
handleCancel(args);
152152
break;
153153
default:
154-
// the default behavior is to just skip the line, so we can accommodate slight changes to the TCK
154+
// the default behavior is to just skip the line, so we can accommodate slight changes to
155+
// the TCK
155156
break;
156157
}
157158
}
@@ -227,12 +228,14 @@ private void handleChannel(String[] args, Iterator<String> iter, String name, bo
227228
// set the initial payload
228229
Payload initialPayload = new PayloadImpl(args[2], args[3]);
229230

230-
// this is the subscriber that will request data from the server, like all the other test subscribers
231+
// this is the subscriber that will request data from the server, like all the other test
232+
// subscribers
231233
MySubscriber<Payload> testsub = new MySubscriber<>(1L, AGENT);
232234
CountDownLatch c = new CountDownLatch(1);
233235

234236
// we now create the publisher that the server will subscribe to with its own subscriber
235-
// we want to give that subscriber a subscription that the client will use to send data to the server
237+
// we want to give that subscriber a subscription that the client will use to send data to the
238+
// server
236239
RSocket client = getClient(args[0]);
237240
AtomicReference<ParseChannelThread> mypct = new AtomicReference<>();
238241
Publisher<Payload> pub =
@@ -455,13 +458,13 @@ private void handleCancel(String[] args) {
455458

456459
private void handleEOF() {
457460
MySubscriber<Void> fnfsub = new MySubscriber<>(0L, AGENT);
458-
//if (clientMap.size() > 0) {
461+
// if (clientMap.size() > 0) {
459462
// // Use any Client to send shutdown msg to the server
460463
// RSocket fnfclient = clientMap.get(clientMap.keySet().toArray()[0]);
461464
// Publisher<Void> fnfpub = fnfclient.fireAndForget(new PayloadImpl("shutdown", "shutdown"));
462465
// fnfpub.subscribe(fnfsub);
463466
// fnfsub.request(1);
464-
//}
467+
// }
465468
}
466469

467470
/** A subscription for channel, it handles request(n) by sort of faking an initial payload. */

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/common/ConsoleUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
/** This class handles everything that gets printed to the console */
2020
public class ConsoleUtils {
2121

22-
private static final String ANSI_RESET = ""; //"\u001B[0m";
23-
private static final String ANSI_RED = ""; //\u001B[31m";
24-
private static final String ANSI_GREEN = ""; //\u001B[32m";
25-
private static final String ANSI_CYAN = ""; //\u001B[36m";
26-
private static final String ANSI_BLUE = ""; //\u001B[34m";
22+
private static final String ANSI_RESET = ""; // "\u001B[0m";
23+
private static final String ANSI_RED = ""; // \u001B[31m";
24+
private static final String ANSI_GREEN = ""; // \u001B[32m";
25+
private static final String ANSI_CYAN = ""; // \u001B[36m";
26+
private static final String ANSI_BLUE = ""; // \u001B[34m";
2727
private String agent;
2828
private final boolean debugEnabled = false;
2929

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/common/MySubscriber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Copyright 2016 Netflix, Inc.
43
*
@@ -165,7 +164,8 @@ private void myPass(String message) {
165164
consoleUtils.info("PASSED: " + message);
166165
}
167166

168-
// there might be a race condition with take, so this behavior is defined as: either wait until we have received n
167+
// there might be a race condition with take, so this behavior is defined as: either wait until we
168+
// have received n
169169
// myValues and then cancel, or cancel if we already have n myValues
170170
public final void take(long n) {
171171
if (values.size() >= n) {

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/server/JavaServerDriver.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class JavaServerDriver {
3636
private Map<Tuple<String, String>, String> requestResponseMarbles = new HashMap<>();
3737
private Map<Tuple<String, String>, String> requestStreamMarbles = new HashMap<>();
3838
private Map<Tuple<String, String>, String> requestSubscriptionMarbles = new HashMap<>();
39-
// channel doesn't have an initial payload, but maybe the first payload sent can be viewed as the "initial"
39+
// channel doesn't have an initial payload, but maybe the first payload sent can be viewed as the
40+
// "initial"
4041
private Map<Tuple<String, String>, List<String>> requestChannelCommands = new HashMap<>();
4142
private Set<Tuple<String, String>> requestChannelFail = new HashSet<>();
4243
private Set<Tuple<String, String>> requestEchoChannel = new HashSet<>();
@@ -56,7 +57,8 @@ public Flux<Payload> requestChannel(Publisher<Payload> payloads) {
5657
try {
5758
MySubscriber<Payload> sub = new MySubscriber<>(0L, "[SERVER]");
5859
payloads.subscribe(sub);
59-
// want to get equivalent of "initial payload" so we can route behavior, this might change in the future
60+
// want to get equivalent of "initial payload" so we can route behavior, this
61+
// might change in the future
6062
sub.request(1);
6163
sub.awaitAtLeast(1);
6264
Tuple<String, String> initpayload =
@@ -93,7 +95,8 @@ public Flux<Payload> requestChannel(Publisher<Payload> payloads) {
9395
s.onSubscribe(echoSubscription);
9496
sub.setEcho(echoSubscription);
9597
sub.request(
96-
10000); // request a large number, which basically means the client can send whatever
98+
10000); // request a large number, which basically means the client can
99+
// send whatever
97100
}
98101
} catch (Exception e) {
99102
assertNull("interrupted ", e.getMessage());

rsocket-transport-aeron/src/main/java/io/rsocket/aeron/internal/SingleThreadedEventLoop.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void run() {
7676
while (true) {
7777
try {
7878
int count = drain();
79-
//if (count > 100) {
79+
// if (count > 100) {
8080
// System.out.println(name + " drained..." + count);
8181
// }
8282
idleStrategy.idle(count);

rsocket-transport-aeron/src/main/java/io/rsocket/aeron/internal/reactivestreams/messages/AckConnectDecoder.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,29 @@ public StringBuilder appendTo(final StringBuilder builder) {
176176
}
177177
builder.append(BLOCK_LENGTH);
178178
builder.append("):");
179-
//Token{signal=BEGIN_FIELD, name='channelId', description='The AeronChannel id', id=1, version=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
180-
//Token{signal=ENCODING, name='int64', description='The AeronChannel id', id=-1, version=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
179+
// Token{signal=BEGIN_FIELD, name='channelId', description='The AeronChannel id', id=1,
180+
// version=0, encodedLength=0, offset=0, componentTokenCount=3,
181+
// encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN,
182+
// minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null',
183+
// epoch='unix', timeUnit=nanosecond, semanticType='null'}}
184+
// Token{signal=ENCODING, name='int64', description='The AeronChannel id', id=-1, version=0,
185+
// encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED,
186+
// primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null,
187+
// constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond,
188+
// semanticType='null'}}
181189
builder.append("channelId=");
182190
builder.append(channelId());
183191
builder.append('|');
184-
//Token{signal=BEGIN_FIELD, name='serverSessionId', description='The session id for the server publication', id=2, version=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
185-
//Token{signal=ENCODING, name='int32', description='The session id for the server publication', id=-1, version=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
192+
// Token{signal=BEGIN_FIELD, name='serverSessionId', description='The session id for the server
193+
// publication', id=2, version=0, encodedLength=0, offset=8, componentTokenCount=3,
194+
// encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN,
195+
// minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null',
196+
// epoch='unix', timeUnit=nanosecond, semanticType='null'}}
197+
// Token{signal=ENCODING, name='int32', description='The session id for the server publication',
198+
// id=-1, version=0, encodedLength=4, offset=8, componentTokenCount=1,
199+
// encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN,
200+
// minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null',
201+
// epoch='unix', timeUnit=nanosecond, semanticType='null'}}
186202
builder.append("serverSessionId=");
187203
builder.append(serverSessionId());
188204

0 commit comments

Comments
 (0)
0