author | darcy |
Fri, 02 Feb 2018 10:29:25 -0800 | |
changeset 48723 | 6cb86bf0b51e |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
27119
b80b6a2e137f
8058410: Group 10b: golden files for tests in tools/javac dir
sogoel
parents:
10202
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
10 | 3 |
* @bug 4986256 |
27119
b80b6a2e137f
8058410: Group 10b: golden files for tests in tools/javac dir
sogoel
parents:
10202
diff
changeset
|
4 |
* @compile/ref=Serial.out -XDrawDiagnostics -Xlint:all Serial.java |
10 | 5 |
*/ |
6 |
||
7 |
import java.io.Serializable; |
|
8 |
||
9 |
// control: this class should generate warnings |
|
10 |
class Serial implements Serializable |
|
11 |
{ |
|
12 |
static class Inner implements Serializable |
|
13 |
{ |
|
14 |
} |
|
15 |
||
16 |
@SuppressWarnings("serial") |
|
17 |
void m() { |
|
18 |
class Inner implements Serializable |
|
19 |
{ |
|
20 |
} |
|
21 |
} |
|
22 |
} |
|
23 |
||
24 |
// tests: the warnings that would otherwise be generated should all be suppressed |
|
25 |
@SuppressWarnings("serial") |
|
26 |
class Serial1 implements Serializable |
|
27 |
{ |
|
28 |
static class Inner implements Serializable |
|
29 |
{ |
|
30 |
} |
|
31 |
} |
|
32 |
||
33 |
class Serial2 |
|
34 |
{ |
|
35 |
@SuppressWarnings("serial") |
|
36 |
static class Inner implements Serializable |
|
37 |
{ |
|
38 |
} |
|
39 |
||
40 |
@SuppressWarnings("serial") |
|
41 |
void m() { |
|
42 |
class Inner implements Serializable |
|
43 |
{ |
|
44 |
} |
|
45 |
} |
|
46 |
} |
|
47 |
||
48 |
// this class should produce warnings because @SuppressWarnings should not be inherited |
|
49 |
class Serial3 extends Serial1 |
|
50 |
{ |
|
51 |
static class Inner implements Serializable |
|
52 |
{ |
|
53 |
} |
|
54 |
} |