symious commented on pull request #2893:
URL: https://github.com/apache/ozone/pull/2893#issuecomment-995935043
@lokeshj1703 Thanks for the review.
> We can try overriding this function to allow using class constructor which
takes OzoneConfiguration as input.
The current implementation is inherited from ConfigurationSource as follows
```
default <T> T getObject(Class<T> configurationClass) {
T configObject;
try {
configObject = configurationClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new ConfigurationException(
"Configuration class can't be created: " + configurationClass, e);
}
```
If we are going to override this method, it may look like "first try
configurationClass.getDeclaredConstructor(OzoneConfiguration.class).newInstance(ozoneConfiguration),
if not exists, then try configurationClass.newInstance()". Personally I think
the implementation would look a little odd.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]