Regression tests compiled with -Xlint:all,-path

Jonathan Gibbons jjg3 at pobox.com
Thu Nov 7 16:30:08 UTC 2024


Archie,

I looked at a selection of those tests. I note that in general, these 
tests are all very old, and (mostly) predate OpenJDK. I don't think 
there was ever any explicit reason (as in, test failure) to suppress 
path warnings; my recollection is that it was more about defensively 
ignoring any unrelated warnings.

 From the current source in LintCategory, I note:

/** * Warn about invalid path elements on the command line. * Such 
warnings cannot be suppressed with the SuppressWarnings * annotation. */ 
PATH("path"),

which means that the tests are more susceptible to invalid path entries 
on the classpath, sourcepath etc.
That may have been a bigger deal back in the day, before we had better 
control of the test execution
environment.

My guess is that looking at the overall set of tests that use `-Xlint` 
or `-Xlint:all`, we are not
consistent about using `-path`, suggesting that there are no failures 
when it is not used, and thus
no longer any reason to specify it on the tests that you list.

-- Jon

On 11/6/24 1:40 PM, Archie Cobbs wrote:
> Question for the list...
>
> I've noticed that several compiler regression tests are compiled with 
> -Xlint:all,-path or Xlint:-path.
>
> I'm wondering what the suppression of path is for. When I remove the 
> -path part, the tests still pass.
>
> Does anyone know why those tests are compiled with path suppressed? Is 
> it some Windows thing?
>
> Examples:
>
> test/langtools/tools/javac/6304921/T6304921.java
> test/langtools/tools/javac/T5048776.java
> test/langtools/tools/javac/T6245591.java
> test/langtools/tools/javac/T6247324.java
> test/langtools/tools/javac/processing/TestWarnErrorCount.java
> test/langtools/tools/javac/warnings/DivZero.java
> test/langtools/tools/javac/warnings/FallThrough.java
> test/langtools/tools/javac/warnings/Unchecked.java
>
> Thanks,
> -Archie
>
> -- 
> Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20241107/dfde347c/attachment.htm>


More information about the compiler-dev mailing list