mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8016099: Some @SuppressWarnings annotations ignored ( unchecked, rawtypes )
Reviewed-by: jjg
This commit is contained in:
parent
9e35962ebf
commit
4e49cb5fc5
4 changed files with 56 additions and 20 deletions
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8016099
|
||||
* @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes )
|
||||
* @compile UncheckedWarningRegressionTest.java
|
||||
* @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java
|
||||
*/
|
||||
|
||||
public class UncheckedWarningRegressionTest {
|
||||
<T> void suppressedWarningsFinalInitializer() {
|
||||
@SuppressWarnings("unchecked")
|
||||
T[] tt = (T[]) FINAL_EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
final Object[] FINAL_EMPTY_ARRAY = {};
|
||||
|
||||
<T> void finalInitializer() {
|
||||
T[] tt = (T[]) FINAL_EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
<T> void suppressedWarningsNonFinalInitializer() {
|
||||
@SuppressWarnings("unchecked")
|
||||
T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
Object[] NON_FINAL_EMPTY_ARRAY = {};
|
||||
|
||||
<T> void nonFinalInitializer() {
|
||||
T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue