chia7712 commented on code in PR #16608:
URL: https://github.com/apache/kafka/pull/16608#discussion_r1680270710
##########
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:
I assumed the "alias" are applied to all plugin configs when reading those
comments, so the origin comment is "we have some deprecated implementations
having same alias as new one. Bababa..."
There is no strong reason to tweak the comments, because the root cause is
probably my poor reading 😢
--
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]