From 5d2b66b80dc72c0115c16dd8a9c9c1602cd576bf Mon Sep 17 00:00:00 2001 From: Kui LIU Date: Tue, 24 Apr 2018 10:12:44 +0200 Subject: [PATCH 1/2] CLOUDSTACK-10360: Change the method name. The method is named as "scoped" that seems to whether the variable config is scoped in _scopedStorages or not. Actually, the method tries to find a storage of which scope equals to the scope of config. So that, the method name "findStorage" should be more clear than "scoped". --- .../java/org/apache/cloudstack/framework/config/ConfigKey.java | 2 +- .../cloudstack/framework/config/impl/ConfigDepotImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java index 1734b98757b8..efc3d207058d 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java @@ -152,7 +152,7 @@ public T valueIn(Long id) { return value(); } - String value = s_depot != null ? s_depot.scoped(this).getConfigValue(id, this) : null; + String value = s_depot != null ? s_depot.findStorage(this).getConfigValue(id, this) : null; if (value == null) { return value(); } else { diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java index 6a85b90b70d3..f4e4ad0b9ff1 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java @@ -166,7 +166,7 @@ public ConfigurationDao global() { return _configDao; } - public ScopedConfigStorage scoped(ConfigKey config) { + public ScopedConfigStorage findStorage(ConfigKey config) { for (ScopedConfigStorage storage : _scopedStorages) { if (storage.getScope() == config.scope()) { return storage; From 443889e93b4f64eb74c7206e435e481b7b2d59dc Mon Sep 17 00:00:00 2001 From: Kui LIU Date: Tue, 24 Apr 2018 13:43:46 +0200 Subject: [PATCH 2/2] LOUDSTACK-10360: Change the method name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Further change the method name to "findScopedConfigStorage" with Rafael Weingärtner's comments. --- .../java/org/apache/cloudstack/framework/config/ConfigKey.java | 2 +- .../cloudstack/framework/config/impl/ConfigDepotImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java index efc3d207058d..2ace24dce5ac 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java @@ -152,7 +152,7 @@ public T valueIn(Long id) { return value(); } - String value = s_depot != null ? s_depot.findStorage(this).getConfigValue(id, this) : null; + String value = s_depot != null ? s_depot.findScopedConfigStorage(this).getConfigValue(id, this) : null; if (value == null) { return value(); } else { diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java index f4e4ad0b9ff1..bb49ce1042fd 100644 --- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java +++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java @@ -166,7 +166,7 @@ public ConfigurationDao global() { return _configDao; } - public ScopedConfigStorage findStorage(ConfigKey config) { + public ScopedConfigStorage findScopedConfigStorage(ConfigKey config) { for (ScopedConfigStorage storage : _scopedStorages) { if (storage.getScope() == config.scope()) { return storage;