accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #357: ACCUMULO-4611 Deprecate commons config in api
Date Thu, 01 Jan 1970 00:00:00 GMT
ctubbsii commented on a change in pull request #357: ACCUMULO-4611 Deprecate commons config
in api
URL: https://github.com/apache/accumulo/pull/357#discussion_r161852148
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
 ##########
 @@ -147,30 +154,46 @@ public static ClientProperty getPropertyByKey(String key) {
     }
   }
 
-  public ClientConfiguration(String configFile) throws ConfigurationException {
-    this(new PropertiesConfiguration(), configFile);
+  // helper for the constructor which takes a String file name
+  private static PropertiesConfiguration newPropsFile(String file) throws ConfigurationException
{
+    PropertiesConfiguration props = new PropertiesConfiguration();
+    props.setListDelimiter('\0');
+    props.load(file);
+    return props;
   }
 
-  private ClientConfiguration(PropertiesConfiguration propertiesConfiguration, String configFile)
throws ConfigurationException {
-    super(propertiesConfiguration);
-    // Don't do list interpolation
-    this.setListDelimiter('\0');
-    propertiesConfiguration.setListDelimiter('\0');
-    propertiesConfiguration.load(configFile);
+  // helper for the constructor which takes a File
+  private static PropertiesConfiguration newPropsFile(File file) throws ConfigurationException
{
+    PropertiesConfiguration props = new PropertiesConfiguration();
+    props.setListDelimiter('\0');
+    props.load(file);
+    return props;
   }
 
-  public ClientConfiguration(File configFile) throws ConfigurationException {
-    this(new PropertiesConfiguration(), configFile);
+  /**
+   * @deprecated since 1.9.0; removing commons-configuration leakage into the API in 2.0.0;
use {@link #fromFile(File)} instead.
+   */
+  @Deprecated
+  public ClientConfiguration(String configFile) throws ConfigurationException {
+    this(Collections.singletonList(newPropsFile(configFile)));
   }
 
-  private ClientConfiguration(PropertiesConfiguration propertiesConfiguration, File configFile)
throws ConfigurationException {
-    super(propertiesConfiguration);
-    // Don't do list interpolation
-    this.setListDelimiter('\0');
-    propertiesConfiguration.setListDelimiter('\0');
-    propertiesConfiguration.load(configFile);
+  /**
+   * Load a client configuration from the provided configuration properties file
+   *
+   * @param configFile
+   *          the path to the properties file
+   * @deprecated since 1.9.0; removing commons-configuration leakage into the API in 2.0.0;
use {@link #fromFile(File)} instead.
+   */
+  @Deprecated
+  public ClientConfiguration(File configFile) throws ConfigurationException {
+    this(Collections.singletonList(newPropsFile(configFile)));
   }
 
+  /**
+   * @deprecated since 1.9.0; removing commons-configuration leakage into the API in 2.0.0
 
 Review comment:
   I can change this. No problem.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Mime
View raw message