jdk-24/test/langtools/tools/javac/warnings/Serial/CtorAccess.java
2023-06-26 16:56:40 +00:00

39 lines
881 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8202056
* @compile/ref=CtorAccess.out -XDrawDiagnostics -Xlint:serial CtorAccess.java
* @compile/ref=empty.out -XDrawDiagnostics CtorAccess.java
*/
import java.io.*;
class CtorAccess {
public CtorAccess(int i) {}
// Cannot by accessed by SerialSubclass
private CtorAccess(){}
static class SerialSubclass
extends CtorAccess
implements Serializable {
private static final long serialVersionUID = 42;
SerialSubclass() {
super(42);
}
}
// *not* static
class MemberSuper {
// Implicit this$0 argument
public MemberSuper() {}
}
class SerialMemberSub
extends MemberSuper
implements Serializable {
SerialMemberSub(){super();}
private static final long serialVersionUID = 42;
}
}