Skip to content

Commit eb78b3c

Browse files
qweekyschimke
authored andcommitted
fix google-java-format (#383)
fix repository resolution for gradle plugin fix formatting
1 parent 6debbb2 commit eb78b3c

22 files changed

Lines changed: 115 additions & 123 deletions

File tree

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ plugins {
2020
id "com.jfrog.artifactory" version "4.4.18"
2121
}
2222

23+
repositories {
24+
jcenter()
25+
}
26+
2327
description = 'RSocket: stream oriented messaging passing with Reactive Stream semantics.'
2428

2529
subprojects {
@@ -54,7 +58,6 @@ subprojects {
5458
}
5559

5660
repositories {
57-
jcenter()
5861
maven { url 'http://repo.spring.io/milestone' }
5962
maven { url 'https://oss.jfrog.org/libs-snapshot' }
6063
maven { url 'https://dl.bintray.com/rsocket/RSocket' }

rsocket-core/src/main/java/io/rsocket/lease/Lease.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ default boolean isExpired() {
6363
/**
6464
* Checks if the lease is expired for the passed {@code now}.
6565
*
66-
* @param now current time in millis.
66+
* @param now current time in millis.
6767
* @return {@code true} if the lease has expired.
6868
*/
6969
default boolean isExpired(long now) {

rsocket-core/src/main/java/io/rsocket/util/PayloadImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public boolean hasMetadata() {
108108
}
109109

110110
/**
111-
* Static factory method for a text payload. Mainly looks better than "new PayloadImpl(data)"
111+
* Static factory method for a text payload. Mainly looks better than "new PayloadImpl(data)"
112112
*
113113
* @param data the data of the payload.
114114
* @return a payload.
@@ -118,7 +118,8 @@ public static Payload textPayload(String data) {
118118
}
119119

120120
/**
121-
* Static factory method for a text payload. Mainly looks better than "new PayloadImpl(data, metadata)"
121+
* Static factory method for a text payload. Mainly looks better than "new PayloadImpl(data,
122+
* metadata)"
122123
*
123124
* @param data the data of the payload.
124125
* @param metadata the metadata for the payload.

rsocket-core/src/test/java/io/rsocket/util/PayloadImplTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
import static org.hamcrest.Matchers.*;
1919

2020
import io.rsocket.Payload;
21-
import org.junit.Test;
22-
2321
import javax.annotation.Nullable;
22+
import org.junit.Test;
2423

2524
public class PayloadImplTest {
2625
public static final String DATA_VAL = "data";

rsocket-load-balancer/src/main/java/io/rsocket/client/LoadBalancedRSocketMono.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package io.rsocket.client;
1717

18+
import static io.rsocket.util.ExceptionUtil.noStacktrace;
19+
1820
import io.rsocket.Availability;
1921
import io.rsocket.Closeable;
2022
import io.rsocket.Payload;
@@ -29,6 +31,13 @@
2931
import io.rsocket.stat.Quantile;
3032
import io.rsocket.util.Clock;
3133
import io.rsocket.util.RSocketProxy;
34+
import java.nio.channels.ClosedChannelException;
35+
import java.util.*;
36+
import java.util.concurrent.ThreadLocalRandom;
37+
import java.util.concurrent.TimeUnit;
38+
import java.util.concurrent.atomic.AtomicBoolean;
39+
import java.util.concurrent.atomic.AtomicInteger;
40+
import java.util.concurrent.atomic.AtomicLong;
3241
import org.reactivestreams.Publisher;
3342
import org.reactivestreams.Subscriber;
3443
import org.reactivestreams.Subscription;
@@ -40,16 +49,6 @@
4049
import reactor.core.publisher.MonoProcessor;
4150
import reactor.core.publisher.Operators;
4251

43-
import java.nio.channels.ClosedChannelException;
44-
import java.util.*;
45-
import java.util.concurrent.ThreadLocalRandom;
46-
import java.util.concurrent.TimeUnit;
47-
import java.util.concurrent.atomic.AtomicBoolean;
48-
import java.util.concurrent.atomic.AtomicInteger;
49-
import java.util.concurrent.atomic.AtomicLong;
50-
51-
import static io.rsocket.util.ExceptionUtil.noStacktrace;
52-
5352
/**
5453
* An implementation of {@link Mono} that load balances across a pool of RSockets and emits one when
5554
* it is subscribed to

rsocket-load-balancer/src/main/java/io/rsocket/client/filter/BackupRequestSocket.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@
2020
import io.rsocket.stat.FrugalQuantile;
2121
import io.rsocket.stat.Quantile;
2222
import io.rsocket.util.Clock;
23-
import org.reactivestreams.Publisher;
24-
import org.reactivestreams.Subscriber;
25-
import org.reactivestreams.Subscription;
26-
import reactor.core.publisher.Flux;
27-
import reactor.core.publisher.Mono;
28-
2923
import java.util.concurrent.Executors;
3024
import java.util.concurrent.ScheduledExecutorService;
3125
import java.util.concurrent.ScheduledFuture;
3226
import java.util.concurrent.TimeUnit;
3327
import java.util.concurrent.atomic.AtomicBoolean;
3428
import java.util.function.Supplier;
29+
import org.reactivestreams.Publisher;
30+
import org.reactivestreams.Subscriber;
31+
import org.reactivestreams.Subscription;
32+
import reactor.core.publisher.Flux;
33+
import reactor.core.publisher.Mono;
3534

3635
public class BackupRequestSocket implements RSocket {
3736
private final ScheduledExecutorService executor;

rsocket-load-balancer/src/test/java/io/rsocket/client/TestingRSocket.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.reactivestreams.Publisher;
2525
import org.reactivestreams.Subscriber;
2626
import org.reactivestreams.Subscription;
27-
import reactor.core.CoreSubscriber;
2827
import reactor.core.publisher.*;
2928

3029
public class TestingRSocket implements RSocket {

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313

1414
package io.rsocket.tckdrivers.common;
1515

16+
import static java.util.stream.Collectors.toList;
17+
1618
import com.google.common.base.Throwables;
1719
import com.google.common.io.Files;
18-
import io.rsocket.tckdrivers.client.JavaClientDriver;
19-
import io.rsocket.tckdrivers.server.JavaServerDriver;
2020
import java.io.File;
2121
import java.io.IOException;
2222
import java.nio.charset.StandardCharsets;
2323
import java.util.ArrayList;
24-
import java.util.Arrays;
2524
import java.util.List;
2625

27-
import static java.util.stream.Collectors.toList;
28-
2926
public class TckClientTest {
3027
public String name;
3128
public List<String> test;
@@ -75,7 +72,8 @@ private static String parseName(String nameLine) {
7572
return nameLine.split("%%")[1];
7673
}
7774

78-
@Override public String toString() {
75+
@Override
76+
public String toString() {
7977
return name;
8078
}
8179
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.rsocket.tckdrivers.common;
22

3+
import static java.util.stream.Collectors.toList;
4+
35
import com.google.common.base.Throwables;
46
import com.google.common.io.Files;
57
import io.rsocket.tckdrivers.server.JavaServerDriver;
@@ -10,8 +12,6 @@
1012
import java.util.Arrays;
1113
import java.util.List;
1214

13-
import static java.util.stream.Collectors.toList;
14-
1515
public class TckTestSuite {
1616
private String suiteName;
1717
private List<TckClientTest> clientTests = new ArrayList<>();
@@ -58,7 +58,8 @@ private static TckTestSuite extractTests(File serverFile) {
5858
}
5959
}
6060

61-
@Override public String toString() {
61+
@Override
62+
public String toString() {
6263
return suiteName;
6364
}
6465

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/runner/JsonUtil.java

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,45 @@
33
import com.fasterxml.jackson.core.type.TypeReference;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.google.common.base.Throwables;
6-
import io.rsocket.Closeable;
76
import io.rsocket.Payload;
8-
import reactor.core.Disposable;
9-
import reactor.core.publisher.Flux;
10-
import reactor.core.publisher.Mono;
11-
127
import java.io.IOException;
138
import java.util.Map;
149
import java.util.concurrent.atomic.AtomicReference;
15-
import java.util.function.Consumer;
10+
import reactor.core.Disposable;
11+
import reactor.core.publisher.Flux;
12+
import reactor.core.publisher.Mono;
1613

1714
public class JsonUtil {
18-
public static Map<String, Object> parseTCKMessage(Payload content, String messageType) {
19-
ObjectMapper mapper = new ObjectMapper();
20-
try {
21-
Map<String, Map<String, Object>> message = mapper.readValue(content.getDataUtf8(), new TypeReference<Map<String, Map<String, Object>>>() {
22-
});
23-
return message.get(messageType);
24-
} catch (IOException e) {
25-
throw Throwables.propagate(e);
26-
}
15+
public static Map<String, Object> parseTCKMessage(Payload content, String messageType) {
16+
ObjectMapper mapper = new ObjectMapper();
17+
try {
18+
Map<String, Map<String, Object>> message =
19+
mapper.readValue(
20+
content.getDataUtf8(), new TypeReference<Map<String, Map<String, Object>>>() {});
21+
return message.get(messageType);
22+
} catch (IOException e) {
23+
throw Throwables.propagate(e);
2724
}
25+
}
26+
27+
public static void main(String[] args) throws InterruptedException {
28+
Flux<String> server = Flux.just("1", "2", "3");
29+
30+
Flux<String> client =
31+
server.transform(
32+
s -> {
33+
AtomicReference<Disposable> closeable = new AtomicReference<>();
34+
Flux<String> hotServer = s.publish().autoConnect(1, closeable::set);
35+
36+
return hotServer
37+
.take(1)
38+
.single()
39+
.flatMap(x -> Mono.just(x + "a"))
40+
.doFinally(sig -> closeable.get().dispose());
41+
});
2842

29-
public static void main(String[] args) throws InterruptedException {
30-
Flux<String> server = Flux.just("1", "2", "3");
31-
32-
Flux<String> client = server.transform(s -> {
33-
AtomicReference<Disposable> closeable = new AtomicReference<>();
34-
Flux<String> hotServer = s.publish().autoConnect(1, closeable::set);
35-
36-
return hotServer.take(1).single().flatMap(x -> Mono.just(x + "a")).doFinally(sig -> closeable.get().dispose());
37-
});
38-
39-
System.out.println(client.blockFirst());
43+
System.out.println(client.blockFirst());
4044

41-
Thread.sleep(1000);
42-
}
45+
Thread.sleep(1000);
46+
}
4347
}

0 commit comments

Comments
 (0)