Explicit Serialization API and Security
Peter Firmstone
peter.firmstone at zeus.net.au
Tue Jan 13 10:24:53 UTC 2015
Could we use a static validator method and generate bytecode for constructors dynamically?
The developer can optionally implement the constructors.
static GetField invariantCheck(GetField f);
Create a caller sensitive GetField implementation and add a two new methods to GetField:
abstract Object createSuper(); // to access superclass object methods for inavariant checking.
abstract Class getType(String name);
Set fields from within constructors.
The generated constructors are straight forward:
1. Call static method.
2. Call super class constructor with result from static method.
3. Set final fields
4. How to set transient fields, implement a private method called from within the constructor?
Require a permission to extend GetField?
More information about the core-libs-dev
mailing list