6a466fe7ae
8160675: Issue lint warning for non-serializable non-transient instance fields in serializable type Reviewed-by: erikj, sspitsyn, jlahoda, vromero, rriggs, smarks
34 lines
898 B
Java
34 lines
898 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 8202056
|
|
* @compile/ref=DeepNestingSuppression.out -XDrawDiagnostics -Xlint:serial DeepNestingSuppression.java
|
|
*/
|
|
|
|
import java.io.Serializable;
|
|
|
|
/*
|
|
* Verify suppressing serial warnings works through several levels of
|
|
* nested types.
|
|
*/
|
|
class DeepNestingSuppression {
|
|
|
|
@SuppressWarnings("serial")
|
|
static class SuppressedOuter {
|
|
static class Intermediate {
|
|
static class Inner implements Serializable {
|
|
// warning for int rather than long svuid
|
|
private static final int serialVersionUID = 42;
|
|
}
|
|
}
|
|
}
|
|
|
|
static class Outer {
|
|
static class Intermediate {
|
|
static class Inner implements Serializable {
|
|
// warning for int rather than long svuid
|
|
private static final int serialVersionUID = 42;
|
|
}
|
|
}
|
|
}
|
|
}
|