RFR: JDK-8290901: Reduce use of -source in langtools tests [v2]
Jonathan Gibbons
jjg at openjdk.org
Thu Jul 28 22:28:41 UTC 2022
On Mon, 25 Jul 2022 17:32:38 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> To a first approximation, this change replaces use of "-source", where possible, with the preferable "--release" javac option. (There are cases where this swap is not desirable, such as when newer library features are being used in the test.)
>>
>> A few unneeded uses of -source were removed entirely.
>>
>> I'll update copyrights before any push.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Update copyrights.
I think you can probably simply and sometimes delete the `-Xlint` option ... specifically, to remove the `-options` sub-option.
test/langtools/tools/javac/generics/7015430/T7015430.java line 7:
> 5: * @summary Incorrect thrown type determined for unchecked invocations
> 6: * @author Daniel Smith
> 7: * @compile/fail/ref=T7015430_1.out --release 7 -Xlint:-options,unchecked -XDrawDiagnostics T7015430.java
You may be able to remove `-options` from `-Xlint` -- the value is probably there to suppress the warnings that you have deleted elsewhere
test/langtools/tools/javac/generics/diamond/neg/Neg09a.java line 7:
> 5: * @summary Check that diamond is not allowed with anonymous inner class expressions at source < 9
> 6: * @author Maurizio Cimadamore
> 7: * @compile/fail/ref=Neg09a.out Neg09a.java --release 8 -XDrawDiagnostics -Xlint:-options
another `-options`
test/langtools/tools/javac/generics/diamond/neg/Neg09b.java line 7:
> 5: * @summary Check that diamond is not allowed with anonymous inner class expressions at source < 9
> 6: * @author Maurizio Cimadamore
> 7: * @compile/fail/ref=Neg09b.out Neg09b.java --release 8 -XDrawDiagnostics -Xlint:-options
`-options`
test/langtools/tools/javac/generics/diamond/neg/Neg09c.java line 7:
> 5: * @summary Check that diamond is not allowed with anonymous inner class expressions at source < 9
> 6: * @author Maurizio Cimadamore
> 7: * @compile/fail/ref=Neg09c.out Neg09c.java --release 8 -XDrawDiagnostics -Xlint:-options
`-options`
test/langtools/tools/javac/generics/diamond/neg/Neg09d.java line 7:
> 5: * @summary Check that diamond is not allowed with anonymous inner class expressions at source < 9
> 6: * @author Maurizio Cimadamore
> 7: * @compile/fail/ref=Neg09d.out Neg09d.java --release 8 -XDrawDiagnostics -Xlint:-options
`-options`
test/langtools/tools/javac/generics/diamond/neg/Neg10.java line 7:
> 5: * @summary Check that 'complex' diamond can infer type that is too specific
> 6: * @author mcimadamore
> 7: * @compile/fail/ref=Neg10.out --release 7 -Xlint:-options Neg10.java -XDrawDiagnostics
`-options`
test/langtools/tools/javac/generics/inference/7154127/T7154127.java line 5:
> 3: * @bug 7154127 8007464
> 4: * @summary Inference cleanup: remove bound check analysis from visitors in Types.java
> 5: * @compile/fail/ref=T7154127.out -Xlint:-options --release 7 -XDrawDiagnostics T7154127.java
`-options`
test/langtools/tools/javac/generics/inference/7177306/T7177306e.java line 5:
> 3: * @bug 7177306 8007464
> 4: * @summary Regression: unchecked method call does not erase return type
> 5: * @compile/fail/ref=T7177306e_7.out -XDrawDiagnostics --release 7 -Xlint:-options -XDrawDiagnostics T7177306e.java
`-options`
test/langtools/tools/javac/generics/inference/8015505/T8015505.java line 5:
> 3: * @bug 8015505
> 4: * @summary Spurious inference error when return type of generic method requires unchecked conversion to target
> 5: * @compile/fail/ref=T8015505.out -Xlint:-options --release 7 -XDrawDiagnostics T8015505.java
OK, I'll not bother with flagging more instances of `-options` ... `I suggest you use `grep` on the modified files in this PR.
-------------
PR: https://git.openjdk.org/jdk/pull/9622
More information about the compiler-dev
mailing list