mneethiraj commented on code in PR #935:
URL: https://github.com/apache/ranger/pull/935#discussion_r3241902898


##########
plugin-schema-registry/src/main/java/org/apache/ranger/services/schema/registry/client/connection/DefaultSchemaRegistryClient.java:
##########
@@ -248,7 +249,11 @@ private UrlSelector createUrlSelector() {
             urlSelector = new LoadBalancedFailoverUrlSelector(rootCatalogURL);
         } else {
             try {
-                urlSelector = (UrlSelector) 
Class.forName(urlSelectorClass).getConstructor(String.class).newInstance(rootCatalogURL);
+                Class<?> clazz = Class.forName(urlSelectorClass);
+                if (!UrlSelector.class.isAssignableFrom(clazz)) {
+                    throw new 
RuntimeException(ERR_CLASS_NOT_IMPLEMENTING_URL_SELECTOR + urlSelectorClass);

Review Comment:
   The error message should be:
   `urlSelectorClass + ERR_CLASS_NOT_IMPLEMENTING_URL_SELECTOR`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to