cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [05/14] cassandra git commit: Ninja: Make Config.log() static to avoid loading "log" as a YAML property (broken by CASSANDRA-11217)
Date Fri, 11 Mar 2016 19:26:36 GMT
Ninja: Make Config.log() static to avoid loading "log" as a YAML property (broken by CASSANDRA-11217)


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c947a2c4
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c947a2c4
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c947a2c4

Branch: refs/heads/cassandra-3.0
Commit: c947a2c4228816f0e069b2f6fed4b725c9cb710e
Parents: 11b7dc1
Author: Paulo Motta <pauloricardomg@gmail.com>
Authored: Fri Mar 11 16:04:20 2016 -0300
Committer: T Jake Luciani <jake@apache.org>
Committed: Fri Mar 11 14:24:04 2016 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/Config.java             | 7 ++++---
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c947a2c4/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index c7ad837..be5f175 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -388,10 +388,11 @@ public class Config
         add("client_encryption_options");
         add("server_encryption_options");
     }};
-    public void log()
+
+    public static void log(Config config)
     {
         Map<String, String> configMap = new TreeMap<>();
-        for (Field field : getClass().getFields())
+        for (Field field : Config.class.getFields())
         {
             // ignore the constants
             if (Modifier.isFinal(field.getModifiers()))
@@ -408,7 +409,7 @@ public class Config
             try
             {
                 // Field.get() can throw NPE if the value of the field is null
-                value = field.get(this).toString();
+                value = field.get(config).toString();
             }
             catch (NullPointerException | IllegalAccessException npe)
             {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c947a2c4/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index afae298..5ad62c3 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -137,7 +137,7 @@ public class DatabaseDescriptor
         if (!hasLoggedConfig)
         {
             hasLoggedConfig = true;
-            config.log();
+            Config.log(config);
         }
 
         return config;


Mime
View raw message