# HG changeset patch # User ihse # Date 1543918087 -3600 # Node ID 85a97ef23187a4325aeca903b577e41a4046a493 # Parent 1186bac4e290abe3803fa7dbcedaa7e99d86e9db Modify source to make errorprone complain. diff -r 1186bac4e290 -r 85a97ef23187 make/common/SetupJavaCompilers.gmk --- 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 \ diff -r 1186bac4e290 -r 85a97ef23187 src/java.base/share/classes/java/util/Random.java --- 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 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; }