aboutsummaryrefslogtreecommitdiff
path: root/okhttp
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 /okhttp
parent6cf849a7ceb0b223a497dff02742b2f76e1cbaa7 (diff)
downloadgrpc-grpc-java-b0f423295b4674cb5247a6143fd211b050ef0065.tar.gz
all: use Java7 brackets
Diffstat (limited to 'okhttp')
-rw-r--r--okhttp/src/main/java/io/grpc/okhttp/Headers.java2
-rw-r--r--okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java2
-rw-r--r--okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OkHostnameVerifier.java4
-rw-r--r--okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java4
-rw-r--r--okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Util.java4
-rw-r--r--okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java2
6 files changed, 9 insertions, 9 deletions
diff --git a/okhttp/src/main/java/io/grpc/okhttp/Headers.java b/okhttp/src/main/java/io/grpc/okhttp/Headers.java
index 23167914a..cb71846eb 100644
--- a/okhttp/src/main/java/io/grpc/okhttp/Headers.java
+++ b/okhttp/src/main/java/io/grpc/okhttp/Headers.java
@@ -58,7 +58,7 @@ class Headers {
headers.discardAll(GrpcUtil.USER_AGENT_KEY);
// 7 is the number of explicit add calls below.
- List<Header> okhttpHeaders = new ArrayList<Header>(7 + InternalMetadata.headerCount(headers));
+ List<Header> okhttpHeaders = new ArrayList<>(7 + InternalMetadata.headerCount(headers));
// Set GRPC-specific headers.
okhttpHeaders.add(SCHEME_HEADER);
diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java
index 5f43ad965..116fc0b07 100644
--- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java
+++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java
@@ -1938,7 +1938,7 @@ public class OkHttpClientTransportTest {
Metadata trailers;
RpcProgress rpcProgress;
CountDownLatch closed = new CountDownLatch(1);
- ArrayList<String> messages = new ArrayList<String>();
+ ArrayList<String> messages = new ArrayList<>();
boolean onReadyCalled;
MockStreamListener() {
diff --git a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OkHostnameVerifier.java b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OkHostnameVerifier.java
index b7b1d5367..8b108c74a 100644
--- a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OkHostnameVerifier.java
+++ b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OkHostnameVerifier.java
@@ -123,14 +123,14 @@ public final class OkHostnameVerifier implements HostnameVerifier {
public static List<String> allSubjectAltNames(X509Certificate certificate) {
List<String> altIpaNames = getSubjectAltNames(certificate, ALT_IPA_NAME);
List<String> altDnsNames = getSubjectAltNames(certificate, ALT_DNS_NAME);
- List<String> result = new ArrayList<String>(altIpaNames.size() + altDnsNames.size());
+ List<String> result = new ArrayList<>(altIpaNames.size() + altDnsNames.size());
result.addAll(altIpaNames);
result.addAll(altDnsNames);
return result;
}
private static List<String> getSubjectAltNames(X509Certificate certificate, int type) {
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
try {
Collection<?> subjectAltNames = certificate.getSubjectAlternativeNames();
if (subjectAltNames == null) {
diff --git a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java
index d6f88ba0e..51244c902 100644
--- a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java
+++ b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java
@@ -449,7 +449,7 @@ public class Platform {
public void configureTlsExtensions(
SSLSocket sslSocket, String hostname, List<Protocol> protocols) {
SSLParameters parameters = sslSocket.getSSLParameters();
- List<String> names = new ArrayList<String>(protocols.size());
+ List<String> names = new ArrayList<>(protocols.size());
for (Protocol protocol : protocols) {
if (protocol == Protocol.HTTP_1_0) continue; // No HTTP/1.0 for ALPN.
names.add(protocol.toString());
@@ -505,7 +505,7 @@ public class Platform {
@Override public void configureTlsExtensions(
SSLSocket sslSocket, String hostname, List<Protocol> protocols) {
- List<String> names = new ArrayList<String>(protocols.size());
+ List<String> names = new ArrayList<>(protocols.size());
for (int i = 0, size = protocols.size(); i < size; i++) {
Protocol protocol = protocols.get(i);
if (protocol == Protocol.HTTP_1_0) continue; // No HTTP/1.0 for ALPN.
diff --git a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Util.java b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Util.java
index bee316970..a0e668fd8 100644
--- a/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Util.java
+++ b/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Util.java
@@ -212,7 +212,7 @@ public final class Util {
/** Returns an immutable copy of {@code list}. */
public static <T> List<T> immutableList(List<T> list) {
- return Collections.unmodifiableList(new ArrayList<T>(list));
+ return Collections.unmodifiableList(new ArrayList<>(list));
}
/** Returns an immutable list containing {@code elements}. */
@@ -250,7 +250,7 @@ public final class Util {
* {@code second}. The returned elements are in the same order as in {@code first}.
*/
private static <T> List<T> intersect(T[] first, T[] second) {
- List<T> result = new ArrayList<T>();
+ List<T> result = new ArrayList<>();
for (T a : first) {
for (T b : second) {
if (a.equals(b)) {
diff --git a/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java b/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
index 143ad5fb6..9c919e9fb 100644
--- a/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
+++ b/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.fail;
public class HpackTest {
private static List<Header> headerEntries(String... elements) {
- List<Header> result = new ArrayList<Header>(elements.length / 2);
+ List<Header> result = new ArrayList<>(elements.length / 2);
for (int i = 0; i < elements.length; i += 2) {
result.add(new Header(elements[i], elements[i + 1]));
}