I reproduced the issue in a unit test, and verified the patch fixes the issue. The issue presents itself when a jar is registered at runtime, and a class in that registered jar is stored in the UDFContext. Without the patch deserilization fails.
To setup the test I store two java files as resources, and compile+jar them at runtime (using javax classes). I took this approach to keep the test setup isolated.
However, since it uses javax classes this approach may not be ideal. I'm preparing another version that performs these setup steps in ant (generate the test-specific jar, runs the test with an appropriate classpath. That version will likely be the better choice to commit.