Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances security and type safety during deserialization by verifying that dynamically instantiated classes are assignable to expected types before they are initialized. It updates ServiceOptions.newInstance to accept an expected class type, avoids running static initializers prematurely, and replaces deprecated reflection calls. Corresponding serialization round-trip tests are added across transport options. The reviewer suggested improving type safety in ServiceOptions.newInstance by changing the expected parameter type from Class<?> to Class, which allows using expected.cast(...) and removing the @SuppressWarnings("unchecked") annotation.
add5f1a to
8aed79e
Compare
|
|





Hardens ServiceOptions.newInstance by deferring class initialization until assignability to the expected factory interface is verified. Updates ServiceOptions, GrpcTransportOptions, and HttpTransportOptions readObject call sites accordingly and adds unit tests.