2024-04-26 19:47:06 +00:00
|
|
|
/*
|
2007-12-01 00:00:00 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2018-02-07 15:49:24 +00:00
|
|
|
* @bug 4986256 6598104 8032211 8194764
|
2022-07-29 17:35:22 +00:00
|
|
|
* @compile/ref=Deprecation.noLint.out -XDrawDiagnostics Deprecation.java
|
|
|
|
* @compile/ref=Deprecation.lintDeprecation.out -Xlint:deprecation -XDrawDiagnostics Deprecation.java
|
|
|
|
* @compile/ref=Deprecation.lintDeprecation.out -Xlint:deprecation,-options --release 9 -XDrawDiagnostics Deprecation.java
|
|
|
|
* @compile/ref=Deprecation.lintDeprecation8.out -Xlint:deprecation,-options --release 8 -XDrawDiagnostics Deprecation.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
2014-11-24 15:02:35 +00:00
|
|
|
import java.io.StringBufferInputStream;
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
@Deprecated
|
|
|
|
class Deprecation
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// control: this class should generate warnings
|
|
|
|
class Deprecation2
|
|
|
|
{
|
|
|
|
void m() {
|
|
|
|
Object d = new Deprecation();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// tests: the warnings that would otherwise be generated should all be suppressed
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
class Deprecation3
|
|
|
|
{
|
|
|
|
void m() {
|
|
|
|
Object d = new Deprecation();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Deprecation4
|
|
|
|
{
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
void m() {
|
|
|
|
Object d = new Deprecation();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Deprecation5
|
|
|
|
{
|
|
|
|
void m() {
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
class Inner {
|
|
|
|
void m() {
|
|
|
|
Object d = new Deprecation();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// this class should produce warnings because @SuppressWarnings should not be inherited
|
|
|
|
class Deprecation6 extends Deprecation3
|
|
|
|
{
|
|
|
|
void m() {
|
|
|
|
Object d = new Deprecation();
|
|
|
|
}
|
|
|
|
}
|