You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/18 03:42:25 UTC
[GitHub] [accumulo] ctubbsii opened a new issue #1463: Investigate the need
for commons-beanutils dependency
ctubbsii opened a new issue #1463: Investigate the need for commons-beanutils dependency
URL: https://github.com/apache/accumulo/issues/1463
In d7a407a3d6367b96fbc513f5b94b3c0511a68bf0, commons-beanutils was added to satisfy a missing runtime dependency for commons-configuration 2.5, which is not necessarily a mandatory dependency (it's optional, depending on how one uses the commons-configuration API).
It's not clear that we actually need or want to use the features in commons-configuration 2 that require commons-beanutils. In 1ed12fa585a37caf36cfd674bd7ad6903c1d4e79, some of the spammy debug logging from that library was suppressed for the testing environment, but it raises the question of whether we even need it in the first place.
For example, I believe the following code requires it:
```java
var file = new File(path);
var propsBuilder =
new FileBasedConfigurationBuilder<PropertiesConfiguration>(PropertiesConfiguration.class)
.configure(new Parameters().properties().setFile(file));
```
However, I think the following code would probably not require it:
```java
var file = new File(path);
var propConfig = new PropertiesConfiguration();
try (var reader = new FileReader(file)) {
propConfig.getLayout().load(propConfig, reader);
}
```
I do not know if this code can be simply swapped out or not, and whether all our tests would pass or not, and whether we'd lose any functionality (especially important functionality, such as interpolation, importing common config from another file, or injecting system environment variables).
Investigation is needed to determine:
1. Can we safely drop the commons-beanutils dependency (with or without changing how we load properties with commons-configuration2.5's API)?
2. If yes to item 1, does interpolation work? Does injecting system properties?
3. Do we use any data type conversions that are broken?
4. Does the changes to remove it fix the spammy debug log messages that were suppressed in 1ed12fa585a37caf36cfd674bd7ad6903c1d4e79 ?
More information on commons-configuration basic features can be found at https://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeatures.html ; this covers information about interpolation and data type conversions that may be relevant to understand in order to properly investigate this.
If we can drop the commons-beanutils dependency, I think we should. And, if we can get rid of the use of the `FileBasedConfigurationBuilder` class without loss of essential functionality, I think we should do that, too.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services