lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [1/6] lucenenet git commit: Lucene.Net.Support.Configuration.SettingsConfigurationParser refactor: Renamed constants upper case to follow Lucene convention
Date Sun, 09 Apr 2017 18:25:48 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/api-work bc15f375d -> 1b50f1dd9


Lucene.Net.Support.Configuration.SettingsConfigurationParser refactor: Renamed constants upper
case to follow Lucene convention


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

Branch: refs/heads/api-work
Commit: d2918f43589bc290a3011c790d3a288cac68bc5c
Parents: bc15f37
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Apr 9 21:48:02 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Apr 9 21:48:02 2017 +0700

----------------------------------------------------------------------
 .../JS/JavascriptCompiler.cs                    |  2 +-
 .../SettingsConfigurationParser.cs              | 22 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d2918f43/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
index 75052a8..a6adabb 100644
--- a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
+++ b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
@@ -671,7 +671,7 @@ namespace Lucene.Net.Expressions.JS
 
             var configuration = new ConfigurationBuilder().AddConfigFile(contents, new SettingsConfigurationParser()).Build();
 
-            var settingsSection = configuration.GetSection(SettingsConfigurationParser.SettingsElement);
+            var settingsSection = configuration.GetSection(SettingsConfigurationParser.SETTINGS_ELEMENT);
             var values = settingsSection.GetChildren().Select(section => new KeyValuePair<string,
string>(section.Key, section.GetValue("(Default)"))).ToArray();
             return values;
 #else

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d2918f43/src/Lucene.Net/Support/Configuration/SettingsConfigurationParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/Configuration/SettingsConfigurationParser.cs b/src/Lucene.Net/Support/Configuration/SettingsConfigurationParser.cs
index 0e747e6..d5551e5 100644
--- a/src/Lucene.Net/Support/Configuration/SettingsConfigurationParser.cs
+++ b/src/Lucene.Net/Support/Configuration/SettingsConfigurationParser.cs
@@ -9,16 +9,16 @@ namespace Lucene.Net.Support.Configuration
 {
     public class SettingsConfigurationParser : IConfigurationParser
     {
-        public const string SettingsElement = "Settings";
-        private const string SettingElement = "Setting";
-        private const string Name = "Name";
-        private const string Value = "Value";
-        private const string Profile = "Profile";
+        public const string SETTINGS_ELEMENT = "Settings";
+        private const string SETTING_ELEMENT = "Setting";
+        private const string NAME = "Name";
+        private const string VALUE = "Value";
+        private const string PROFILE = "Profile";
 
         public bool CanParseElement(XElement element)
         {
             var ns = element.GetDefaultNamespace() ?? XNamespace.None;
-            var matching = element.DescendantsAndSelf(ns.GetName(SettingsElement)).ToArray();
+            var matching = element.DescendantsAndSelf(ns.GetName(SETTINGS_ELEMENT)).ToArray();
             return matching.Any();
         }
 
@@ -31,22 +31,22 @@ namespace Lucene.Net.Support.Configuration
                 return;
             }
 
-            context.Push(SettingsElement);
+            context.Push(SETTINGS_ELEMENT);
 
-            XName settingElement = ns.GetName(SettingElement);
-            XName valueAttribute = ns.GetName(Value);
+            XName settingElement = ns.GetName(SETTING_ELEMENT);
+            XName valueAttribute = ns.GetName(VALUE);
 
             var allSettings = element.DescendantsAndSelf(settingElement).ToArray();
 
             foreach (var setting in allSettings)
             {
-                var nameElement = setting.Attribute(Name);
+                var nameElement = setting.Attribute(NAME);
 
                 context.Push(nameElement.Value);
 
                 foreach (var valueElement in setting.Descendants(valueAttribute))
                 {
-                    var profileName = valueElement.Attribute(Profile).Value;
+                    var profileName = valueElement.Attribute(PROFILE).Value;
                     results.Add(GetKey(context, profileName), valueElement.Value);
                 }
 


Mime
View raw message