Explicit Serialization API and Security
Peter Levart
peter.levart at gmail.com
Sun Jan 4 10:19:39 UTC 2015
On 01/04/2015 02:48 AM, Peter Firmstone wrote:
> class B extends A {
>
> public final int cur;
>
> private static ReadSerial check(ReadSerial rs) {
> A a = new A(rs);
What to do if A is abstract?
Regards, Peter
> int cur = rs.getInt("cur");
> if ( a.lower> cur || cur> a.upper )
> throw new IllegalArgumentException(
> "cur outside lower and upper bounds");
> return rs;
> }
>
> public B(ReadSerial rs) {
> super(check(rs));
> cur = rs.getInt("cur");
> }
> }
More information about the core-libs-dev
mailing list