author | jlahoda |
Wed, 07 Feb 2018 16:49:24 +0100 | |
changeset 48776 | 107413b070b9 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
10 | 1 |
/** |
2 |
* @test /nodynamiccopyright/ |
|
48776
107413b070b9
8194764: javac incorrectly flags deprecated for removal imports
jlahoda
parents:
47216
diff
changeset
|
3 |
* @bug 4986256 6598104 8032211 8194764 |
27854
22b4bfc4e22f
8032211: Don't issue deprecation warnings on import statements
jlahoda
parents:
6150
diff
changeset
|
4 |
* @compile/ref=Deprecation.noLint.out -XDrawDiagnostics Deprecation.java |
22b4bfc4e22f
8032211: Don't issue deprecation warnings on import statements
jlahoda
parents:
6150
diff
changeset
|
5 |
* @compile/ref=Deprecation.lintDeprecation.out -Xlint:deprecation -XDrawDiagnostics Deprecation.java |
48776
107413b070b9
8194764: javac incorrectly flags deprecated for removal imports
jlahoda
parents:
47216
diff
changeset
|
6 |
* @compile/ref=Deprecation.lintDeprecation.out -Xlint:deprecation,-options -source 9 -XDrawDiagnostics Deprecation.java |
27854
22b4bfc4e22f
8032211: Don't issue deprecation warnings on import statements
jlahoda
parents:
6150
diff
changeset
|
7 |
* @compile/ref=Deprecation.lintDeprecation8.out -Xlint:deprecation,-options -source 8 -XDrawDiagnostics Deprecation.java |
10 | 8 |
*/ |
9 |
||
27854
22b4bfc4e22f
8032211: Don't issue deprecation warnings on import statements
jlahoda
parents:
6150
diff
changeset
|
10 |
import java.io.StringBufferInputStream; |
22b4bfc4e22f
8032211: Don't issue deprecation warnings on import statements
jlahoda
parents:
6150
diff
changeset
|
11 |
|
10 | 12 |
@Deprecated |
13 |
class Deprecation |
|
14 |
{ |
|
15 |
} |
|
16 |
||
17 |
// control: this class should generate warnings |
|
18 |
class Deprecation2 |
|
19 |
{ |
|
20 |
void m() { |
|
21 |
Object d = new Deprecation(); |
|
22 |
} |
|
23 |
} |
|
24 |
||
25 |
// tests: the warnings that would otherwise be generated should all be suppressed |
|
26 |
@SuppressWarnings("deprecation") |
|
27 |
class Deprecation3 |
|
28 |
{ |
|
29 |
void m() { |
|
30 |
Object d = new Deprecation(); |
|
31 |
} |
|
32 |
} |
|
33 |
||
34 |
class Deprecation4 |
|
35 |
{ |
|
36 |
@SuppressWarnings("deprecation") |
|
37 |
void m() { |
|
38 |
Object d = new Deprecation(); |
|
39 |
} |
|
40 |
} |
|
41 |
||
42 |
class Deprecation5 |
|
43 |
{ |
|
44 |
void m() { |
|
45 |
@SuppressWarnings("deprecation") |
|
46 |
class Inner { |
|
47 |
void m() { |
|
48 |
Object d = new Deprecation(); |
|
49 |
} |
|
50 |
} |
|
51 |
} |
|
52 |
} |
|
53 |
||
54 |
// this class should produce warnings because @SuppressWarnings should not be inherited |
|
55 |
class Deprecation6 extends Deprecation3 |
|
56 |
{ |
|
57 |
void m() { |
|
58 |
Object d = new Deprecation(); |
|
59 |
} |
|
60 |
} |