Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 97F02200C60 for ; Sun, 9 Apr 2017 20:25:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 969A8160B88; Sun, 9 Apr 2017 18:25:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C7C42160BAA for ; Sun, 9 Apr 2017 20:25:49 +0200 (CEST) Received: (qmail 9054 invoked by uid 500); 9 Apr 2017 18:25:48 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 9043 invoked by uid 99); 9 Apr 2017 18:25:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Apr 2017 18:25:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 809DCDFD9E; Sun, 9 Apr 2017 18:25:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Sun, 09 Apr 2017 18:25:48 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/6] lucenenet git commit: Lucene.Net.Support.Configuration.SettingsConfigurationParser refactor: Renamed constants upper case to follow Lucene convention archived-at: Sun, 09 Apr 2017 18:25:50 -0000 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 Authored: Sun Apr 9 21:48:02 2017 +0700 Committer: Shad Storhaug 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(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); }