okhttp: use java 7, avoid compiler varargs warning (#4806)

This commit is contained in:
Eric Gribkoff 2018-08-28 11:53:15 -07:00 committed by GitHub
parent 67ee4b6a8f
commit d3cdfd0883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View File

@ -1,11 +1,5 @@
description = "gRPC: OkHttp"
// Workaround:
// Util.java:219: warning: [unchecked] Possible heap pollution from parameterized vararg type T
// Need to verify the @SafeVarargs annotation is safe for Android
sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile project(':grpc-core'),
libraries.okhttp,

View File

@ -216,7 +216,7 @@ public final class Util {
}
/** Returns an immutable list containing {@code elements}. */
public static <T> List<T> immutableList(T... elements) {
public static <T> List<T> immutableList(T[] elements) {
return Collections.unmodifiableList(Arrays.asList(elements.clone()));
}