aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCarl Mastrangelo <notcarl@google.com>2018-09-14 13:52:29 -0700
committerGitHub <noreply@github.com>2018-09-14 13:52:29 -0700
commitb0f423295b4674cb5247a6143fd211b050ef0065 (patch)
treed08aeb9c76673564258fc3b178223fe2dbf969c0 /examples
parent6cf849a7ceb0b223a497dff02742b2f76e1cbaa7 (diff)
downloadgrpc-grpc-java-b0f423295b4674cb5247a6143fd211b050ef0065.tar.gz
all: use Java7 brackets
Diffstat (limited to 'examples')
-rw-r--r--examples/android/clientcache/app/src/test/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptorTest.java2
-rw-r--r--examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java2
-rw-r--r--examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java10
-rw-r--r--examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java2
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/android/clientcache/app/src/test/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptorTest.java b/examples/android/clientcache/app/src/test/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptorTest.java
index 4fd5bdb0c..63e8a3290 100644
--- a/examples/android/clientcache/app/src/test/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptorTest.java
+++ b/examples/android/clientcache/app/src/test/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptorTest.java
@@ -79,7 +79,7 @@ public class SafeMethodCachingInterceptorTest {
}
};
- private final List<String> cacheControlDirectives = new ArrayList<String>();
+ private final List<String> cacheControlDirectives = new ArrayList<>();
private ServerInterceptor injectCacheControlInterceptor =
new ServerInterceptor() {
@Override
diff --git a/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java b/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java
index 1a223bf04..f892057fe 100644
--- a/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java
+++ b/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java
@@ -261,7 +261,7 @@ public class RouteGuideActivity extends AppCompatActivity {
@Override
public String run(RouteGuideBlockingStub blockingStub, RouteGuideStub asyncStub)
throws Exception {
- List<Point> points = new ArrayList<Point>();
+ List<Point> points = new ArrayList<>();
points.add(Point.newBuilder().setLatitude(407838351).setLongitude(-746143763).build());
points.add(Point.newBuilder().setLatitude(408122808).setLongitude(-743999179).build());
points.add(Point.newBuilder().setLatitude(413628156).setLongitude(-749015468).build());
diff --git a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java
index 8900b52ba..9f9b04daf 100644
--- a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java
+++ b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java
@@ -254,7 +254,7 @@ public class RouteGuideClientTest {
Feature.newBuilder().setLocation(point3).build();
final List<Feature> features = Arrays.asList(
requestFeature1, requestFeature2, requestFeature3);
- final List<Point> pointsDelivered = new ArrayList<Point>();
+ final List<Point> pointsDelivered = new ArrayList<>();
final RouteSummary fakeResponse = RouteSummary
.newBuilder()
.setPointCount(7)
@@ -357,8 +357,8 @@ public class RouteGuideClientTest {
public void routeChat_simpleResponse() throws Exception {
RouteNote fakeResponse1 = RouteNote.newBuilder().setMessage("dummy msg1").build();
RouteNote fakeResponse2 = RouteNote.newBuilder().setMessage("dummy msg2").build();
- final List<String> messagesDelivered = new ArrayList<String>();
- final List<Point> locationsDelivered = new ArrayList<Point>();
+ final List<String> messagesDelivered = new ArrayList<>();
+ final List<Point> locationsDelivered = new ArrayList<>();
final AtomicReference<StreamObserver<RouteNote>> responseObserverRef =
new AtomicReference<StreamObserver<RouteNote>>();
final CountDownLatch allRequestsDelivered = new CountDownLatch(1);
@@ -428,7 +428,7 @@ public class RouteGuideClientTest {
*/
@Test
public void routeChat_echoResponse() throws Exception {
- final List<RouteNote> notesDelivered = new ArrayList<RouteNote>();
+ final List<RouteNote> notesDelivered = new ArrayList<>();
// implement the fake service
RouteGuideImplBase routeChatImpl =
@@ -476,7 +476,7 @@ public class RouteGuideClientTest {
*/
@Test
public void routeChat_errorResponse() throws Exception {
- final List<RouteNote> notesDelivered = new ArrayList<RouteNote>();
+ final List<RouteNote> notesDelivered = new ArrayList<>();
final StatusRuntimeException fakeError = new StatusRuntimeException(Status.PERMISSION_DENIED);
// implement the fake service
diff --git a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java
index 09543ec5e..cd6ee1f11 100644
--- a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java
+++ b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java
@@ -68,7 +68,7 @@ public class RouteGuideServerTest {
public void setUp() throws Exception {
// Generate a unique in-process server name.
String serverName = InProcessServerBuilder.generateName();
- features = new ArrayList<Feature>();
+ features = new ArrayList<>();
// Use directExecutor for both InProcessServerBuilder and InProcessChannelBuilder can reduce the
// usage timeouts and latches in test. But we still add timeout and latches where they would be
// needed if no directExecutor were used, just for demo purpose.