in pulsar-client-kafka-compat/pulsar-client-kafka_0_8/src/main/java/org/apache/kafka/clients/producer/PulsarKafkaProducer.java [242:261]
public static <T> T newInstance(Class<T> c, VerifiableProperties properties) {
try {
try {
Constructor<T> constructor = c.getConstructor(VerifiableProperties.class);
constructor.setAccessible(true);
return constructor.newInstance(properties);
} catch (Exception e) {
// Ok.. not a default implementation class
}
return c.newInstance();
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Could not instantiate class " + c.getName(), e);
} catch (InstantiationException e) {
throw new IllegalArgumentException(
"Could not instantiate class " + c.getName() + " Does it have a public no-argument constructor?",
e);
} catch (NullPointerException e) {
throw new IllegalArgumentException("Requested class was null", e);
}
}