Avoid warning on illegal reflective access operation

Java 9 introduced the modules system which enforces the strong
encapsulation of packages inside a module.

The Guice (assisted inject) and Guava (IoUtils) libraries have
been developed on Java 8 where the module system did not exist
and therefore are making access to internal methods of java.net
and java.lang.invoke packages that are not allowed anymore.

Silence for now the warnings, until Guice and Guava will be
upgraded to a newer version more compliant with the Java 9
modules strong encapsulation.

Bug: Issue 12639
Change-Id: I47d0ca65b2f62cdb1397f47f84e0f51a41c80c08
diff --git a/centos/8/entrypoint.sh b/centos/8/entrypoint.sh
index bf40fc8..34e2b9b 100755
--- a/centos/8/entrypoint.sh
+++ b/centos/8/entrypoint.sh
@@ -6,6 +6,8 @@
   java -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit
   java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit
   git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.net=ALL-UNNAMED"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.lang.invoke=ALL-UNNAMED"
 fi
 
 git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
diff --git a/ubuntu/20/entrypoint.sh b/ubuntu/20/entrypoint.sh
index bf40fc8..34e2b9b 100755
--- a/ubuntu/20/entrypoint.sh
+++ b/ubuntu/20/entrypoint.sh
@@ -6,6 +6,8 @@
   java -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit
   java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit
   git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.net=ALL-UNNAMED"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.lang.invoke=ALL-UNNAMED"
 fi
 
 git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"