On 14/10/2026 11:56, Rémy Maucherat wrote:
On Wed, Oct 14, 2026 at 12:31 PM Mark Thomas <[email protected]> wrote:

I am tempted to refactor this. Assuming that Principals are normally
serializable, the serializing and throwing away seems wasteful.

I am leaning towards trying to write the Principal and catching the
NotSerializableException. I'll see what that looks like.

Yes, so the idea is to not corrupt everything which seemed like a good
plan. As for the solution it is of course relatively wasteful since it
serializes to a nested byte stream. It didn't seem too bad to me so I
validated it.

It is a trade-off. This approach is more robust as it handles custom serailization safely whereas catching NotSerializableException may fail if the Principal uses custom serialization.

That said, attributes are currently using the catch NotSerializableException approach and switching to this more robust approach would be expensive for every attribute.

Principals might be more out of the application's control so I can see an argument for more robust checks compared to attributes.

I think you have convinced me to keep this code. I'll extend the same fix to Delta session.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to