You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2022/08/12 11:35:58 UTC

[accumulo] branch main updated: Fix AccumuloConfiguration.get(String) to get Property by key (#2876)

This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new bbc131357d Fix AccumuloConfiguration.get(String) to get Property by key (#2876)
bbc131357d is described below

commit bbc131357d22954681504237c82ee2b92cb4a991
Author: Dave Marion <dl...@apache.org>
AuthorDate: Fri Aug 12 07:35:53 2022 -0400

    Fix AccumuloConfiguration.get(String) to get Property by key (#2876)
    
    Prior commit attempted to create a Property by enum value using the key.
    Fixed this to call Property.getPropertyByKey instead.
---
 .../java/org/apache/accumulo/core/conf/AccumuloConfiguration.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 6fdfe69159..ff3f6106f8 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -80,10 +80,10 @@ public abstract class AccumuloConfiguration implements Iterable<Entry<String,Str
    * @return property value
    */
   public String get(String property) {
-    try {
-      return get(Property.valueOf(property));
-    } catch (IllegalArgumentException e) {
-      // Could be a client or custom property, fall back to filtering
+    Property p = Property.getPropertyByKey(property);
+    if (p != null) {
+      return get(p);
+    } else {
       Map<String,String> propMap = new HashMap<>(1);
       getProperties(propMap, key -> Objects.equals(property, key));
       return propMap.get(property);