lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [03/50] [abbrv] lucenenet git commit: Lucene.Net.Support: Removed Configuration namespace and AppSettings - now using environment variables exclusively
Date Sun, 05 Mar 2017 11:48:42 GMT
Lucene.Net.Support: Removed Configuration namespace and AppSettings - now using environment
variables exclusively


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

Branch: refs/heads/api-work
Commit: 0f87ced3fa9f47d47bab021799d176d3f608b3cd
Parents: 9691da4
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Mar 3 07:48:11 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Mar 5 17:08:28 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Lucene.Net.csproj           |   2 -
 src/Lucene.Net.Core/Support/AppSettings.cs      | 162 -------------------
 .../ConfigFileConfigurationExtensions.cs        |  61 -------
 .../ConfigFileConfigurationProvider.cs          |  67 --------
 .../ConfigFileConfigurationSource.cs            |  34 ----
 .../Support/Configuration/Configuration.cs      |  69 --------
 .../Configuration/ConfigurationExtensions.cs    |  44 -----
 .../Configuration/IConfigurationParser.cs       |  18 ---
 .../Support/Configuration/KeyValueParser.cs     | 121 --------------
 .../SettingsConfigurationParser.cs              |  64 --------
 .../Support/RandomizedTest.cs                   |   3 +-
 .../Util/LuceneTestCase.cs                      |   1 -
 12 files changed, 1 insertion(+), 645 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Lucene.Net.csproj b/src/Lucene.Net.Core/Lucene.Net.csproj
index 40006b3..3ed5c88 100644
--- a/src/Lucene.Net.Core/Lucene.Net.csproj
+++ b/src/Lucene.Net.Core/Lucene.Net.csproj
@@ -596,7 +596,6 @@
     <Compile Include="Store\SingleInstanceLockFactory.cs" />
     <Compile Include="Store\TrackingDirectoryWrapper.cs" />
     <Compile Include="Store\VerifyingLockFactory.cs" />
-    <Compile Include="Support\AppSettings.cs" />
     <Compile Include="Support\AtomicBoolean.cs" />
     <Compile Include="Support\AtomicInteger.cs" />
     <Compile Include="Support\AtomicLong.cs" />
@@ -631,7 +630,6 @@
     <Compile Include="Support\Compatibility\Collections.cs" />
     <Compile Include="Support\ConcurrentHashMapWrapper.cs" />
     <Compile Include="Support\ConcurrentHashSet.cs" />
-    <Compile Include="Support\Configuration\Configuration.cs" />
     <Compile Include="Support\CultureContext.cs" />
     <Compile Include="Support\DataInputStream.cs" />
     <Compile Include="Support\DataOutputStream.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/AppSettings.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/AppSettings.cs b/src/Lucene.Net.Core/Support/AppSettings.cs
