You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "vyommani (via GitHub)" <gi...@apache.org> on 2026/10/21 04:43:10 UTC

[PR] RANGER-5799: Validate class assignability before instantiating config… [ranger]

vyommani opened a new pull request, #1323:
URL: https://github.com/apache/ranger/pull/1323

   
   
   ## What changes were proposed in this pull request?
   Several places resolve a configured class name via Class.forName(...).newInstance(), relying on the checkcast to catch a bad class — but the checkcast happens after construction, not before. Add an isAssignableFrom check before instantiation, in the existing try/catch, so an unassignable class is treated the same as an unresolvable one (falls back / skipped, as today).
   
   No new validation mechanism, no behavior change for valid configs. Tests added confirming a non-assignable class is never constructed while legitimate classes still work.
   
   ## How was this patch tested?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RANGER-5799: Validate class assignability before instantiating config… [ranger]

Posted by "dineshkumar-yadav (via GitHub)" <gi...@apache.org>.
dineshkumar-yadav commented on PR #1323:
URL: https://github.com/apache/ranger/pull/1323#issuecomment-6316091728

   @vyommani Please resolve conflict before merging this patch.
   Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org