RFR (S): 8230854: Cleanup SuppressWarnings in test lib and remove noisy traces in StreamPumper
joe.darcy at oracle.com
Tue Sep 17 20:00:43 UTC 2019
The specification for the SuppressWarnings type states:
"The presence of unrecognized warning names is /not/ an error: Compilers
must ignore any warning names they do not recognize. They are, however,
free to emit a warning if an annotation contains an unrecognized warning
Note that the JLS does not repeat this requirement of compilers in its
section on @SuppressWarnings:
I've filed JDK-8231147 for this issue.
On 9/13/2019 1:04 AM, Langer, Christoph wrote:
> Hi David,
>>>> - @SuppressWarnings("overloads")
>>>> public static Process startProcess(String name,
>>>> ProcessBuilder processBuilder,
>>>> final Predicate<String>
>>>> 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:
>> 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