8000 google-java-format 1.4 by qweek · Pull Request #408 · rsocket/rsocket-java · GitHub
[go: up one dir, main page]

Skip to content

google-java-format 1.4 #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ description = 'RSocket: stream oriented messaging passing with Reactive Stream s

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

googleJavaFormat {
toolVersion = '1.4'
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
Expand Down
4 changes: 2 additions & 2 deletions rsocket-core/src/jmh/java/io/rsocket/FragmentationPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@Fork(
value = 1,
jvmArgsAppend = {"-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder"}
) //, "-Dio.netty.leakDetection.level=advanced"})
) // , "-Dio.netty.leakDetection.level=advanced"})
@Warmup(iterations = 10)
@Measurement(iterations = 10_000)
@State(Scope.Thread)
Expand Down Expand Up @@ -84,7 +84,7 @@ public void smallFragmentationFrameReassembler(Input input) {
Frame frame = smallFragmentAssembler.reassemble();
input.bh.consume(frame);
frame.release();
//input.smallFragmentAssembler.clear();
// input.smallFragmentAssembler.clear();
}

private static ByteBuffer createRandomBytes(int size) {
Expand Down
3 changes: 2 additions & 1 deletion rsocket-core/src/main/java/io/rsocket/RSocketClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class RSocketClient implements RSocket {
this.receivers = new IntObjectHashMap<>(256, 0.9f);
this.missedAckCounter = new AtomicInteger();

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

if (!Duration.ZERO.equals(tickPeriod)) {
Expand Down
3 changes: 2 additions & 1 deletion rsocket-core/src/main/java/io/rsocket/RSocketServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class RSocketServer implements RSocket {
this.sendingSubscriptions = new IntObjectHashMap<>();
this.channelProcessors = new IntObjectHashMap<>();

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

connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ public static void encodeLength(final ByteBuf byteBuf, final int offset, final i
if ((length & ~FRAME_LENGTH_MASK) != 0) {
throw new IllegalArgumentException("Length is larger than 24 bits");
}
// Write each byte separately in reverse order, this mean we can write 1 << 23 without overflowing.
// Write each byte separately in reverse order, this mean we can write 1 << 23 without
// overflowing.
byteBuf.setByte(offset, length >> 16);
byteBuf.setByte(offset + 1, length >> 8);
byteBuf.setByte(offset + 2, length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static boolean isTracked(FrameType frameType) {
case REQUEST_STREAM:
case REQUEST_RESPONSE:
case FIRE_AND_FORGET:
//case METADATA_PUSH:
// case METADATA_PUSH:
case REQUEST_N:
case CANCEL:
case ERROR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ public void runTest(TckClientTest test) {
handleCancel(args);
break;
default:
// the default behavior is to just skip the line, so we can accommodate slight changes to the TCK
// the default behavior is to just skip the line, so we can accommodate slight changes to
// the TCK
break;
}
}
Expand Down Expand Up @@ -227,12 +228,14 @@ private void handleChannel(String[] args, Iterator<String> iter, String name, bo
// set the initial payload
Payload initialPayload = new PayloadImpl(args[2], args[3]);

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

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

private void handleEOF() {
MySubscriber<Void> fnfsub = new MySubscriber<>(0L, AGENT);
//if (clientMap.size() > 0) {
// if (clientMap.size() > 0) {
// // Use any Client to send shutdown msg to the server
// RSocket fnfclient = clientMap.get(clientMap.keySet().toArray()[0]);
// Publisher<Void> fnfpub = fnfclient.fireAndForget(new PayloadImpl("shutdown", "shutdown"));
// fnfpub.subscribe(fnfsub);
// fnfsub.request(1);
//}
// }
}

/** A subscription for channel, it handles request(n) by sort of faking an initial payload. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
/** This class handles everything that gets printed to the console */
public class ConsoleUtils {

private static final String ANSI_RESET = ""; //"\u001B[0m";
private static final String ANSI_RED = ""; //\u001B[31m";
private static final String ANSI_GREEN = ""; //\u001B[32m";
private static final String ANSI_CYAN = ""; //\u001B[36m";
private static final String ANSI_BLUE = ""; //\u001B[34m";
private static final String ANSI_RESET = ""; // "\u001B[0m";
private static final String ANSI_RED = ""; // \u001B[31m";
private static final String ANSI_GREEN = ""; // \u001B[32m";
private static final String ANSI_CYAN = ""; // \u001B[36m";
private static final String ANSI_BLUE = ""; // \u001B[34m";
private String agent;
private final boolean debugEnabled = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Copyright 2016 Netflix, Inc.
*
Expand Down Expand Up @@ -165,7 +164,8 @@ private void myPass(String message) {
consoleUtils.info("PASSED: " + message);
}

// there might be a race condition with take, so this behavior is defined as: either wait until we have received n
// there might be a race condition with take, so this behavior is defined as: either wait until we
// have received n
// myValues and then cancel, or cancel if we already have n myValues
public final void take(long n) {
if (values.size() >= n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public class JavaServerDriver {
private Map<Tuple<String, String>, String> requestResponseMarbles = new HashMap<>();
private Map<Tuple<String, String>, String> requestStreamMarbles = new HashMap<>();
private Map<Tuple<String, String>, String> requestSubscriptionMarbles = new HashMap<>();
// channel doesn't have an initial payload, but maybe the first payload sent can be viewed as the "initial"
// channel doesn't have an initial payload, but maybe the first payload sent can be viewed as the
// "initial"
private Map<Tuple<String, String>, List<String>> requestChannelCommands = new HashMap<>();
private Set<Tuple<String, String>> requestChannelFail = new HashSet<>();
private Set<Tuple<String, String>> requestEchoChannel = new HashSet<>();
Expand All @@ -56,7 +57,8 @@ public Flux<Payload> requestChannel(Publisher<Payload> payloads) {
try {
MySubscriber<Payload> sub = new MySubscriber<>(0L, "[SERVER]");
payloads.subscribe(sub);
// want to get equivalent of "initial payload" so we can route behavior, this might change in the future
// want to get equivalent of "initial payload" so we can route behavior, this
// might change in the future
sub.request(1);
sub.awaitAtLeast(1);
Tuple<String, String> initpayload =
Expand Down Expand Up @@ -93,7 +95,8 @@ public Flux<Payload> requestChannel(Publisher<Payload> payloads) {
s.onSubscribe(echoSubscription);
sub.setEcho(echoSubscription);
sub.request(
10000); // request a large number, which basically means the client can send whatever
10000); // request a large number, which basically means the client can
// send whatever
}
} catch (Exception e) {
assertNull("interrupted ", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void run() {
while (true) {
try {
int count = drain();
//if (count > 100) {
// if (count > 100) {
// System.out.println(name + " drained..." + count);
// }
idleStrategy.idle(count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,29 @@ public StringBuilder appendTo(final StringBuilder builder) {
}
builder.append(BLOCK_LENGTH);
builder.append("):");
//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'}}
//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'}}
// 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'}}
// 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'}}
builder.append("channelId=");
builder.append(channelId());
builder.append('|');
//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'}}
//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'}}
// 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'}}
// 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'}}
builder.append("serverSessionId=");
builder.append(serverSessionId());

Expand Down
Loading
0