gharris1727 commented on code in PR #16608:
URL: https://github.com/apache/kafka/pull/16608#discussion_r1680198269


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -425,7 +425,14 @@ public static <T> T newInstance(String klass, Class<T> 
base) throws ClassNotFoun
      * @return the new class
      */
     public static <T> Class<? extends T> loadClass(String klass, Class<T> 
base) throws ClassNotFoundException {
-        return Class.forName(klass, true, 
Utils.getContextOrKafkaClassLoader()).asSubclass(base);
+        ClassLoader contextOrKafkaClassLoader = 
Utils.getContextOrKafkaClassLoader();
+        // Use loadClass here instead of Class.forName because the name we use 
here may be an alias

Review Comment:
   Aliasing is a general concept, with one particular implementation in 
connect. I don't think the word alias is incorrect to use here. The comment 
also doesn't mention plugins at all.
   
   You're right that the only time we use aliases is in connect, via the 
DelegatingClassLoader, so most of the time this change has no effect, 
loadedClass.getName().equals(klass) is true.



-- 
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