Modify source to make errorprone complain.
--- a/make/common/SetupJavaCompilers.gmk Thu Aug 02 09:59:12 2018 -0700
+++ b/make/common/SetupJavaCompilers.gmk Tue Dec 04 11:08:07 2018 +0100
@@ -83,6 +83,8 @@
--add-opens=jdk.compiler.interim/com.sun.tools.javac.comp=ALL-UNNAMED \
#
+ # --add-modules java.logging \
+
ERRORPRONE_JAVAC_FLAGS := \
'-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \
-XDcompilePolicy=byfile \
--- a/src/java.base/share/classes/java/util/Random.java Thu Aug 02 09:59:12 2018 -0700
+++ b/src/java.base/share/classes/java/util/Random.java Tue Dec 04 11:08:07 2018 +0100
@@ -36,6 +36,9 @@
import jdk.internal.misc.Unsafe;
+import java.util.Set;
+import java.util.HashSet;
+
/**
* An instance of this class is used to generate a stream of
* pseudorandom numbers. The class uses a 48-bit seed, which is
@@ -142,6 +145,17 @@
}
}
+ /**
+ * test maintest.
+ */
+ private void maintest() {
+ Set<Short> s = new HashSet<>();
+ for (short i = 0; i < 100; i++) {
+ s.add(i);
+ s.remove(i - 1);
+ }
+ System.out.println(s.size());
+ }
private static long initialScramble(long seed) {
return (seed ^ multiplier) & mask;
}