RFR (S): 8230854: Cleanup SuppressWarnings in test lib and remove noisy traces in StreamPumper

Langer, Christoph christoph.langer at sap.com
Fri Sep 13 08:04:39 UTC 2019

Hi David,

> >> test/lib/jdk/test/lib/process/ProcessTools.java
> >>
> >> -     @SuppressWarnings("overloads")
> >>         public static Process startProcess(String name,
> >>                                            ProcessBuilder processBuilder,
> >>                                            final Predicate<String>
> >> linePredicate)
> >>
> >> Unnecessary? I can't find what this warning is supposed to mean. Is it used by some IDE's?
> > I didn't find any reference either and the IDE says that this is an unknown
> annotation. So unless somebody steps up and tells us what it's good for, I guess it can be removed.
> Not it is a valid warning. Try compiling with -Xlint:all without the
> warning suppressed:
> ----------System.err:(19/1295)----------
> /scratch/users/daholme/jdk-
> dev2/open/test/lib/jdk/test/lib/process/ProcessTools.java:91:
> warning: [overloads]
> startProcess(String,ProcessBuilder,Consumer<String>) in ProcessTools is
> potentially ambiguous with
> startProcess(String,ProcessBuilder,Predicate<String>) in ProcessTools
>      public static Process startProcess(String name,
>                            ^

Thanks for taking a closer look here and enlightening me.

@SuppressWarnings("overloads") is supported by javac but not by my Eclipse IDE. One can list supported @SuppressWarnings types with javac -X. You'll get:
overloads            Warn about issues regarding method overloads.

So I now understand what the warning means and why @SuppressWarnings("overloads") is required here. I've also configured my Eclipse to ignore this unknown annotation.

New webrev, keeping @SuppressWarnings("overloads"): http://cr.openjdk.java.net/~clanger/webrevs/8230854.1/

Best regards

More information about the hotspot-dev mailing list