Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
duke@1 | 1 | /** |
duke@1 | 2 | * @test /nodynamiccopyright/ |
duke@1 | 3 | * @bug 4986256 |
jjg@611 | 4 | * @compile/ref=Unchecked.noLint.out -XDrawDiagnostics Unchecked.java |
jjg@611 | 5 | * @compile/ref=Unchecked.lintUnchecked.out -Xlint:unchecked -XDrawDiagnostics Unchecked.java |
jjg@611 | 6 | * @compile/ref=Unchecked.lintAll.out -Xlint:all,-path -XDrawDiagnostics Unchecked.java |
duke@1 | 7 | */ |
duke@1 | 8 | |
duke@1 | 9 | import java.util.ArrayList; |
duke@1 | 10 | import java.util.List; |
duke@1 | 11 | |
duke@1 | 12 | // control: this class should generate warnings |
duke@1 | 13 | class Unchecked |
duke@1 | 14 | { |
duke@1 | 15 | void m() { |
duke@1 | 16 | List l = new ArrayList<String>(); |
duke@1 | 17 | l.add("abc"); |
duke@1 | 18 | } |
duke@1 | 19 | } |
duke@1 | 20 | |
duke@1 | 21 | // tests: the warnings that would otherwise be generated should all be suppressed |
duke@1 | 22 | @SuppressWarnings("unchecked") |
duke@1 | 23 | class Unchecked2 |
duke@1 | 24 | { |
duke@1 | 25 | void m() { |
duke@1 | 26 | List l = new ArrayList<String>(); |
duke@1 | 27 | l.add("abc"); |
duke@1 | 28 | } |
duke@1 | 29 | } |
duke@1 | 30 | |
duke@1 | 31 | class Unchecked3 |
duke@1 | 32 | { |
duke@1 | 33 | @SuppressWarnings("unchecked") |
duke@1 | 34 | void m() { |
duke@1 | 35 | List l = new ArrayList<String>(); |
duke@1 | 36 | l.add("abc"); |
duke@1 | 37 | } |
duke@1 | 38 | } |
duke@1 | 39 | |
duke@1 | 40 | class Unchecked4 |
duke@1 | 41 | { |
duke@1 | 42 | void m() { |
duke@1 | 43 | @SuppressWarnings("unchecked") |
duke@1 | 44 | class Inner { |
duke@1 | 45 | void m() { |
duke@1 | 46 | List l = new ArrayList<String>(); |
duke@1 | 47 | l.add("abc"); |
duke@1 | 48 | } |
duke@1 | 49 | } |
duke@1 | 50 | } |
duke@1 | 51 | } |
duke@1 | 52 | |
duke@1 | 53 | // this class should produce warnings because @SuppressWarnings should not be inherited |
duke@1 | 54 | class Unchecked5 extends Unchecked2 |
duke@1 | 55 | { |
duke@1 | 56 | void m() { |
duke@1 | 57 | List l = new ArrayList<String>(); |
duke@1 | 58 | l.add("abc"); |
duke@1 | 59 | } |
duke@1 | 60 | } |