jdk-24/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.java
Joe Darcy 6a466fe7ae 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields
8160675: Issue lint warning for non-serializable non-transient instance fields in serializable type

Reviewed-by: erikj, sspitsyn, jlahoda, vromero, rriggs, smarks
2021-10-21 21:11:01 +00:00

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;
}
}
}
}