Bump grpc-java to 1.18.0

Requires bumping other dependencies in deps.json such as Netty (4.1.32)
and error_prone_annotations. Includes also fixes detected by updated
errorprone.

Change-Id: Ic2bd86931cc89bfb2cf1a4cb11a4586bc8cac608
diff --git a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/RoleManager.java b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/RoleManager.java
index b58e9aa..f3e8437 100644
--- a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/RoleManager.java
+++ b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/RoleManager.java
@@ -58,7 +58,7 @@
     private final int pendingXidTimeoutSeconds = 60;
 
     // The cache for pending expected RoleReplies keyed on expected XID
-    private Cache<Integer, RoleState> pendingReplies =
+    private Cache<Long, RoleState> pendingReplies =
             CacheBuilder.newBuilder()
                 .expireAfterWrite(pendingXidTimeoutSeconds, TimeUnit.SECONDS)
                 .build();
@@ -79,7 +79,7 @@
      *
      * @param role role to request
      */
-    private int sendNxRoleRequest(RoleState role) throws IOException {
+    private long sendNxRoleRequest(RoleState role) throws IOException {
         // Convert the role enum to the appropriate role to send
         OFNiciraControllerRole roleToSend = OFNiciraControllerRole.ROLE_OTHER;
         switch (role) {
@@ -104,7 +104,7 @@
         return xid;
     }
 
-    private int sendOF13RoleRequest(RoleState role) throws IOException {
+    private long sendOF13RoleRequest(RoleState role) throws IOException {
         // Convert the role enum to the appropriate role to send
         OFControllerRole roleToSend = OFControllerRole.ROLE_NOCHANGE;
         switch (role) {
diff --git a/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java b/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
index 9ffa26e..6d08bcb 100644
--- a/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
+++ b/protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
@@ -24,6 +24,7 @@
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import io.netty.channel.Channel;
 import org.onlab.packet.IpAddress;
@@ -1345,7 +1346,7 @@
 
             ListenableFuture<JsonNode> input = getSchema(dbNames);
             if (input != null) {
-                return Futures.transform(input, rowFunction);
+                return futureTransform(input, rowFunction);
             }
             return null;
         } else {
@@ -1369,7 +1370,7 @@
                 }
                 return updates;
             };
-            return Futures.transform(monitor(dbSchema, id), rowFunction);
+            return futureTransform(monitor(dbSchema, id), rowFunction);
         }
         return null;
     }
@@ -1395,7 +1396,7 @@
                 }
                 return null;
             });
-            return Futures.transform(transact(dbSchema, operations), rowFunction);
+            return futureTransform(transact(dbSchema, operations), rowFunction);
         }
         return null;
     }
@@ -1981,4 +1982,12 @@
     public Optional<DeviceCpuStats> getDeviceCpuUsage() {
         return Optional.empty();
     }
+
+    private <I, O> ListenableFuture<O> futureTransform(
+            ListenableFuture<I> input, Function<? super I, ? extends O> function) {
+        // Wrapper around deprecated Futures.transform() method. As per Guava
+        // recommendation, passing MoreExecutors.directExecutor() for identical
+        // behavior.
+        return Futures.transform(input, function, MoreExecutors.directExecutor());
+    }
 }