deleted file mode 100644
index 83ee7d6..0000000
--- a/src/Lucene.Net.Core/Support/AppSettings.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
-
-namespace Lucene.Net.Support
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public class AppSettings
-    {
-        private static System.Collections.Specialized.ListDictionary settings = new System.Collections.Specialized.ListDictionary();
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, int defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, long defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, System.String defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        public static void Set(System.String key, bool defValue)
-        {
-            settings[key] = defValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static int Get(System.String key, int defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (int)settings[key];
-            }
-
-            var theValue = Configuration.Configuration.GetAppSetting(key);
-
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            int retValue = Convert.ToInt32(theValue.Trim());
-            settings[key] = retValue;
-            return retValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static long Get(System.String key, long defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (long)settings[key];
-            }
-
-            var theValue = Configuration.Configuration.GetAppSetting(key);
-
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            long retValue = Convert.ToInt64(theValue.Trim());
-            settings[key] = retValue;
-            return retValue;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="defValue"></param>
-        /// <returns></returns>
-        public static System.String Get(System.String key, System.String defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (System.String)settings[key];
-            }
-
-            System.String theValue = Configuration.Configuration.GetAppSetting(key);
-
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            settings[key] = theValue;
-            return theValue;
-        }
-
-        public static bool Get(System.String key, bool defValue)
-        {
-            if (settings[key] != null)
-            {
-                return (bool)settings[key];
-            }
-
-            var theValue = Configuration.Configuration.GetAppSetting(key);
-
-            if (theValue == null)
-            {
-                return defValue;
-            }
-            bool retValue = Convert.ToBoolean(theValue.Trim());
-            settings[key] = retValue;
-            return retValue;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationExtensions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationExtensions.cs
b/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationExtensions.cs
deleted file mode 100644
index 905ac36..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationExtensions.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. 
-//See https://github.com/aspnet/Entropy/blob/dev/LICENSE.txt in the project root for license
information.
-
-//Code modified to work with latest version of framework.
-
-using System;
-using System.IO;
-using Microsoft.Extensions.Configuration;
-
-namespace Lucene.Net.Support.Configuration
-{
-    public static class ConfigFileConfigurationExtensions
-    {
-        /// <summary>
-        /// Adds configuration values for a *.config file to the ConfigurationBuilder
-        /// </summary>
-        /// <param name="builder">Builder to add configuration values to</param>
-        /// <param name="path">Path to *.config file</param>
-        /// <param name="optional">true if file is optional; false otherwise</param>
-        /// <param name="parsers">Additional parsers to use to parse the config file</param>
-        public static IConfigurationBuilder AddConfigFile(this IConfigurationBuilder builder,
string path, bool optional, params IConfigurationParser[] parsers)
-        {
-            if (path == null)
-            {
-                throw new ArgumentNullException(nameof(path));
-            }
-            else if (string.IsNullOrEmpty(path))
-            {
-                throw new ArgumentException("Path for configuration cannot be null/empty.",
nameof(path));
-            }
-
-            if (!optional && !File.Exists(path))
-            {
-                throw new FileNotFoundException($"Could not find configuration file. File:
[{path}]", path);
-            }
-
-            return builder.Add(new ConfigFileConfigurationSource(path, true, optional, parsers));
-        }
-
-        /// <summary>
-        /// Adds configuration values for an XML configuration the ConfigurationBuilder
-        /// </summary>
-        /// <param name="builder">Builder to add configuration values to</param>
-        /// <param name="configurationContents">XML Contents of configuration</param>
-        /// <param name="parsers">Additional parsers to use to parse the config file</param>
-        public static IConfigurationBuilder AddConfigFile(this IConfigurationBuilder builder,
string configurationContents, params IConfigurationParser[] parsers)
-        {
-            if (configurationContents == null)
-            {
-                throw new ArgumentNullException(nameof(configurationContents));
-            }
-            else if (string.IsNullOrEmpty(configurationContents))
-            {
-                throw new ArgumentException("Path for configuration cannot be null/empty.",
nameof(configurationContents));
-            }
-
-            return builder.Add(new ConfigFileConfigurationSource(configurationContents, false,
false, parsers));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationProvider.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationProvider.cs
b/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationProvider.cs
deleted file mode 100644
index 446ce9a..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationProvider.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. 
-//See https://github.com/aspnet/Entropy/blob/dev/LICENSE.txt in the project root for license
information.
-
-//Code modified to work with latest version of framework.
-
-using Microsoft.Extensions.Configuration;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml.Linq;
-
-namespace Lucene.Net.Support.Configuration
-{
-    public class ConfigFileConfigurationProvider : ConfigurationProvider
-    {
-        private readonly string _configuration;
-        private readonly bool _loadFromFile;
-        private readonly bool _isOptional;
-
-        private readonly IEnumerable<IConfigurationParser> _parsers;
-
-        public ConfigFileConfigurationProvider(string configuration, bool loadFromFile, bool
optional, IEnumerable<IConfigurationParser> parsers)
-        {
-            _loadFromFile = loadFromFile;
-            _configuration = configuration;
-            _isOptional = optional;
-            _parsers = parsers;
-        }
-
-        public override void Load()
-        {
-            if (_loadFromFile && !_isOptional && !File.Exists(_configuration))
-            {
-                throw new FileNotFoundException("Could not find configuration file to load.",
_configuration);
-            }
-
-            var document = _loadFromFile ? XDocument.Load(_configuration) : XDocument.Parse(_configuration);
-
-            var context = new Stack<string>();
-            var dictionary = new SortedDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
-
-            foreach (var child in document.Root.Elements())
-            {
-                ParseElement(child, context, dictionary);
-            }
-
-            Data = dictionary;
-        }
-
-        /// <summary>
-        /// Given an XElement tries to parse that element using any of the KeyValueParsers
-        /// and adds it to the results dictionary
-        /// </summary>
-        private void ParseElement(XElement element, Stack<string> context, SortedDictionary<string,
string> results)
-        {
-            foreach (var parser in _parsers)
-            {
-                if (parser.CanParseElement(element))
-                {
-                    parser.ParseElement(element, context, results);
-                    break;
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationSource.cs b/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationSource.cs
deleted file mode 100644
index 93624e1..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/ConfigFileConfigurationSource.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.Extensions.Configuration;
-
-namespace Lucene.Net.Support.Configuration
-{
-    public class ConfigFileConfigurationSource : IConfigurationSource
-    {
-        public string Configuration { get; set; }
-        public bool LoadFromFile { get; set; }
-        public bool Optional { get; set; }
-        public IEnumerable<IConfigurationParser> Parsers { get; set; }
-
-        public ConfigFileConfigurationSource(string configuration, bool loadFromFile, bool
optional, params IConfigurationParser[] parsers)
-        { 
-            LoadFromFile = loadFromFile;
-            Configuration = configuration;
-            Optional = optional;
-
-            var parsersToUse = new List<IConfigurationParser> {
-                new KeyValueParser(),
-                new KeyValueParser("name", "connectionString")
-            };
-
-            parsersToUse.AddRange(parsers);
-
-            Parsers = parsersToUse.ToArray();
-        }
-
-        public IConfigurationProvider Build(IConfigurationBuilder builder)
-        {
-            return new ConfigFileConfigurationProvider(Configuration, LoadFromFile, Optional,
Parsers);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/Configuration.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/Configuration.cs b/src/Lucene.Net.Core/Support/Configuration/Configuration.cs
deleted file mode 100644
index ee9372d..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/Configuration.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-#if NETSTANDARD
-using Microsoft.Extensions.Configuration;
-using System.IO;
-using System.Reflection;
-#else
-using System.Configuration;
-#endif
-
-namespace Lucene.Net.Support.Configuration
-{
-    public static class Configuration
-    {
-#if NETSTANDARD
-        private static IConfigurationRoot _configuration;
-
-        static Configuration()
-        {
-            var builder = new ConfigurationBuilder();
-            var entryAssembly = Assembly.GetEntryAssembly();
-            var configurationFiles = new string[0];
-
-            if (entryAssembly != null)
-            {
-                var directory = Path.GetDirectoryName(entryAssembly.Location);
-                configurationFiles = Directory.GetFiles(directory, "*.config");
-            }
-
-            foreach (var config in configurationFiles)
-            {
-                builder.AddConfigFile(config, false, new KeyValueParser());
-            }
-
-            _configuration = builder.Build();
-        }
-#endif
-
-        public static string GetAppSetting(string key)
-        {
-#if NETSTANDARD
-
-            return _configuration.GetAppSetting(key);
-#else
-            return ConfigurationManager.AppSettings[key];
-#endif
-        }
-
-        public static string GetAppSetting(string key, string defaultValue)
-        {
-            string setting = GetAppSetting(key);
-            return string.IsNullOrEmpty(setting) ? defaultValue : setting;
-        }
-
-        /// <summary>
-        /// Gets the value for the AppSetting with specified key.  
-        /// If key is not present, default value is returned.
-        /// If key is present, value is converted to specified type based on the conversionFunction
specified.
-        /// </summary>
-        /// <typeparam name="T"></typeparam>
-        /// <param name="key"></param>
-        /// <param name="conversionFunction"></param>
-        /// <param name="defaultValue"></param>
-        /// <returns></returns>
-        public static T GetProperty<T>(string key, T defaultValue, System.Func<string,
T> conversionFunction)
-        {
-            string setting = GetAppSetting(key);
-            return string.IsNullOrEmpty(setting) ? defaultValue : conversionFunction(setting);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/ConfigurationExtensions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/ConfigurationExtensions.cs b/src/Lucene.Net.Core/Support/Configuration/ConfigurationExtensions.cs
deleted file mode 100644
index 8ec54ad..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/ConfigurationExtensions.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. 
-//See https://github.com/aspnet/Entropy/blob/dev/LICENSE.txt in the project root for license
information.
-
-//Code modified to work with latest version of framework.
-
-using System;
-using System.Collections.Immutable;
-using Microsoft.Extensions.Configuration;
-
-namespace Lucene.Net.Support.Configuration
-{
-    public static class ConfigurationExtensions
-    {
-        public const string AppSettings = "appSettings";
-
-        public static string GetAppSetting(this IConfiguration configuration, string name)
-        {
-            return configuration?.GetSection(AppSettings)[name];
-        }
-        
-         public static ImmutableDictionary<string, IConfigurationSection> GetSection(this
IConfiguration configuration, params string[] sectionNames)
-        {
-            if (sectionNames.Length == 0)
-                return ImmutableDictionary<string, IConfigurationSection>.Empty;
-            
-            var fullKey = string.Join(ConfigurationPath.KeyDelimiter, sectionNames);
-
-            return configuration?.GetSection(fullKey).GetChildren()?.ToImmutableDictionary(x
=> x.Key, x => x);
-        }
-
-        public static string GetValue(this IConfiguration configuration, params string[]
keys)
-        {
-            if (keys.Length == 0)
-            {
-                throw new ArgumentException("Need to provide keys", nameof(keys));
-            }
-           
-            var fullKey = string.Join(ConfigurationPath.KeyDelimiter, keys);
-
-            return configuration?[fullKey];
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/IConfigurationParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/IConfigurationParser.cs b/src/Lucene.Net.Core/Support/Configuration/IConfigurationParser.cs
deleted file mode 100644
index d94086e..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/IConfigurationParser.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. 
-//See https://github.com/aspnet/Entropy/blob/dev/LICENSE.txt in the project root for license
information.
-
-//Code modified to work with latest version of framework.
-
-using System.Collections.Generic;
-using System.Xml.Linq;
-
-namespace Lucene.Net.Support.Configuration
-{
-    public interface IConfigurationParser
-    {
-        bool CanParseElement(XElement element);
-
-        void ParseElement(XElement element, Stack<string> context, SortedDictionary<string,
string> results);
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/KeyValueParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/KeyValueParser.cs b/src/Lucene.Net.Core/Support/Configuration/KeyValueParser.cs
deleted file mode 100644
index 27216b1..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/KeyValueParser.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. 
-//See https://github.com/aspnet/Entropy/blob/dev/LICENSE.txt in the project root for license
information.
-
-//Code modified to work with latest version of framework.
-
-using Microsoft.Extensions.Configuration;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Lucene.Net.Support.Configuration
-{
-
-    internal enum ConfigurationAction
-    {
-        Add,
-        Remove,
-        Clear
-    }
-  
-    public class KeyValueParser : IConfigurationParser
-    {
-        private readonly string _keyName = "key";
-        private readonly string _valueName = "value";
-        private readonly string[] _supportedActions = Enum.GetNames(typeof(ConfigurationAction)).Select(x
=> x.ToLowerInvariant()).ToArray();
-
-        public KeyValueParser()
-            : this("key", "value")
-        { }
-
-        public KeyValueParser(string key, string value)
-        {
-            _keyName = key;
-            _valueName = value;
-         }
-
-        public bool CanParseElement(XElement element)
-        {
-            var hasKeyAttribute = element.DescendantsAndSelf().Any(x => x.Attribute(_keyName)
!= null);
-
-            return hasKeyAttribute;
-        }
-
-        public void ParseElement(XElement element, Stack<string> context, SortedDictionary<string,
string> results)
-        {
-            if (!CanParseElement(element))
-            {
-                return;
-            }
-
-            if (!element.Elements().Any())
-            {
-                AddToDictionary(element, context, results);
-            }
-
-            context.Push(element.Name.ToString());
-
-            foreach (var node in element.Elements())
-            {
-                var hasSupportedAction = node.DescendantsAndSelf().Any(x => _supportedActions.Contains(x.Name.ToString().ToLowerInvariant()));
-
-                if (!hasSupportedAction)
-                {
-                    continue;
-                }
-
-                ParseElement(node, context, results);
-            }
-
-            context.Pop();
-        }
-
-        private void AddToDictionary(XElement element, Stack<string> context, SortedDictionary<string,
string> results)
-        {
-            ConfigurationAction action;
-
-            if (!Enum.TryParse(element.Name.ToString(), true, out action))
-            {
-                return;
-            }
-
-            var key = element.Attribute(_keyName);
-            var value = element.Attribute(_valueName);
-
-            if (key == null)
-            {
-                return;
-            }
-
-            var fullkey = GetKey(context, key.Value);
-
-            switch (action)
-            {
-                case ConfigurationAction.Add:
-                    string valueToAdd = value.Value;
-
-                    if (results.ContainsKey(fullkey))
-                    {
-                        results[fullkey] = valueToAdd;
-                    }
-                    else
-                    {
-                        results.Add(fullkey, valueToAdd);
-                    }
-                    break;
-                case ConfigurationAction.Remove:
-                    results.Remove(fullkey);
-                    break;
-                default:
-                    throw new NotSupportedException($"Unsupported action: [{action}]");
-            }
-        }
-
-        private static string GetKey(Stack<string> context, string name)
-        {
-            return ConfigurationPath.Combine(context.Reverse().Concat(new[] { name }));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.Core/Support/Configuration/SettingsConfigurationParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Configuration/SettingsConfigurationParser.cs b/src/Lucene.Net.Core/Support/Configuration/SettingsConfigurationParser.cs
deleted file mode 100644
index 0e747e6..0000000
--- a/src/Lucene.Net.Core/Support/Configuration/SettingsConfigurationParser.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-
-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 bool CanParseElement(XElement element)
-        {
-            var ns = element.GetDefaultNamespace() ?? XNamespace.None;
-            var matching = element.DescendantsAndSelf(ns.GetName(SettingsElement)).ToArray();
-            return matching.Any();
-        }
-
-        public void ParseElement(XElement element, Stack<string> context, SortedDictionary<string,
string> results)
-        {
-            var ns = element.GetDefaultNamespace() ?? XNamespace.None;
-
-            if (!CanParseElement(element))
-            {
-                return;
-            }
-
-            context.Push(SettingsElement);
-
-            XName settingElement = ns.GetName(SettingElement);
-            XName valueAttribute = ns.GetName(Value);
-
-            var allSettings = element.DescendantsAndSelf(settingElement).ToArray();
-
-            foreach (var setting in allSettings)
-            {
-                var nameElement = setting.Attribute(Name);
-
-                context.Push(nameElement.Value);
-
-                foreach (var valueElement in setting.Descendants(valueAttribute))
-                {
-                    var profileName = valueElement.Attribute(Profile).Value;
-                    results.Add(GetKey(context, profileName), valueElement.Value);
-                }
-
-                context.Pop();
-            }
-
-            context.Pop();
-        }
-
-        private static string GetKey(Stack<string> context, string name)
-        {
-            return ConfigurationPath.Combine(context.Reverse().Concat(new[] { name }));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.TestFramework/Support/RandomizedTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Support/RandomizedTest.cs b/src/Lucene.Net.TestFramework/Support/RandomizedTest.cs
index 71a826a..a24ee2f 100644
--- a/src/Lucene.Net.TestFramework/Support/RandomizedTest.cs
+++ b/src/Lucene.Net.TestFramework/Support/RandomizedTest.cs
@@ -1,5 +1,4 @@
-using Lucene.Net.Support.Configuration;
-using NUnit.Framework;
+using NUnit.Framework;
 
 
 namespace Lucene.Net.TestFramework.Support

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0f87ced3/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index c7521a6..bb93c12 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -36,7 +36,6 @@ using System.Reflection;
 namespace Lucene.Net.Util
 {
     using Lucene.Net.TestFramework.Support;
-    using Support.Configuration;
     using System.IO;
     using System.Reflection;
     using AlcoholicMergePolicy = Lucene.Net.Index.AlcoholicMergePolicy;


Mime
View raw message