Lucene.Net.Core.Store.LockVerifyServer refactor: renamed fields camelCase

--- src/Lucene.Net.Core/Store/LockVerifyServer.cs
+++ src/Lucene.Net.Core/Store/LockVerifyServer.cs
@@ -101,22 +101,22 @@

         private class ThreadAnonymousInnerClassHelper : ThreadClass
         {
-            private object LocalLock;
-            private int[] LockedID;
-            private CountdownEvent StartingGun;
-            private Socket Cs;
+            private object localLock;
+            private int[] lockedID;
+            private CountdownEvent startingGun;
+            private Socket cs;

             public ThreadAnonymousInnerClassHelper(object localLock, int[] lockedID, CountdownEvent startingGun, Socket cs)
             {
-                this.LocalLock = localLock;
-                this.LockedID = lockedID;
-                this.StartingGun = startingGun;
-                this.Cs = cs;
+                this.localLock = localLock;
+                this.lockedID = lockedID;
+                this.startingGun = startingGun;
+                this.cs = cs;
             }

             public override void Run()
             {
-                using (Stream @in = new NetworkStream(Cs), os = new NetworkStream(Cs))
+                using (Stream @in = new NetworkStream(cs), os = new NetworkStream(cs))
                 {
                     BinaryReader intReader = new BinaryReader(@in);
                     BinaryWriter intWriter = new BinaryWriter(os);
@@ -129,7 +129,7 @@
                         }

                         //LUCENE TO-DO NOt sure about this
-                        StartingGun.Wait();
+                        startingGun.Wait();
                         intWriter.Write(43);
                         os.Flush();

@@ -141,9 +141,9 @@
                                 return; // closed
                             }

-                            lock (LocalLock)
+                            lock (localLock)
                             {
-                                int currentLock = LockedID[0];
+                                int currentLock = lockedID[0];
                                 if (currentLock == -2)
                                 {
                                     return; // another thread got error, so we exit, too!
@@ -154,20 +154,20 @@
                                         // Locked
                                         if (currentLock != -1)
                                         {
-                                            LockedID[0] = -2;
+                                            lockedID[0] = -2;
                                             throw new InvalidOperationException("id " + id + " got lock, but " + currentLock + " already holds the lock");
                                         }
-                                        LockedID[0] = id;
+                                        lockedID[0] = id;
                                         break;

                                     case 0:
                                         // Unlocked
                                         if (currentLock != id)
                                         {
-                                            LockedID[0] = -2;
+                                            lockedID[0] = -2;
                                             throw new InvalidOperationException("id " + id + " released the lock, but " + currentLock + " is the one holding the lock");
                                         }
-                                        LockedID[0] = -1;
+                                        lockedID[0] = -1;
                                         break;

                                     default:
@@ -184,7 +184,7 @@
                     }
                     finally
                     {
-                        IOUtils.CloseWhileHandlingException(Cs);
+                        IOUtils.CloseWhileHandlingException(cs);
                     }
                 }
             }


BUG: Lucene.Net.Tests.Index.TestIndexWriter: Pascal case Random field name conflict with LuceneTestCase.Random causing null reference exception

--- src/Lucene.Net.Tests/Index/TestIndexWriter.cs
+++ src/Lucene.Net.Tests/Index/TestIndexWriter.cs
@@ -34,6 +34,7 @@
     using Lucene.Net.Util;
     using NUnit.Framework;
     using System.Diagnostics;
+    using System.Globalization;
     using System.IO;
     using Automaton = Lucene.Net.Util.Automaton.Automaton;
     using BaseDirectoryWrapper = Lucene.Net.Store.BaseDirectoryWrapper;
@@ -1140,73 +1141,76 @@

         private class IndexerThreadInterrupt : ThreadClass
         {
-            private readonly TestIndexWriter OuterInstance;
-
-            internal volatile bool Failed;
-            internal volatile bool Finish;
-
-            internal volatile bool AllowInterrupt = false;
-            internal readonly Random Random;
-            internal readonly Directory Adder;
+            private readonly TestIndexWriter outerInstance;
+
+            internal volatile bool failed;
+            internal volatile bool finish;
+
+            internal volatile bool allowInterrupt = false;
+            internal readonly Random random;
+            internal readonly Directory adder;

             internal IndexerThreadInterrupt(TestIndexWriter outerInstance)
             {
-                this.OuterInstance = outerInstance;
-                this.Random = new Random(Random.Next());
+                this.outerInstance = outerInstance;
+                this.IsDebug = true; // LUCENENET: Rethrow with the original stack trace to assist with debugging
+                this.random = new Random(LuceneTestCase.Random.Next());
                 // make a little directory for addIndexes
                 // LUCENE-2239: won't work with NIOFS/MMAP
-                Adder = new MockDirectoryWrapper(this.Random, new RAMDirectory());
-                IndexWriterConfig conf = OuterInstance.NewIndexWriterConfig(this.Random, TEST_VERSION_CURRENT, new MockAnalyzer(this.Random));
-                IndexWriter w = new IndexWriter(Adder, conf);
-                Document doc = new Document();
-                doc.Add(NewStringField(this.Random, "id", "500", Field.Store.NO));
-                doc.Add(NewField(this.Random, "field", "some prepackaged text contents", StoredTextType));
-                if (DefaultCodecSupportsDocValues)
-                {
-                    doc.Add(new BinaryDocValuesField("binarydv", new BytesRef("500")));
-                    doc.Add(new NumericDocValuesField("numericdv", 500));
-                    doc.Add(new SortedDocValuesField("sorteddv", new BytesRef("500")));
-                }
-                if (DefaultCodecSupportsSortedSet)
-                {
-                    doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("one")));
-                    doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
-                }
-                w.AddDocument(doc);
-                doc = new Document();
-                doc.Add(NewStringField(this.Random, "id", "501", Field.Store.NO));
-                doc.Add(NewField(this.Random, "field", "some more contents", StoredTextType));
-                if (DefaultCodecSupportsDocValues)
-                {
-                    doc.Add(new BinaryDocValuesField("binarydv", new BytesRef("501")));
-                    doc.Add(new NumericDocValuesField("numericdv", 501));
-                    doc.Add(new SortedDocValuesField("sorteddv", new BytesRef("501")));
-                }
-                if (DefaultCodecSupportsSortedSet)
-                {
-                    doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
-                    doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("three")));
-                }
-                w.AddDocument(doc);
-                w.DeleteDocuments(new Term("id", "500"));
-                w.Dispose();
+                adder = new MockDirectoryWrapper(this.random, new RAMDirectory());
+                IndexWriterConfig conf = this.outerInstance.NewIndexWriterConfig(this.random, TEST_VERSION_CURRENT, new MockAnalyzer(this.random));
+                using (IndexWriter w = new IndexWriter(adder, conf))
+                {
+                    Document doc = new Document();
+                    doc.Add(NewStringField(this.random, "id", "500", Field.Store.NO));
+                    doc.Add(NewField(this.random, "field", "some prepackaged text contents", StoredTextType));
+                    if (DefaultCodecSupportsDocValues)
+                    {
+                        doc.Add(new BinaryDocValuesField("binarydv", new BytesRef("500")));
+                        doc.Add(new NumericDocValuesField("numericdv", 500));
+                        doc.Add(new SortedDocValuesField("sorteddv", new BytesRef("500")));
+                    }
+                    if (DefaultCodecSupportsSortedSet)
+                    {
+                        doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("one")));
+                        doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
+                    }
+                    w.AddDocument(doc);
+                    doc = new Document();
+                    doc.Add(NewStringField(this.random, "id", "501", Field.Store.NO));
+                    doc.Add(NewField(this.random, "field", "some more contents", StoredTextType));
+                    if (DefaultCodecSupportsDocValues)
+                    {
+                        doc.Add(new BinaryDocValuesField("binarydv", new BytesRef("501")));
+                        doc.Add(new NumericDocValuesField("numericdv", 501));
+                        doc.Add(new SortedDocValuesField("sorteddv", new BytesRef("501")));
+                    }
+                    if (DefaultCodecSupportsSortedSet)
+                    {
+                        doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
+                        doc.Add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("three")));
+                    }
+                    w.AddDocument(doc);
+                    w.DeleteDocuments(new Term("id", "500"));
+                } // w.Dispose();
             }

             public override void Run()
             {
                 // LUCENE-2239: won't work with NIOFS/MMAP
-                MockDirectoryWrapper dir = new MockDirectoryWrapper(Random, new RAMDirectory());
+                MockDirectoryWrapper dir = new MockDirectoryWrapper(random, new RAMDirectory());
+                //var dir = new RAMDirectory();

                 // When interrupt arrives in w.Dispose(), when it's
                 // writing liveDocs, this can lead to double-write of
                 // _X_N.del:
                 //dir.setPreventDoubleWrite(false);
                 IndexWriter w = null;
-                while (!Finish)
+                while (!finish)
                 {
                     try
                     {
-                        while (!Finish)
+                        while (!finish)
                         {
                             if (w != null)
                             {
@@ -1218,17 +1222,17 @@
                                 w.Dispose();
                                 w = null;
                             }
-                            IndexWriterConfig conf = OuterInstance.NewIndexWriterConfig(Random, TEST_VERSION_CURRENT, new MockAnalyzer(Random)).SetMaxBufferedDocs(2);
+                            IndexWriterConfig conf = outerInstance.NewIndexWriterConfig(random, TEST_VERSION_CURRENT, new MockAnalyzer(random)).SetMaxBufferedDocs(2);
                             w = new IndexWriter(dir, conf);

                             Document doc = new Document();
-                            Field idField = NewStringField(Random, "id", "", Field.Store.NO);
+                            Field idField = NewStringField(random, "id", "", Field.Store.NO);
                             Field binaryDVField = null;
                             Field numericDVField = null;
                             Field sortedDVField = null;
                             Field sortedSetDVField = new SortedSetDocValuesField("sortedsetdv", new BytesRef());
                             doc.Add(idField);
-                            doc.Add(NewField(Random, "field", "some text contents", StoredTextType));
+                            doc.Add(NewField(random, "field", "some text contents", StoredTextType));
                             if (DefaultCodecSupportsDocValues)
                             {
                                 binaryDVField = new BinaryDocValuesField("binarydv", new BytesRef());
@@ -1252,10 +1256,10 @@
                                     sortedDVField.SetBytesValue(new BytesRef(idField.GetStringValue()));
                                 }
                                 sortedSetDVField.SetBytesValue(new BytesRef(idField.GetStringValue()));
-                                int action = Random.Next(100);
+                                int action = random.Next(100);
                                 if (action == 17)
                                 {
-                                    w.AddIndexes(Adder);
+                                    w.AddIndexes(adder);
                                 }
                                 else if (action % 30 == 0)
                                 {
@@ -1269,15 +1273,15 @@
                                 {
                                     w.AddDocument(doc);
                                 }
-                                if (Random.Next(3) == 0)
+                                if (random.Next(3) == 0)
                                 {
                                     IndexReader r = null;
                                     try
                                     {
-                                        r = DirectoryReader.Open(w, Random.NextBoolean());
-                                        if (Random.NextBoolean() && r.MaxDoc > 0)
+                                        r = DirectoryReader.Open(w, random.NextBoolean());
+                                        if (random.NextBoolean() && r.MaxDoc > 0)
                                         {
-                                            int docid = Random.Next(r.MaxDoc);
+                                            int docid = random.Next(r.MaxDoc);
                                             w.TryDeleteDocument(r, docid);
                                         }
                                     }
@@ -1290,14 +1294,15 @@
                                 {
                                     w.Commit();
                                 }
-                                if (Random.Next(50) == 0)
+                                if (random.Next(50) == 0)
                                 {
                                     w.ForceMerge(1);
                                 }
                             }
                             w.Dispose();
                             w = null;
-                            DirectoryReader.Open(dir).Dispose();
+                            //DirectoryReader.Open(dir).Dispose();
+                            using (var reader = DirectoryReader.Open(dir)) { }

                             // Strangely, if we interrupt a thread before
                             // all classes are loaded, the class loader
@@ -1308,7 +1313,7 @@
                             // So, on first iteration through here we
                             // don't open ourselves up for interrupts
                             // until we've done the above loop.
-                            AllowInterrupt = true;
+                            allowInterrupt = true;
                         }
                     }
 #if !NETSTANDARD1_6
@@ -1327,7 +1332,7 @@
                         // the right exception type, so there is nothing to test here.
                         //Exception e = re.InnerException;
                         //Assert.IsTrue(e is ThreadInterruptedException);
-                        if (Finish)
+                        if (finish)
                         {
                             break;
                         }
@@ -1337,12 +1342,12 @@
                     {
                         Console.WriteLine("FAILED; unexpected exception");
                         Console.WriteLine(t.ToString());
-                        Failed = true;
+                        failed = true;
                         break;
                     }
                 }

-                if (!Failed)
+                if (!failed)
                 {
                     if (VERBOSE)
                     {
@@ -1357,9 +1362,6 @@
                             w.Rollback();
                         }
 #if !NETSTANDARD1_6
-                        // LUCENENET TODO: Is this the right decision here, or is IndexWriter
-                        // supposed to swallow ThreadInterruptedException?
-
                         // LUCENENET specific - there is a chance that our thread will be
                         // interrupted here, so we need to catch and ignore that exception
                         // when our MockDirectoryWrapper throws it.
@@ -1380,19 +1382,20 @@
                     }
                     catch (Exception e)
                     {
-                        Failed = true;
+                        failed = true;
                         Console.WriteLine("CheckIndex FAILED: unexpected exception");
                         Console.WriteLine(e.ToString());
                     }
                     try
                     {
-                        IndexReader r = DirectoryReader.Open(dir);
-                        //System.out.println("doc count=" + r.NumDocs);
-                        r.Dispose();
+                        using (IndexReader r = DirectoryReader.Open(dir))
+                        {
+                            //System.out.println("doc count=" + r.NumDocs);
+                        } // r.Dispose();
                     }
                     catch (Exception e)
                     {
-                        Failed = true;
+                        failed = true;
                         Console.WriteLine("DirectoryReader.open FAILED: unexpected exception");
                         Console.WriteLine(e.ToString());
                     }
@@ -1407,7 +1410,7 @@
                 }
                 try
                 {
-                    IOUtils.Dispose(Adder);
+                    IOUtils.Dispose(adder);
                 }
                 catch (IOException e)
                 {
@@ -1437,7 +1440,7 @@
                 // TODO: would be nice to also sometimes interrupt the
                 // CMS merge threads too ...
                 Thread.Sleep(10);
-                if (t.AllowInterrupt)
+                if (t.allowInterrupt)
                 {
                     i++;
                     t.Interrupt();
@@ -1447,10 +1450,10 @@
                     break;
                 }
             }
-            t.Finish = true;
+            t.finish = true;
             t.Join();

-            Assert.IsFalse(t.Failed);
+            Assert.IsFalse(t.failed);
         }

         /// <summary>
@@ -1482,7 +1485,7 @@
                 // CMS merge threads too ...
                 Thread.Sleep(10);
                 IndexerThreadInterrupt t = Random.NextBoolean() ? t1 : t2;
-                if (t.AllowInterrupt)
+                if (t.allowInterrupt)
                 {
                     i++;
                     t.Interrupt();
@@ -1492,13 +1495,13 @@
                     break;
                 }
             }
-            t1.Finish = true;
-            t2.Finish = true;
+            t1.finish = true;
+            t2.finish = true;
             t1.Join();
             t2.Join();

-            Assert.IsFalse(t1.Failed);
-            Assert.IsFalse(t2.Failed);
+            Assert.IsFalse(t1.failed);
+            Assert.IsFalse(t2.failed);
         }

         [Test]


Updated UniqueIndex tests to have not computed index check

--- src/Marten.Testing/Schema/UniqueIndexTests.cs
+++ src/Marten.Testing/Schema/UniqueIndexTests.cs
@@ -23,7 +23,7 @@

             public string UserName { get; set; }

-            [UniqueIndex()]
+            [UniqueIndex(IsComputed = false)]
             public string Email { get; set; }

             [UniqueIndex(IndexName = "fullname")]


Test to ensure we can remove a node from a service grid now passes.

--- src/MassTransit.Tests/Grid/Balancing_Specs.cs
+++ src/MassTransit.Tests/Grid/Balancing_Specs.cs
@@ -10,20 +10,18 @@
 // 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.Linq;
-using MassTransit.Grid;
-using MassTransit.Grid.Messages;
-using MassTransit.Grid.Sagas;
-
 namespace MassTransit.Tests.Grid
 {
     using System;
     using System.Collections.Generic;
     using System.Diagnostics;
+    using System.Linq;
     using System.Threading;
     using Magnum;
     using Magnum.DateTimeExtensions;
+    using MassTransit.Grid;
     using MassTransit.Grid.Configuration;
+    using MassTransit.Grid.Messages;
     using MassTransit.Transports;
     using NUnit.Framework;
     using Rhino.Mocks;
@@ -98,7 +96,7 @@
         {
             Thread.Sleep(250);

-            var nodeRepo = GridNodes[0].GridNodeRepository;
+            var nodeRepo = GridNodes[0].GridServiceNodeRepository;

             var message = new RemoveServiceNode()
             {
@@ -115,12 +113,10 @@
                     EndpointFactory.GetEndpoint(node.ControlUri).Send(message);
                 });

-            Thread.Sleep(1000);
+            Thread.Sleep(250);

-            Assert.AreEqual(ServiceNode.Completed,
-                GridNodes[1].GridNodeRepository.Where(node => node.ControlUri == GridNodes[0].ControlBus.Endpoint.Uri).First().CurrentState);
-            Assert.AreEqual(ServiceNode.Completed,
-                GridNodes[2].GridNodeRepository.Where(node => node.ControlUri == GridNodes[0].ControlBus.Endpoint.Uri).First().CurrentState);
+            Assert.AreEqual(2, GridNodes[1].GridServiceNodeRepository.Where(node => true).Count());
+            Assert.AreEqual(2, GridNodes[2].GridServiceNodeRepository.Where(node => true).Count());
         }
     }


Fix build

Fix build

--- src/MyParcelApi.Tests/DeliveryOptionsTests.cs
+++ src/MyParcelApi.Tests/DeliveryOptionsTests.cs
@@ -21,7 +21,7 @@
         [Test]
         public void GetDeliveryOptionsForPostalCodeAndNumberAndCarrier()
         {
-            var response = _client.GetDeliveryOptions("NL", "2132WT", "66", Carrier.PostNl);
+            var response = _client.GetDeliveryOptions("NL", "2132WT", "66", Platform.MyParcel, Carrier.PostNl);
             response.Wait();
             Assert.IsNotNull(response);
             Assert.IsNotNull(response.Result);
@@ -32,7 +32,7 @@
         [Test]
         public void GetDeliveryOptionsForPostalCodeAndNumberAndCarrierAndCutoffTimeAndDropoffDaysAndDropoffDelayAndDeliverydaysWindowAndDeliveryType()
         {
-            var response = _client.GetDeliveryOptions("NL", "2132WT", "66", Carrier.PostNl, cutoffTime: new TimeSpan(16, 0, 0), dropoffDays: new [] { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday }, dropoffDelay: 0, deliverydaysWindow: 2, excludeDeliveryType: new[] { DeliveryType.Morning });
+            var response = _client.GetDeliveryOptions("NL", "2132WT", "66", Platform.MyParcel, Carrier.PostNl, cutoffTime: new TimeSpan(16, 0, 0), dropoffDays: new [] { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday }, dropoffDelay: 0, deliverydaysWindow: 2, excludeDeliveryType: new[] { DeliveryType.Morning });
             response.Wait();
             Assert.IsNotNull(response);
             Assert.IsNotNull(response.Result);


NH-3413 - add more explanation to the fix

--- src/NHibernate/Engine/Query/QueryPlanCache.cs
+++ src/NHibernate/Engine/Query/QueryPlanCache.cs
@@ -101,6 +101,9 @@
 				{
 					//NH-3413
 					//Here we have to use original expression.
+					//In most cases NH do not translate expression in second time, but
+					// for cases when we have list parameters in query, like @p1.Contains(...),
+					// it does, and then it uses parameters from first try.
 					//TODO: cache only required parts of QueryExpression
 					planExpression._expression = expression._expression;
 					planExpression._constantToParameterMap = expression._constantToParameterMap;


Refactored DefaultEntityAliases to avoid unnecessary calculations (#1482)

--- src/NHibernate/Loader/DefaultEntityAliases.cs
+++ src/NHibernate/Loader/DefaultEntityAliases.cs
@@ -1,6 +1,5 @@
 using System.Collections.Generic;
 using NHibernate.Persister.Entity;
-using NHibernate.Util;

 namespace NHibernate.Loader
 {
@@ -10,48 +9,75 @@
 	/// </summary>
 	public class DefaultEntityAliases : IEntityAliases
 	{
-		private readonly string[] suffixedKeyColumns;
-		private readonly string[] suffixedVersionColumn;
-		private readonly string[][] suffixedPropertyColumns;
-		private readonly string suffixedDiscriminatorColumn;
-		private readonly string suffix;
-		private readonly string rowIdAlias;
-		private readonly IDictionary<string, string[]> userProvidedAliases;
+		private readonly string _suffix;
+		private readonly IDictionary<string, string[]> _userProvidedAliases;
+		private string _rowIdAlias;

 		public DefaultEntityAliases(ILoadable persister, string suffix)
-			: this(CollectionHelper.EmptyDictionary<string, string[]>(), persister, suffix) {}
+			: this(null, persister, suffix)
+		{
+		}

 		/// <summary>
-		/// Calculate and cache select-clause suffixes.
+		/// Calculate and cache select-clause aliases.
 		/// </summary>
 		public DefaultEntityAliases(IDictionary<string, string[]> userProvidedAliases, ILoadable persister, string suffix)
 		{
-			this.suffix = suffix;
-			this.userProvidedAliases = userProvidedAliases;
+			_suffix = suffix;
+			_userProvidedAliases = userProvidedAliases?.Count > 0 ? userProvidedAliases : null;

-			string[] keyColumnsCandidates = GetUserProvidedAliases(persister.IdentifierPropertyName, null);
-			if (keyColumnsCandidates == null)
+			SuffixedKeyAliases = DetermineKeyAliases(persister);
+			SuffixedPropertyAliases = DeterminePropertyAliases(persister);
+			SuffixedDiscriminatorAlias = DetermineDiscriminatorAlias(persister);
+
+			SuffixedVersionAliases = persister.IsVersioned ? SuffixedPropertyAliases[persister.VersionProperty] : null;
+			//rowIdAlias is generated on demand in property
+		}
+
+		/// <summary>
+		/// Returns aliases for subclass persister
+		/// </summary>
+		public string[][] GetSuffixedPropertyAliases(ILoadable persister)
+		{
+			if (_userProvidedAliases == null)
+				return GetAllPropertyAliases(persister);
+
+			var propertyNames = persister.PropertyNames;
+			var suffixedPropertyAliases = new string[propertyNames.Length][];
+			for (var i = 0; i < propertyNames.Length; i++)
 			{
-				suffixedKeyColumns = GetUserProvidedAliases(EntityPersister.EntityID, GetIdentifierAliases(persister, suffix));
+				suffixedPropertyAliases[i] =
+					SafeGetUserProvidedAliases(propertyNames[i]) ??
+					GetPropertyAliases(persister, i);
 			}
-			else
+
+			return suffixedPropertyAliases;
+		}
+
+		public string[] SuffixedVersionAliases { get; }
+
+		public string[][] SuffixedPropertyAliases { get; }
+
+		public string SuffixedDiscriminatorAlias { get; }
+
+		public string[] SuffixedKeyAliases { get; }
+
+		// TODO: not visible to the user!
+		public string RowIdAlias => _rowIdAlias ?? (_rowIdAlias = Loadable.RowIdAlias + _suffix);
+
+		/// <summary>
+		/// Returns default aliases for all the properties
+		/// </summary>
+		private string[][] GetAllPropertyAliases(ILoadable persister)
+		{
+			var propertyNames = persister.PropertyNames;
+			var suffixedPropertyAliases = new string[propertyNames.Length][];
+			for (var i = 0; i < propertyNames.Length; i++)
 			{
-				suffixedKeyColumns = keyColumnsCandidates;
+				suffixedPropertyAliases[i] = GetPropertyAliases(persister, i);
 			}
-			Intern(suffixedKeyColumns);

-			suffixedPropertyColumns = GetSuffixedPropertyAliases(persister);
-			suffixedDiscriminatorColumn =
-				GetUserProvidedAlias(AbstractEntityPersister.EntityClass, GetDiscriminatorAlias(persister, suffix));
-			if (persister.IsVersioned)
-			{
-				suffixedVersionColumn = suffixedPropertyColumns[persister.VersionProperty];
-			}
-			else
-			{
-				suffixedVersionColumn = null;
-			}
-			rowIdAlias = Loadable.RowIdAlias + suffix; // TODO: not visible to the user!
+			return suffixedPropertyAliases;
 		}

 		protected virtual string GetDiscriminatorAlias(ILoadable persister, string suffix)
@@ -66,85 +92,52 @@

 		protected virtual string[] GetPropertyAliases(ILoadable persister, int j)
 		{
-			return persister.GetPropertyAliases(suffix, j);
+			return persister.GetPropertyAliases(_suffix, j);
 		}

-		private string[] GetUserProvidedAliases(string propertyPath, string[] defaultAliases)
+		private string[] DetermineKeyAliases(ILoadable persister)
 		{
-			string[] result = propertyPath == null ? null : GetUserProvidedAlias(propertyPath);
-			if (result == null)
+			if (_userProvidedAliases != null)
 			{
-				return defaultAliases;
+				var result = SafeGetUserProvidedAliases(persister.IdentifierPropertyName) ??
+				             GetUserProvidedAliases(EntityPersister.EntityID);
+
+				if (result != null)
+					return result;
 			}
-			else
+
+			return GetIdentifierAliases(persister, _suffix);
+		}
+
+		private string[][] DeterminePropertyAliases(ILoadable persister)
+		{
+			return GetSuffixedPropertyAliases(persister);
+		}
+
+		private string DetermineDiscriminatorAlias(ILoadable persister)
+		{
+			if (_userProvidedAliases != null)
 			{
-				return result;
+				var columns = GetUserProvidedAliases(AbstractEntityPersister.EntityClass);
+				if (columns != null)
+					return columns[0];
 			}
+
+			return GetDiscriminatorAlias(persister, _suffix);
+		}
+
+		private string[] SafeGetUserProvidedAliases(string propertyPath)
+		{
+			if (propertyPath == null)
+				return null;
+
+			return GetUserProvidedAliases(propertyPath);
 		}

-		private string[] GetUserProvidedAlias(string propertyPath)
+		private string[] GetUserProvidedAliases(string propertyPath)
 		{
-			string[] result;
-			userProvidedAliases.TryGetValue(propertyPath, out result);
+			_userProvidedAliases.TryGetValue(propertyPath, out var result);
 			return result;
-		}
-
-		private string GetUserProvidedAlias(string propertyPath, string defaultAlias)
-		{
-			string[] columns = propertyPath == null ? null : GetUserProvidedAlias(propertyPath);
-			if (columns == null)
-			{
-				return defaultAlias;
-			}
-			else
-			{
-				return columns[0];
-			}
-		}
-
-		public string[][] GetSuffixedPropertyAliases(ILoadable persister)
-		{
-			int size = persister.PropertyNames.Length;
-			string[][] suffixedPropertyAliases = new string[size][];
-			for (int j = 0; j < size; j++)
-			{
-				suffixedPropertyAliases[j] = GetUserProvidedAliases(persister.PropertyNames[j], GetPropertyAliases(persister, j));
-				Intern(suffixedPropertyAliases[j]);
-			}
-			return suffixedPropertyAliases;
-		}
-
-		public string[] SuffixedVersionAliases
-		{
-			get { return suffixedVersionColumn; }
-		}
-
-		public string[][] SuffixedPropertyAliases
-		{
-			get { return suffixedPropertyColumns; }
-		}
-
-		public string SuffixedDiscriminatorAlias
-		{
-			get { return suffixedDiscriminatorColumn; }
-		}
-
-		public string[] SuffixedKeyAliases
-		{
-			get { return suffixedKeyColumns; }
-		}
-
-		public string RowIdAlias
-		{
-			get { return rowIdAlias; }
-		}
-
-		private static void Intern(string[] strings)
-		{
-			for (int i = 0; i < strings.Length; i++)
-			{
-				strings[i] = StringHelper.InternedIfPossible(strings[i]);
-			}
 		}
 	}
 }


Set port 7400 and use default WebHost builder

--- src/Neo4jManager/Neo4jManager.Host/Program.cs
+++ src/Neo4jManager/Neo4jManager.Host/Program.cs
@@ -1,5 +1,7 @@
 using System.IO;
+using System.Net;
 using Autofac.Extensions.DependencyInjection;
+using Microsoft.AspNetCore;
 using Microsoft.AspNetCore.Hosting;

 namespace Neo4jManager.Host
@@ -8,8 +10,8 @@
     {
         public static void Main(string[] args)
         {
-            var host = new WebHostBuilder()
-                .UseKestrel()
+            var host = WebHost.CreateDefaultBuilder(args)
+                .UseKestrel(options => options.Listen(IPAddress.Loopback, 7400))
                 .ConfigureServices(services => services.AddAutofac())
                 .UseContentRoot(Directory.GetCurrentDirectory())
                 .UseStartup<Startup>()


Improve installer support

Improve installer support

--- src/NetSparkle.UI.Avalonia/SparkleAvalonia.cs
+++ src/NetSparkle.UI.Avalonia/SparkleAvalonia.cs
@@ -192,6 +192,7 @@
                 }
                 else
                 {
+                    // We should wait until the host process has died before starting the installer.
                     var waitForFinish = $@"
                         COUNTER=0;
                         while ps -p {processID} > /dev/null;
@@ -223,6 +224,12 @@
                     }
                     else
                     {
+                        string installerExt = Path.GetExtension(downloadFilePath);
+                        if (DoExtensionsMatch(installerExt, ".pkg") ||
+                            DoExtensionsMatch(installerExt, ".dmg"))
+                        {
+                            relaunchAfterUpdate = ""; // relaunching not supported for pkg or dmg downloads
+                        }
                         var output = $@"
                             {waitForFinish}
                             {installerCmd}
@@ -240,12 +247,12 @@
             _installerProcess = new Process
             {
                 StartInfo =
-                        {
-                            FileName = batchFilePath,
-                            WindowStyle = ProcessWindowStyle.Hidden,
-                            UseShellExecute = false,
-                            CreateNoWindow = true
-                        }
+                {
+                    FileName = batchFilePath,
+                    WindowStyle = ProcessWindowStyle.Hidden,
+                    UseShellExecute = false,
+                    CreateNoWindow = true
+                }
             };
             // start the installer process. the batch file will wait for the host app to close before starting.
             _installerProcess.Start();


Add search link. Closes #37

Add search link. Closes #37

--- src/Pablo.Gallery/Views/Shared/_Layout.cshtml
+++ src/Pablo.Gallery/Views/Shared/_Layout.cshtml
@@ -32,6 +32,7 @@

@Html.ActionLink("Packs", "Index", "Year")

+
@Html.ActionLink("Search", "Index", "File")

 					@if (User.IsInRole("admin")) {

@Html.ActionLink("Scanner", "Index", "Scanner")

 					}


mod to exception processing - if an exception is an arg, use that exception and pass the message as custom data , otherwise wrap the trace message as the exception

--- src/Raygun.Diagnostics/RaygunTraceListener.cs
+++ src/Raygun.Diagnostics/RaygunTraceListener.cs
@@ -266,8 +266,15 @@
           var error = localArgs.FirstOrDefault(a => a is Exception);
           if (error != null)
           {
-            context.Exception = new Exception(message, (Exception) error);
+            // use the arg exception for raygun and pass the message as custom data
+            context.Exception = (Exception) error;
+            context.Data.Add("Message", message);
             localArgs.Remove(error);
+          }
+          else
+          {
+            // wrap the trace message as the exception
+            context.Exception = new Exception(message);
           }

           // add the rest


Причесал немного генерацию текста

Причесал немного генерацию текста

--- src/ScriptEngine/Machine/RuntimeExceptions.cs
+++ src/ScriptEngine/Machine/RuntimeExceptions.cs
@@ -76,12 +76,12 @@

         public static RuntimeException MethodNotFoundException(string methodName)
         {
-            return new RuntimeException(string.Format("Метод объекта не обнаружен ({0})", methodName));
+            return new RuntimeException($"Метод объекта не обнаружен ({methodName})");
         }

         public static RuntimeException MethodNotFoundException(string methodName, string objectName)
         {
-            return new RuntimeException(string.Format("Метод объекта не обнаружен ({{{1}}}::{0})", methodName, objectName));
+            return new RuntimeException($"Метод объекта не обнаружен ({{{objectName}}}::{methodName})");
         }

         public static RuntimeException ValueIsNotObjectException()


A bit of testing

A bit of testing

--- src/Skybrud.BorgerDk.TestSite/Default.aspx.cs
+++ src/Skybrud.BorgerDk.TestSite/Default.aspx.cs
@@ -8,7 +8,9 @@

             BorgerDkService service = new BorgerDkService(BorgerDkEndpoint.Default, BorgerDkMunicipality.SlagelseKommune);

-            var art = service.GetArticleFromId(556);
+            var id = service.GetArticleIdFromUrl("https://www.borger.dk/Sider/Drikkevand-og-vandforbrug.aspx");
+
+            var art = service.GetArticleFromId(id);

             Response.ContentType = "text/xml";
             Response.Write(art.ToXElement(BorgerDkMunicipality.SlagelseKommune.Code, 1400));


Add a more thorough test of whether the registery is readable/writable

Fixes #336

--- src/SyncTrayzor/Services/AutostartProvider.cs
+++ src/SyncTrayzor/Services/AutostartProvider.cs
@@ -65,7 +65,14 @@
         {
             try
             {
-                this.OpenRegistryKey(true).Dispose();
+                // Apparently just opening the key is not enough - there's an ACL where it will still crash when trying to write
+                // to it
+                using (var key = this.OpenRegistryKey(true))
+                {
+                    var value = key.GetValue(this.keyName);
+                    key.SetValue(this.keyName, value);
+                }
+
                 this._canWrite = true;
                 this._canRead = true;
                 logger.Info("Have read/write access to the registry");
@@ -75,7 +82,11 @@

             try
             {
-                this.OpenRegistryKey(false).Dispose();
+                using (var key = this.OpenRegistryKey(false))
+                {
+                    var value = key.GetValue(this.keyName);
+                }
+
                 this._canRead = true;
                 logger.Info("Have read-only access to the registry");
                 return;


Update uri correctly in BypassOnLocal_MemberData (#21540)

--- src/System.Net.WebProxy/tests/WebProxyTest.cs
+++ src/System.Net.WebProxy/tests/WebProxyTest.cs
@@ -160,7 +160,7 @@
             if (!string.IsNullOrWhiteSpace(domain))
             {
                 Uri uri = null;
-                try { new Uri($"http://{Guid.NewGuid().ToString("N")}.{domain}"); }
+                try { uri = new Uri($"http://{Guid.NewGuid().ToString("N")}.{domain}"); }
                 catch (UriFormatException) { }

                 if (uri != null)


Make Base AnchestorOrSelf function public

By making this function public, developers can use it to iterate over the tree on different property / function than the ones which are created. It makes umbraco easier to extend. Now we have to copy existing code in order to do this.

--- src/Umbraco.Web/PublishedContentExtensions.cs
+++ src/Umbraco.Web/PublishedContentExtensions.cs
@@ -502,10 +502,10 @@
             where T : class, IPublishedContent
         {
             return new PublishedContentOrderedSet<T>(source);
-        }
-
-        #endregion
-
+        }
+
+        #endregion
+
         #region Dynamic Linq Extensions

         [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead")]
@@ -517,7 +517,7 @@
 		}

         [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead")]
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public static IQueryable<IPublishedContent> Where(this IEnumerable<IPublishedContent> list, string predicate)
 		{
             // wrap in DynamicPublishedContentList so that the ContentSet is correct
@@ -530,7 +530,7 @@
 		}

         [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead")]
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public static IEnumerable<IGrouping<object, IPublishedContent>> GroupBy(this IEnumerable<IPublishedContent> list, string predicate)
 		{
 			var dList = new DynamicPublishedContentList(list);
@@ -538,7 +538,7 @@
 		}

         [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead")]
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public static IQueryable Select(this IEnumerable<IPublishedContent> list, string predicate, params object[] values)
 		{
 			var dList = new DynamicPublishedContentList(list);
@@ -560,8 +560,8 @@
             if (content == null) throw new ArgumentNullException("content");
             return new HtmlString(content.Where(predicate) ? valueIfTrue : valueIfFalse);
         }
-
-        [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead: Where(x => x.IsVisible())")]
+
+        [Obsolete("This method uses dynamics which will be removed in future versions, use strongly typed syntax instead: Where(x => x.IsVisible())")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static bool Where(this IPublishedContent content, string predicate)
         {
@@ -1199,7 +1199,7 @@
             return content.AncestorsOrSelf<T>(maxLevel).FirstOrDefault();
         }

-        internal static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, bool orSelf, Func<IPublishedContent, bool> func)
+        public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, bool orSelf, Func<IPublishedContent, bool> func)
         {
             var ancestorsOrSelf = content.EnumerateAncestors(orSelf);
             return func == null ? ancestorsOrSelf : ancestorsOrSelf.Where(func);


Update ProfilerHelper

Update ProfilerHelper

--- src/WeihanLi.Common/Helpers/ProfilerHelper.cs
+++ src/WeihanLi.Common/Helpers/ProfilerHelper.cs
@@ -60,7 +60,12 @@
     /// <param name="startTimestamp">startTimestamp, get by Stopwatch.GetTimestamp()</param>
     /// <returns>elapsed timespan</returns>
     public static TimeSpan GetElapsedTime(long startTimestamp) =>
-        GetElapsedTime(startTimestamp, Stopwatch.GetTimestamp());
+#if NET7_0_OR_GREATER
+        Stopwatch.GetElapsedTime(startTimestamp)
+#else
+        GetElapsedTime(startTimestamp, Stopwatch.GetTimestamp())
+#endif
+        ;

     /// <summary>
     /// GetElapsedTime
@@ -70,7 +75,11 @@
     /// <returns>elapsed timespan</returns>
     public static TimeSpan GetElapsedTime(long startTimestamp, long endTimestamp)
     {
+#if NET7_0_OR_GREATER
+        return Stopwatch.GetElapsedTime(startTimestamp, endTimestamp);
+#else
         var ticks = (long)((endTimestamp - startTimestamp) * TicksPerTimestamp);
         return new TimeSpan(ticks);
+#endif
     }
 }


CommandLineTest: Use correct path to 'cat' on !Windows

Environment.SpecialFolder.System resolves to "" on Mono, so, instead
hardcode the path to "/bin/cat" on !Windows

--- src/XMakeCommandLine/UnitTests/XMake_Tests.cs
+++ src/XMakeCommandLine/UnitTests/XMake_Tests.cs
@@ -796,9 +796,13 @@
         }

 #if FEATURE_SPECIAL_FOLDERS
-        private string _pathToArbitraryBogusFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe"); // OK on 64 bit as well
+        private string _pathToArbitraryBogusFile = NativeMethodsShared.IsWindows // OK on 64 bit as well
+                                                        ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe")
+                                                        : "/bin/cat";
 #else
-        private string _pathToArbitraryBogusFile = Path.Combine(FileUtilities.GetFolderPath(FileUtilities.SpecialFolder.System), NativeMethodsShared.IsWindows ? "notepad.exe" : "cat"); // OK on 64 bit as well
+        private string _pathToArbitraryBogusFile = NativeMethodsShared.IsWindows // OK on 64 bit as well
+                                                        ? Path.Combine(FileUtilities.GetFolderPath(FileUtilities.SpecialFolder.System), "notepad.exe")
+                                                        : "/bin/cat";
 #endif

         /// <summary>


Matrix.Equals

Matrix.Equals

--- Source/Eto/Drawing/Matrix.cs
+++ Source/Eto/Drawing/Matrix.cs
@@ -169,6 +169,32 @@
                     e[4],
                     e[5])
                 : "empty matrix";
+        }
+
+        public override bool Equals(object obj)
+        {
+            var m = obj as Matrix;
+
+            var result = false;
+
+            if (obj != null)
+            {
+                var e1 = this.Elements;
+                var e2 = m.Elements;
+                result =
+                    e1 != null &&
+                    e2 != null &&
+                    e1.Length == 6 &&
+                    e2.Length == 6 &&
+                    e1[0] == e2[0] &&
+                    e1[1] == e2[1] &&
+                    e1[2] == e2[2] &&
+                    e1[3] == e2[3] &&
+                    e1[4] == e2[4] &&
+                    e1[5] == e2[5];
+            }
+
+            return result;
         }
     }


Allow to ask with command for strongly-typed actors

- Useful in scenarios where sender is interested in command execution result (ie, Done or Unhandled)

--- Source/Orleankka/ActorRef.cs
+++ Source/Orleankka/ActorRef.cs
@@ -125,6 +125,7 @@

         public virtual Task Tell(ActorMessage<TActor> message) => @ref.Tell(message);
         public virtual Task<TResult> Ask<TResult>(ActorMessage<TActor, TResult> message) => @ref.Ask<TResult>(message);
+        public virtual Task<TResult> Ask<TResult>(ActorMessage<TActor> message) => @ref.Ask<TResult>(message);
         public override void Notify(ActorMessage<TActor> message) => @ref.Notify(message);

         public ActorPath Path => @ref.Path;


Fixing the framework random generator seed so it is properly reset when a new seed is given (at least for the current thread).

--- Sources/Accord.Math/Tools.cs
+++ Sources/Accord.Math/Tools.cs
@@ -50,21 +50,24 @@
         ///   Gets a reference to the random number generator used
         ///   internally by the Accord.NET classes and methods.
         /// </summary>
+        ///
         public static Random Random { get { return random.Value; } }

         /// <summary>
         ///   Sets a random seed for the internal number generator.
         /// </summary>
+        ///
         public static void SetupGenerator(int? seed)
         {
-            // TODO: Enable for .NET 4.5
-            // lock (random)
-            // {
-            //     foreach (var r in random.Values)
-            //         r.Value = new Random(seed);
-            //  }
-
+#if NET45
+            lock (random)
+            {
+                foreach (var r in random.Values)
+                    r.Value = new Random(seed);
+            }
+#endif
             Tools.seed = seed;
+            Tools.random.Value = create();
         }
         #endregion


when the HttpListener throws on start retry 3 times waiting 1 and 2 seconds after each retry.

--- Src/Metrics/MetricsConfig.cs
+++ Src/Metrics/MetricsConfig.cs
@@ -1,6 +1,7 @@

 using System;
 using System.Configuration;
+using System.Threading;
 using Metrics.Logging;
 using Metrics.Reports;
 using Metrics.Visualization;
@@ -49,16 +50,40 @@
         {
             if (!isDisabled)
             {
-                try
-                {
-                    using (this.listener) { }
-                    this.listener = new MetricsHttpListener(httpUriPrefix, this.context.DataProvider, this.healthStatus);
-                    this.listener.Start();
-                }
-                catch (Exception x)
-                {
-                    MetricsErrorHandler.Handle(x, "Unable to start HTTP Listener");
-                }
+                const int MaxRetries = 3;
+                var retries = MaxRetries;
+
+                do
+                {
+                    try
+                    {
+                        using (this.listener)
+                        {
+                        }
+                        this.listener = new MetricsHttpListener(httpUriPrefix, this.context.DataProvider, this.healthStatus);
+                        this.listener.Start();
+                        if (retries != MaxRetries)
+                        {
+                            log.InfoFormat("HttpListener started successfully after {0} retries", MaxRetries - retries);
+                        }
+                        retries = 0;
+                    }
+                    catch (Exception x)
+                    {
+                        retries--;
+                        if (retries > 0)
+                        {
+                            log.WarnException("Unable to start HTTP Listener. Sleeping for {0} sec and retrying {1} more times", x, MaxRetries - retries, retries);
+                            Thread.Sleep(1000 * (MaxRetries - retries));
+                        }
+                        else
+                        {
+                            MetricsErrorHandler.Handle(x,
+                                string.Format("Unable to start HTTP Listener. Retried {0} times, giving up...", MaxRetries));
+                        }
+
+                    }
+                } while (retries > 0);
             }
             return this;
         }


locking improved

locking improved

--- StateMachine/StateMachine.cs
+++ StateMachine/StateMachine.cs
@@ -25,6 +25,7 @@
         protected HashSet<String> Conditions = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
         protected HashSet<String> States = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
         protected Dictionary<StateTransition, String> Transitions = new Dictionary<StateTransition, String>();
+        protected Object Lock;

         public String CurrentState { get; protected set; }
         public String PreviousState { get; protected set; }
@@ -135,8 +136,7 @@
         {
             var fReturn = false;
             var jss = new System.Web.Script.Serialization.JavaScriptSerializer();
-            // DFTODO other locks needed?
-            lock (Transitions)
+            lock (Lock)
             {
                 Dictionary<String, String> dic = jss.Deserialize<Dictionary<String, String>>(configuration);
                 Transitions.Clear();
@@ -176,8 +176,7 @@

         protected StateMachine AddCondition(String name)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 var fReturn = Conditions.Contains(name, StringComparer.OrdinalIgnoreCase);
                 if (fReturn)
@@ -191,8 +190,7 @@

         protected StateMachine AddConditions(IEnumerable<String> names, bool ignoreExisting = false)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 var fReturn = Conditions.Overlaps(names);
                 if (fReturn && !ignoreExisting)
@@ -209,8 +207,7 @@

         protected StateMachine AddState(String name)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 var fReturn = States.Contains(name);
                 if (fReturn)
@@ -224,8 +221,7 @@

         protected StateMachine AddStates(IEnumerable<String> names, bool ignoreExisting = false)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 var fReturn = States.Overlaps(names);
                 if (fReturn && !ignoreExisting)
@@ -243,8 +239,7 @@
         // DFTODO refactor -> make it more clear
         protected StateMachine SetStateTransition(String sourceState, String condition, String targetState, bool fReplace = false)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 if (!States.Contains(sourceState))
                 {
@@ -280,8 +275,7 @@
         // DFTODO refactor -> make it more clear
         protected StateMachine InsertStateTransition(String sourceState, String condition, String targetStateNew, bool fCreateTargetState = false)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 if (!States.Contains(sourceState))
                 {
@@ -319,8 +313,7 @@
         {
             StateTransition transition = new StateTransition(CurrentState, condition);
             String _nextState;
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 if (!Transitions.TryGetValue(transition, out _nextState))
                 {
@@ -338,8 +331,7 @@
         // DFTODO Rename method to ChangeState?
         public String MoveNext(String condition)
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 // DFTCHECK Rename GetNext method to a more meaningful name
                 String _nextState = GetNext(condition);
@@ -351,8 +343,7 @@

         protected virtual void Clear()
         {
-            // DFTODO Check lock (is it necessary and correct)?
-            lock (Transitions)
+            lock (Lock)
             {
                 Transitions.Clear();
                 States.Clear();
@@ -365,7 +356,7 @@
         public virtual String GetStateMachine()
         {
             var jss = new System.Web.Script.Serialization.JavaScriptSerializer();
-            lock (Transitions)
+            lock (Lock)
             {
                 var dic = Transitions.ToDictionary(k => k.Key.ToString(), v => v.Value);
                 var stateMachineSerialised = jss.Serialize(dic);


Revert "Save configuration after modification"

--- TGS.Server/InstanceConfig.cs
+++ TGS.Server/InstanceConfig.cs
@@ -147,164 +147,64 @@
 		public ulong Version { get; protected set; } = CurrentVersion;

 		/// <inheritdoc />
-		public string Name
-        {
-            get { return _name; }
-            set { _name = value; Save(); }
-        }
-        private string _name = "TG Station Server";
-
-		/// <inheritdoc />
-		public bool Enabled
-        {
-            get { return _enabled; }
-            set { _enabled = value; Save(); }
-        }
-        private bool _enabled = true;
-
-		/// <inheritdoc />
-		public string ProjectName
-        {
-            get { return _projectname; }
-            set { _projectname = value; Save(); }
-        }
-        private string _projectname = "tgstation";
-
-		/// <inheritdoc />
-		public ushort Port
-        {
-            get { return _port; }
-            set { _port = value; Save(); }
-        }
-        private ushort _port = 1337;
-
-		/// <inheritdoc />
-		public DreamDaemonSecurity Security
-        {
-            get { return _security; }
-            set { _security = value; Save(); }
-        }
-        private DreamDaemonSecurity _security = DreamDaemonSecurity.Trusted;
-
-		/// <inheritdoc />
-		public bool Autostart
-        {
-            get { return _autostart; }
-            set { _autostart = value; Save(); }
-        }
-        private bool _autostart = false;
-
-		/// <inheritdoc />
-		public bool Webclient
-        {
-            get { return _webclient; }
-            set { _webclient = value; Save(); }
-        }
-        private bool _webclient = false;
-
-		/// <inheritdoc />
-		public string CommitterName
-        {
-            get { return _committername; }
-            set { _committername = value; Save(); }
-        }
-        private string _committername = "tgstation-server";
-
-		/// <inheritdoc />
-		public string CommitterEmail
-        {
-            get { return _committeremail; }
-            set { _committeremail = value; Save(); }
-        }
-        private string _committeremail = "tgstation-server@tgstation13.org";
-
-		/// <inheritdoc />
-		public string ChatProviderData
-        {
-            get { return _chatproviderdata; }
-            set { _chatproviderdata = value; Save(); }
-        }
-        private string _chatproviderdata = Instance.UninitializedString;
-
-		/// <inheritdoc />
-		public string ChatProviderEntropy
-        {
-            get { return _chatproviderentropy; }
-            set { _chatproviderentropy = value; Save(); }
-        }
-        private string _chatproviderentropy;
-
-        /// <inheritdoc />
-        public bool ReattachRequired
-        {
-            get { return _reattachrequired; }
-            set { _reattachrequired = value; Save(); }
-        }
-        private bool _reattachrequired = false;
-
-		/// <inheritdoc />
-		public int ReattachProcessID
-        {
-            get { return _reattachprocessid; }
-            set { _reattachprocessid = value; Save(); }
-        }
-        private int _reattachprocessid;
-
-        /// <inheritdoc />
-        public ushort ReattachPort
-        {
-            get { return _reattachport; }
-            set { _reattachport = value; Save(); }
-        }
-        private ushort _reattachport;
-
-        /// <inheritdoc />
-        public string ReattachCommsKey
-        {
-            get { return _reattachcommskey; }
-            set { _reattachcommskey = value; Save(); }
-        }
-        private string _reattachcommskey;
-
-        /// <inheritdoc />
-        public string ReattachAPIVersion
-        {
-            get { return _reattachapiversion; }
-            set { _reattachapiversion = value; Save(); }
-        }
-        private string _reattachapiversion;
-
-        /// <inheritdoc />
-        public string AuthorizedUserGroupSID
-        {
-            get { return _authorizedusergroupsid; }
-            set { _authorizedusergroupsid = value; Save(); }
-        }
-        private string _authorizedusergroupsid = null;
-
-		/// <inheritdoc />
-		public ulong AutoUpdateInterval
-        {
-            get { return _autoupdateinterval; }
-            set { _autoupdateinterval = value; Save(); }
-        }
-        private ulong _autoupdateinterval = 0;
-
-		/// <inheritdoc />
-		public bool PushTestmergeCommits
-        {
-            get { return _pushtestmergecommits; }
-            set { _pushtestmergecommits = value; Save(); }
-        }
-        private bool _pushtestmergecommits = false;
-
-		/// <inheritdoc />
-		public int ServerStartupTimeout
-        {
-            get { return _serverstartuptimeout; }
-            set { _serverstartuptimeout = value; Save(); }
-        }
-        private int _serverstartuptimeout = 60;
+		public string Name { get; set; } = "TG Station Server";
+
+		/// <inheritdoc />
+		public bool Enabled { get; set; } = true;
+
+		/// <inheritdoc />
+		public string ProjectName { get; set; } = "tgstation";
+
+		/// <inheritdoc />
+		public ushort Port { get; set; } = 1337;
+
+		/// <inheritdoc />
+		public DreamDaemonSecurity Security { get; set; } = DreamDaemonSecurity.Trusted;
+
+		/// <inheritdoc />
+		public bool Autostart { get; set; } = false;
+
+		/// <inheritdoc />
+		public bool Webclient { get; set; } = false;
+
+		/// <inheritdoc />
+		public string CommitterName { get; set; } = "tgstation-server";
+
+		/// <inheritdoc />
+		public string CommitterEmail { get; set; } = "tgstation-server@tgstation13.org";
+
+		/// <inheritdoc />
+		public string ChatProviderData { get; set; } = Instance.UninitializedString;
+
+		/// <inheritdoc />
+		public string ChatProviderEntropy { get; set; }
+
+		/// <inheritdoc />
+		public bool ReattachRequired { get; set; } = false;
+
+		/// <inheritdoc />
+		public int ReattachProcessID { get; set; }
+
+		/// <inheritdoc />
+		public ushort ReattachPort { get; set; }
+
+		/// <inheritdoc />
+		public string ReattachCommsKey { get; set; }
+
+		/// <inheritdoc />
+		public string ReattachAPIVersion { get; set; }
+
+		/// <inheritdoc />
+		public string AuthorizedUserGroupSID { get; set; } = null;
+
+		/// <inheritdoc />
+		public ulong AutoUpdateInterval { get; set; } = 0;
+
+		/// <inheritdoc />
+		public bool PushTestmergeCommits { get; set; } = false;
+
+		/// <inheritdoc />
+		public int ServerStartupTimeout { get; set; } = 60;

 		/// <summary>
 		/// Construct a <see cref="InstanceConfig"/> for a <see cref="Instance"/> at <paramref name="path"/>


C#: Add params modifier on override

C#: Add params modifier on override

--- csharp/extractor/Semmle.Util/LoggerUtils.cs
+++ csharp/extractor/Semmle.Util/LoggerUtils.cs
@@ -29,9 +29,9 @@
             }
         }

-        public override void WriteLine(string? value, object?[] args)
+        public override void WriteLine(string? format, params object?[] args)
         {
-            WriteLine(value is null ? value : String.Format(value, args));
+            WriteLine(format is null ? format : String.Format(format, args));
         }

         private readonly object mutex = new object();


Fix snippet name

Fix snippet name

--- TempoIQ.Snippets/Snippets.cs
+++ TempoIQ.Snippets/Snippets.cs
@@ -114,7 +114,7 @@
         [Test]
         public void TestGetDevices()
         {
-            // snippet-begin get-device
+            // snippet-begin get-devices
             // using System;
             // using TempoIQ;
             // using TempoIQ.Models;


Remove thing

Remove thing

--- TimeHACK.Main/TitleScreen.cs
+++ TimeHACK.Main/TitleScreen.cs
@@ -124,11 +124,6 @@
                 }

             }
-        }
-
-        public void UpdateGameVersionText()
-        {
-            gameversion.Text = Program.gameID;
         }

         void TitleBarDrag(object sender, MouseEventArgs e)


Improve ParseCsv()

Improve ParseCsv()

--- Transcoder/TranscoderFile.cs
+++ Transcoder/TranscoderFile.cs
@@ -190,13 +190,9 @@
 					var endIdx = values.FindIndex(countToHere, v => v.EndsWith("\""));
 					if (endIdx >= 0)
                     {
-						returnValues.Add(value.TrimStart('\"'));
-						var returnValueIdx = returnValues.Count - 1;
-						while (++i < endIdx)
-						{
-							returnValues[returnValueIdx] = String.Join(",", returnValues[returnValueIdx], values[i]);
-						}
-						returnValues[returnValueIdx] = String.Join(",", returnValues[returnValueIdx], values[i].TrimEnd('\"'));
+						var subValues = values.GetRange(i, endIdx - i + 1);
+						returnValues.Add(String.Join(",", subValues).Trim('\"'));
+						i = endIdx;
                     }
 					else
                     {


added test for overlapping reverse im2col

--- UnitTests/CudaTensorTests.cs
+++ UnitTests/CudaTensorTests.cs
@@ -325,21 +325,9 @@
 				matrixList.Add(output.Column(i).ReshapeAsMatrix(newWidth, newHeight));
 			var outputTensor = _cpu.Create3DTensor(matrixList);

-			//var cpuFilterList = new List<IReadOnlyList<IVector>>();
-			//for (var i = 0; i < cpuFilter.ColumnCount; i++)
-			//	cpuFilterList.Add(cpuFilter.Column(i).Split(depth).Select(v => v.Rotate()).ToList());
-
 			using (var gpuTensor = _cuda.Create3DTensor(outputTensor.Data)) {
 				FloatingPointHelper.AssertEqual(gpuTensor.AsIndexable(), outputTensor.AsIndexable());
 				var gpuFilter = _cuda.CreateMatrix(cpuFilter.Data);
-				//var gpuFilterList = cpuFilterList.Select(fl => fl.Select(f => _cuda.CreateVector(f.AsIndexable())).ToList()).ToList();
-
-				//for (var i = 0; i < cpuFilterList.Count; i++) {
-				//	var cpuFilters = cpuFilterList[i];
-				//	var gpuFilters = gpuFilterList[i];
-				//	for(var j = 0; j < cpuFilters.Count; j++)
-				//		FloatingPointHelper.AssertEqual(gpuFilters[j].AsIndexable(), cpuFilters[j].AsIndexable());
-				//}

 				var cpuReverseIm2Col = outputTensor.ReverseIm2Col(cpuFilter, inputHeight, inputWidth, depth, filterWidth, filterHeight, stride);
 				using (var gpuReverseIm2Col = gpuTensor.ReverseIm2Col(gpuFilter, inputHeight, inputWidth, depth, filterWidth, filterHeight, stride)) {
@@ -370,6 +358,12 @@
 		public void TensorReverseIm2Col4()
 		{
 			_TensorReverseIm2Col(2, 2, 2, 2, 2, 4, 4);
+		}
+
+		[TestMethod]
+		public void TensorReverseIm2Col5()
+		{
+			_TensorReverseIm2Col(2, 2, 1, 2, 2, 4, 4);
 		}

 		FloatMatrix _CreateMatrix(int depth, int rows, int columns, Func<int, int, int, float> valueProvider)
@@ -723,28 +717,8 @@
 			var cpuTensor = _cpu.Create4DTensor(data);
 			var cpuFilter = _cpu.CreateMatrix(depth * filterWidth * filterHeight, filterCount, (i, j) => (float)normalDistribution.Sample());

-			//var cpuFilterList = new List<IReadOnlyList<IVector>>();
-			//for (var i = 0; i < cpuFilter.ColumnCount; i++)
-			//	cpuFilterList.Add(cpuFilter.Column(i).Split(depth).Select(v => v.Rotate(v.Count / filterWidth)).ToList());
-
 			using (var gpuTensor = _cuda.Create4DTensor(data))
 			using (var gpuFilter = _cuda.CreateMatrix(cpuFilter.AsIndexable())) {
-				//var gpuFilterList = new List<IReadOnlyList<IVector>>();
-				//for (var i = 0; i < gpuFilter.ColumnCount; i++) {
-				//	using (var column = gpuFilter.Column(i)) {
-				//		var vectors = column.Split(depth);
-				//		var vectorList = vectors.Select(v => v.Rotate(v.Count / filterWidth)).ToList();
-				//		gpuFilterList.Add(vectorList);
-				//		foreach (var item in vectors)
-				//			item.Dispose();
-				//	}
-				//}
-
-				//for (var i = 0; i < gpuFilter.ColumnCount; i++) {
-				//	for (var j = 0; j < cpuFilterList[i].Count; j++) {
-				//		FloatingPointHelper.AssertEqual(cpuFilterList[i][j].AsIndexable(), gpuFilterList[i][j].AsIndexable());
-				//	}
-				//}
 				FloatingPointHelper.AssertEqual(cpuTensor.AsIndexable(), gpuTensor.AsIndexable());

 				var cpuReverseIm2Col = cpuTensor.ReverseIm2Col(cpuFilter, rows, columns, depth, filterWidth, filterHeight, stride);
@@ -754,11 +728,6 @@
 					var cpuXml = cpuResult.AsXml;
 					var gpuXml = gpuResult.AsXml;
 					FloatingPointHelper.AssertEqual(cpuResult, gpuResult);
-
-					//foreach (var filter in gpuFilterList) {
-					//	foreach (var item in filter)
-					//		item.Dispose();
-					//}
 				}
 			}
 		}


Disable UseShellExecute

Disable UseShellExecute

--- Worker.Common/JavaManager.cs
+++ Worker.Common/JavaManager.cs
@@ -65,7 +65,6 @@
                 var pi = new ProcessStartInfo(_binaryArchive)
                 {
                     Arguments = " /s /L " + installLog,
-                    UseShellExecute = true,
                     RedirectStandardError = true,
                     Verb = "runas"
                 };


Fix some details of the event object

Fix some details of the event object

--- XamarinStripe/StripeEvent.cs
+++ XamarinStripe/StripeEvent.cs
@@ -19,18 +19,19 @@
 using System.Text;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Converters;
-using System.Dynamic;
 using Newtonsoft.Json.Linq;

 namespace Xamarin.Payments.Stripe {
     public class StripeEvent : StripeObject {
         [JsonProperty (PropertyName = "livemode")]
-        bool LiveMode { get; set; }
+        public bool LiveMode { get; set; }
+
         [JsonProperty (PropertyName = "created")]
         [JsonConverter (typeof (UnixDateTimeConverter))]
         public DateTime? Created { get; set; }
+
         [JsonProperty (PropertyName = "type")]
-        public string type { get; set; }
+        public string Type { get; set; }

         [JsonProperty (PropertyName= "data")]
         public EventData Data { get; set; }
@@ -39,6 +40,9 @@
             [JsonProperty (PropertyName = "object")]
             [JsonConverter (typeof (StripeObjectConverter))]
             public StripeObject Object { get; set; }
+
+            [JsonProperty (PropertyName = "previous_attributes")]
+            public JObject PreviousAttributes { get; set; }
         }
     }
 }


Added a test to check on Strings (StringValue) as keys.

--- YAMP.Sets.Tests/SetsTests.cs
+++ YAMP.Sets.Tests/SetsTests.cs
@@ -404,5 +404,33 @@
             TestValue(F("a=newSortedSet({0})", sSetA), set);
         }

+
+        [Test]
+        public void SET_StringEqualityAsKeys()
+        {
+            //https://github.com/FlorianRappl/YAMP/issues/22
+            //String keys "Equality" on Sets must be assured so they don't repeat...
+            //In CSharp, they would be (at least if they are constant) but in YAMP, Strings are wrapped in StringValue, so the "equality" must be explicit.
+            string sSetA1 = "'A1', 'A', 'A'".Replace('\'', '\"');
+            string sSetA2 = "'A2', 'A'".Replace('\'', '\"');
+
+            /*
+            newset("A1", "A", "A") == newset("A2", "A")
+            a1=newset("A1", "A", "A");a2=newset("A2", "A");a1==a2
+            a1.SetEquals(a2)
+            a2.SetEquals(a1)
+            TEquals(a1, a2)
+            TEquals(a2, a1)
+            */
+
+            TestValue(F("newSet({0}) == newSet({1})", sSetA1, sSetA2), 1);
+            TestValue(F("a1=newSet({0}); a2=newSet({1});a1==a2", sSetA1, sSetA2), 1);
+            TestValue(F("a1=newSet({0}); a2=newSet({1});a1.SetEquals(a2)", sSetA1, sSetA2), 1);
+            TestValue(F("a1=newSet({0}); a2=newSet({1});a2.SetEquals(a1)", sSetA1, sSetA2), 1);
+            TestValue(F("a1=newSet({0}); a2=newSet({1});TEquals(a1, a2)", sSetA1, sSetA2), 1);
+            TestValue(F("a1=newSet({0}); a2=newSet({1});TEquals(a2, a1)", sSetA1, sSetA2), 1);
+        }
+
+
     }
 }


Stub Environment from registry apis inside app-containers. (CoreCLR) (#12390)

We're not going to get exemptions for these inside appcontainers
so we'll change them to behave as they do on Unix (present
an empty reg key that eats writes requests.)

--- src/mscorlib/src/System/Environment.cs
+++ src/mscorlib/src/System/Environment.cs
@@ -585,9 +585,13 @@
             if (target == EnvironmentVariableTarget.Process)
                 return GetEnvironmentVariableCore(variable);

-#if !FEATURE_WIN32_REGISTRY
-            return null;
-#else
+#if FEATURE_WIN32_REGISTRY
+            if (AppDomain.IsAppXModel())
+#endif
+            {
+                return null;
+            }
+#if FEATURE_WIN32_REGISTRY
             RegistryKey baseKey;
             string keyName;

@@ -670,11 +674,15 @@

         internal static IEnumerable<KeyValuePair<string, string>> EnumerateEnvironmentVariablesFromRegistry(EnvironmentVariableTarget target)
         {
-#if !FEATURE_WIN32_REGISTRY
-            // Without registry support we have nothing to return
-            ValidateTarget(target);
-            yield break;
-#else
+#if FEATURE_WIN32_REGISTRY
+            if (AppDomain.IsAppXModel())
+#endif
+            {
+                // Without registry support we have nothing to return
+                ValidateTarget(target);
+                yield break;
+            }
+#if FEATURE_WIN32_REGISTRY
             RegistryKey baseKey;
             string keyName;
             if (target == EnvironmentVariableTarget.Machine)
@@ -740,10 +748,14 @@
                 return;
             }

-#if !FEATURE_WIN32_REGISTRY
-            // other targets ignored
-            return;
-#else
+#if FEATURE_WIN32_REGISTRY
+            if (AppDomain.IsAppXModel())
+#endif
+            {
+                // other targets ignored
+                return;
+            }
+#if FEATURE_WIN32_REGISTRY
             // explicitly null out value if is the empty string.
             if (string.IsNullOrEmpty(value) || value[0] == '\0')
                 value = null;


no message

no message

--- gdd2xna/gdd2xna/src/Grid.cs
+++ gdd2xna/gdd2xna/src/Grid.cs
@@ -574,7 +574,6 @@
             //draw the board
             sb.Draw(main.Grid_Art, gridRect, Color.White);
             //draw the tiles
-            var tileTexture = new Texture2D(main.GraphicsDevice, Grid.TILE_SIZE, Grid.TILE_SIZE);

             var tileColor = new Color();
             tileColor = Color.White;
@@ -582,7 +581,7 @@
             {
                 for (int j = 0; j < cols; ++j)
                 {
-                    tileTexture = createTileTexture(this[i, j].type);
+                    var tileTexture = createTileTexture(this[i, j].type);
                     var tileRect = new Rectangle((int)this[i,j].ScreenPosition.x,(int)this[i,j].ScreenPosition.y - Grid.TILE_SIZE, Grid.TILE_SIZE, Grid.TILE_SIZE);
                     if (this[i, j].type != TileType.Emp)
                         sb.Draw(tileTexture, tileRect, tileColor);


report should include ads too

report should include ads too

--- slimCat/Services/MessageService.cs
+++ slimCat/Services/MessageService.cs
@@ -676,7 +676,8 @@
                             Tab = channelText
                         };

-                    logId = api.UploadLog(report, channel.Messages);
+
+                    logId = api.UploadLog(report, channel.Messages.Union(channel.Ads));
                 }
             }


Windows platform strings updated.

Windows platform strings updated.

--- source/Assets/Scripts/Infinario.cs
+++ source/Assets/Scripts/Infinario.cs
@@ -437,17 +437,17 @@
 				{RuntimePlatform.Android, "Android"},
 				{RuntimePlatform.IPhonePlayer, "iOS"},
 				{RuntimePlatform.LinuxPlayer, "Linux"},
-				{RuntimePlatform.MetroPlayerARM, "Windows"},
-				{RuntimePlatform.MetroPlayerX64, "Windows"},
-				{RuntimePlatform.MetroPlayerX86, "Windows"},
+				{RuntimePlatform.MetroPlayerARM, "Windows Phone"},
+				{RuntimePlatform.MetroPlayerX64, "Windows Store"},
+				{RuntimePlatform.MetroPlayerX86, "Windows Store"},
 				{RuntimePlatform.OSXDashboardPlayer, "Mac OS X"},
 				{RuntimePlatform.OSXEditor, "Mac OS X"},
 				{RuntimePlatform.OSXPlayer, "Mac OS X"},
 				{RuntimePlatform.OSXWebPlayer, "Mac OS X"},
-				{RuntimePlatform.WP8Player, "Windows Mobile"},
-				{RuntimePlatform.WindowsEditor, "Windows"},
-				{RuntimePlatform.WindowsPlayer, "Windows"},
-				{RuntimePlatform.WindowsWebPlayer, "Windows"}
+				{RuntimePlatform.WindowsEditor, "Unity Editor"},
+				{RuntimePlatform.WindowsPlayer, "Windows Standalone"},
+				{RuntimePlatform.WP8Player, "Windows Phone"},
+				{RuntimePlatform.WindowsWebPlayer, "Web Player"}
 			};
 			return (dict.ContainsKey (platform) ? dict [platform] : "Other");
 		}


Fixed typescript generator not setting rootUrl on construction. Fixed admin initial load.

--- core/codegen/service.cs
+++ core/codegen/service.cs
@@ -45,7 +45,7 @@
             constructor.WriteLine(@"
         constructor($http: ng.IHttpService, rootUrl : string) {
             this._$http = $http;
-
+           this.rootUrl = rootUrl;
 ");
             constructor.Indent += 2;


Add full comparers to IEqualityComparer<T> tests.

--- test/UnitTests/IEqualityComparerTUnitTests.cs
+++ test/UnitTests/IEqualityComparerTUnitTests.cs
@@ -25,6 +25,12 @@
             () => EqualityComparerBuilder.For<HierarchyBase>().Default(),
             () => EqualityComparerBuilder.For<string>().Default(),
             () => EqualityComparerBuilder.For<object>().Default(),
+            () => ComparerBuilder.For<int>().Default(),
+            () => ComparerBuilder.For<int?>().Default(),
+            () => ComparerBuilder.For<int[]>().Default(),
+            // Default comparer is not defined for HierarchyBase
+            () => ComparerBuilder.For<string>().Default(),
+            () => ComparerBuilder.For<object>().Default(),

             // Null
             () => EqualityComparerBuilder.For<int>().Null(),
@@ -33,12 +39,12 @@
             () => EqualityComparerBuilder.For<HierarchyBase>().Null(),
             () => EqualityComparerBuilder.For<string>().Null(),
             () => EqualityComparerBuilder.For<object>().Null(),
-
-            // Reference
-            () => EqualityComparerBuilder.For<int[]>().Reference(),
-            () => EqualityComparerBuilder.For<HierarchyBase>().Reference(),
-            () => EqualityComparerBuilder.For<string>().Reference(),
-            () => EqualityComparerBuilder.For<object>().Reference(),
+            () => ComparerBuilder.For<int>().Null(),
+            () => ComparerBuilder.For<int?>().Null(),
+            () => ComparerBuilder.For<int[]>().Null(),
+            () => ComparerBuilder.For<HierarchyBase>().Null(),
+            () => ComparerBuilder.For<string>().Null(),
+            () => ComparerBuilder.For<object>().Null(),

             // Key
             () => EqualityComparerBuilder.For<int>().EquateBy(x => x % 13, null, false),
@@ -47,18 +53,47 @@
             () => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id % 13, null, false),
             () => EqualityComparerBuilder.For<string>().EquateBy(x => x.ToLowerInvariant(), null, false),
             () => EqualityComparerBuilder.For<object>().EquateBy(x => x.GetHashCode(), null, false),
+            () => ComparerBuilder.For<int>().OrderBy(x => x % 13, null, false, false),
+            () => ComparerBuilder.For<int?>().OrderBy(x => x % 13, null, false, false),
+            () => ComparerBuilder.For<int[]>().OrderBy(x => x.Length, null, false, false),
+            () => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id % 13, null, false, false),
+            () => ComparerBuilder.For<string>().OrderBy(x => x.ToLowerInvariant(), null, false, false),
+            () => ComparerBuilder.For<object>().OrderBy(x => x.GetHashCode(), null, false, false),

             // Sequence
             () => EqualityComparerBuilder.For<int>().Default().EquateSequence(),
             () => EqualityComparerBuilder.For<int?>().Default().EquateSequence(),
             () => EqualityComparerBuilder.For<int[]>().Default().EquateSequence(),
-            () => EqualityComparerBuilder.For<HierarchyBase>().Default().EquateSequence(),
+            () => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id, null, false).EquateSequence(),
             () => EqualityComparerBuilder.For<string>().Default().EquateSequence(),
             () => EqualityComparerBuilder.For<object>().Default().EquateSequence(),
+            () => ComparerBuilder.For<int>().Default().Sequence(),
+            () => ComparerBuilder.For<int?>().Default().Sequence(),
+            () => ComparerBuilder.For<int[]>().Default().Sequence(),
+            () => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Sequence(),
+            () => ComparerBuilder.For<string>().Default().Sequence(),
+            () => ComparerBuilder.For<object>().Default().Sequence(),

             // Hierarchy
             () => HierarchyComparers.BaseEqualityComparer,
             () => HierarchyComparers.Derived1EqualityComparer,
+            () => HierarchyComparers.BaseComparer,
+            () => HierarchyComparers.Derived1Comparer,
+
+            // Reference EqualityComparer
+            () => EqualityComparerBuilder.For<int[]>().Reference(),
+            () => EqualityComparerBuilder.For<HierarchyBase>().Reference(),
+            () => EqualityComparerBuilder.For<string>().Reference(),
+            () => EqualityComparerBuilder.For<object>().Reference(),
+
+            // Reverse Comparer
+            () => ComparerBuilder.For<int>().Default().Reverse(),
+            () => ComparerBuilder.For<int?>().Default().Reverse(),
+            () => ComparerBuilder.For<int[]>().Default().Reverse(),
+            () => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Reverse(),
+            () => ComparerBuilder.For<string>().Default().Reverse(),
+            () => ComparerBuilder.For<object>().Default().Reverse(),
+            () => ComparerBuilder.For<object>().OrderBy(x => 13, null, false, false).Reverse(),
         };

         public static readonly List<KeyValuePair<string, dynamic>> EqualityComparersExceptObject =
@@ -84,6 +119,7 @@
             EqualityComparers
                 .Select(x => (x.Key, ComparedType(x.Value as IEqualityComparer)))
                 .Append((Key(() => HierarchyComparers.BaseEqualityComparer), typeof(HierarchyDerived1)))
+                .Append((Key(() => HierarchyComparers.BaseComparer), typeof(HierarchyDerived1)))
                 .ToTheoryData();

         [Theory]
@@ -118,6 +154,10 @@
             { Key(() => EqualityComparerBuilder.For<int?>().Default()), 13, 13 },
             { Key(() => EqualityComparerBuilder.For<int[]>().Default()), new[] { 13 }, new[] { 13 } },
             { Key(() => EqualityComparerBuilder.For<string>().Default()), "test", Duplicate("test") },
+            { Key(() => ComparerBuilder.For<int>().Default()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int?>().Default()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().Default()), new[] { 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<string>().Default()), "test", Duplicate("test") },

             // Null
             { Key(() => EqualityComparerBuilder.For<int>().Null()), 13, 13 },
@@ -126,8 +166,12 @@
             { Key(() => EqualityComparerBuilder.For<HierarchyBase>().Null()), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
             { Key(() => EqualityComparerBuilder.For<string>().Null()), "test", Duplicate("test") },
             { Key(() => EqualityComparerBuilder.For<object>().Null()), "test", Duplicate("test") },
-
-            // Reference comparer cannot be tested here, since no reference comparer can have different instances that are equivalent.
+            { Key(() => ComparerBuilder.For<int>().Null()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int?>().Null()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().Null()), new[] { 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().Null()), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
+            { Key(() => ComparerBuilder.For<string>().Null()), "test", Duplicate("test") },
+            { Key(() => ComparerBuilder.For<object>().Null()), "test", Duplicate("test") },

             // Key
             { Key(() => EqualityComparerBuilder.For<int>().EquateBy(x => x % 13, null, false)), 13, 13 },
@@ -136,18 +180,44 @@
             { Key(() => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id % 13, null, false)), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
             { Key(() => EqualityComparerBuilder.For<string>().EquateBy(x => x.ToLowerInvariant(), null, false)), "test", "Test" },
             { Key(() => EqualityComparerBuilder.For<object>().EquateBy(x => x.GetHashCode(), null, false)), "test", Duplicate("test") },
-
-            // Sequence comparer cannot test <HierarchyBase>, since the xUnit serialization cannot restore equivalent references.
+            { Key(() => ComparerBuilder.For<int>().OrderBy(x => x % 13, null, false, false)), 13, 13 },
+            { Key(() => ComparerBuilder.For<int?>().OrderBy(x => x % 13, null, false, false)), 13, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().OrderBy(x => x.Length, null, false, false)), new[] { 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id % 13, null, false, false)), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
+            { Key(() => ComparerBuilder.For<string>().OrderBy(x => x.ToLowerInvariant(), null, false, false)), "test", "Test" },
+            { Key(() => ComparerBuilder.For<object>().OrderBy(x => x.GetHashCode(), null, false, false)), "test", Duplicate("test") },
+
+            // Sequence
             { Key(() => EqualityComparerBuilder.For<int>().Default().EquateSequence()), new[] { 13 }, new[] { 13 } },
             { Key(() => EqualityComparerBuilder.For<int?>().Default().EquateSequence()), new int?[] { 13 }, new int?[] { 13 } },
             { Key(() => EqualityComparerBuilder.For<int[]>().Default().EquateSequence()), new[] { new[] { 13 } }, new[] { new[] { 13 } } },
+            { Key(() => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id, null, false).EquateSequence()), new[] { new HierarchyBase { Id = 13 } }, new[] { new HierarchyBase { Id = 13 } } },
             { Key(() => EqualityComparerBuilder.For<string>().Default().EquateSequence()), new[] { "test" }, new[] { "test" } },
             { Key(() => EqualityComparerBuilder.For<object>().Default().EquateSequence()), new[] { "test" }, new[] { "test" } },
+            { Key(() => ComparerBuilder.For<int>().Default().Sequence()), new[] { 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<int?>().Default().Sequence()), new int?[] { 13 }, new int?[] { 13 } },
+            { Key(() => ComparerBuilder.For<int[]>().Default().Sequence()), new[] { new[] { 13 } }, new[] { new[] { 13 } } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Sequence()), new[] { new HierarchyBase { Id = 13 } }, new[] { new HierarchyBase { Id = 13 } } },
+            { Key(() => ComparerBuilder.For<string>().Default().Sequence()), new[] { "test" }, new[] { "test" } },
+            { Key(() => ComparerBuilder.For<object>().Default().Sequence()), new[] { "test" }, new[] { "test" } },

             // Hierarchy
             { Key(() => HierarchyComparers.BaseEqualityComparer), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
             { Key(() => HierarchyComparers.BaseEqualityComparer), new HierarchyDerived1 { Id = 13 }, new HierarchyDerived2 { Id = 13 } },
             { Key(() => HierarchyComparers.Derived1EqualityComparer), new HierarchyDerived1 { Id = 13 }, new HierarchyDerived1 { Id = 13 } },
+            { Key(() => HierarchyComparers.BaseComparer), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
+            { Key(() => HierarchyComparers.BaseComparer), new HierarchyDerived1 { Id = 13 }, new HierarchyDerived2 { Id = 13 } },
+            { Key(() => HierarchyComparers.Derived1Comparer), new HierarchyDerived1 { Id = 13 }, new HierarchyDerived1 { Id = 13 } },
+
+            // Reference comparer cannot be tested here, since no reference comparer can have different instances that are equivalent.
+
+            // Reverse
+            { Key(() => ComparerBuilder.For<int>().Default().Reverse()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int?>().Default().Reverse()), 13, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().Default().Reverse()), new[] { 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Reverse()), new HierarchyBase { Id = 13 }, new HierarchyBase { Id = 13 } },
+            { Key(() => ComparerBuilder.For<string>().Default().Reverse()), "test", Duplicate("test") },
+            { Key(() => ComparerBuilder.For<object>().OrderBy(x => 13, null, false, false).Reverse()), "test", Duplicate("test") },
         };

         [Theory]
@@ -168,14 +238,13 @@
             { Key(() => EqualityComparerBuilder.For<HierarchyBase>().Default()), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
             { Key(() => EqualityComparerBuilder.For<string>().Default()), "test", "other" },
             { Key(() => EqualityComparerBuilder.For<object>().Default()), "test", "other" },
+            { Key(() => ComparerBuilder.For<int>().Default()), 7, 13 },
+            { Key(() => ComparerBuilder.For<int?>().Default()), 7, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().Default()), new[] { 7 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<string>().Default()), "test", "other" },
+            { Key(() => ComparerBuilder.For<object>().Default()), "test", "other" },

             // Null comparer cannot be tested here, since no two instances are not equal.
-
-            // Reference
-            { Key(() => EqualityComparerBuilder.For<int[]>().Reference()), new[] { 7 }, new[] { 13 } },
-            { Key(() => EqualityComparerBuilder.For<HierarchyBase>().Reference()), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
-            { Key(() => EqualityComparerBuilder.For<string>().Reference()), "test", "other" },
-            { Key(() => EqualityComparerBuilder.For<object>().Reference()), "test", "other" },

             // Key
             { Key(() => EqualityComparerBuilder.For<int>().EquateBy(x => x % 13, null, false)), 7, 13 },
@@ -184,19 +253,48 @@
             { Key(() => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id % 13, null, false)), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
             { Key(() => EqualityComparerBuilder.For<string>().EquateBy(x => x.ToLowerInvariant(), null, false)), "test", "other" },
             { Key(() => EqualityComparerBuilder.For<object>().EquateBy(x => x.GetHashCode(), null, false)), "test", "other" },
+            { Key(() => ComparerBuilder.For<int>().OrderBy(x => x % 13, null, false, false)), 7, 13 },
+            { Key(() => ComparerBuilder.For<int?>().OrderBy(x => x % 13, null, false, false)), 7, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().OrderBy(x => x.Length, null, false, false)), new[] { 7, 13 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id % 13, null, false, false)), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
+            { Key(() => ComparerBuilder.For<string>().OrderBy(x => x.ToLowerInvariant(), null, false, false)), "test", "other" },
+            { Key(() => ComparerBuilder.For<object>().OrderBy(x => x.GetHashCode(), null, false, false)), "test", "other" },

             // Sequence
             { Key(() => EqualityComparerBuilder.For<int>().Default().EquateSequence()), new[] { 7 }, new[] { 13 } },
             { Key(() => EqualityComparerBuilder.For<int?>().Default().EquateSequence()), new int?[] { 7 }, new int?[] { 13 } },
             { Key(() => EqualityComparerBuilder.For<int[]>().Default().EquateSequence()), new[] { new[] { 7 } }, new[] { new[] { 13 } } },
-            { Key(() => EqualityComparerBuilder.For<HierarchyBase>().Default().EquateSequence()), new[] { new HierarchyBase { Id = 7 } }, new[] { new HierarchyBase { Id = 13 } } },
+            { Key(() => EqualityComparerBuilder.For<HierarchyBase>().EquateBy(x => x.Id, null, false).EquateSequence()), new[] { new HierarchyBase { Id = 7 } }, new[] { new HierarchyBase { Id = 13 } } },
             { Key(() => EqualityComparerBuilder.For<string>().Default().EquateSequence()), new[] { "test" }, new[] { "other" } },
             { Key(() => EqualityComparerBuilder.For<object>().Default().EquateSequence()), new[] { "test" }, new[] { "other" } },
+            { Key(() => ComparerBuilder.For<int>().Default().Sequence()), new[] { 7 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<int?>().Default().Sequence()), new int?[] { 7 }, new int?[] { 13 } },
+            { Key(() => ComparerBuilder.For<int[]>().Default().Sequence()), new[] { new[] { 7 } }, new[] { new[] { 13 } } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Sequence()), new[] { new HierarchyBase { Id = 7 } }, new[] { new HierarchyBase { Id = 13 } } },
+            { Key(() => ComparerBuilder.For<string>().Default().Sequence()), new[] { "test" }, new[] { "other" } },
+            { Key(() => ComparerBuilder.For<object>().Default().Sequence()), new[] { "test" }, new[] { "other" } },

             // Hierarchy
             { Key(() => HierarchyComparers.BaseEqualityComparer), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
             { Key(() => HierarchyComparers.BaseEqualityComparer), new HierarchyDerived1 { Id = 7 }, new HierarchyDerived2 { Id = 13 } },
             { Key(() => HierarchyComparers.Derived1EqualityComparer), new HierarchyDerived1 { Id = 7 }, new HierarchyDerived1 { Id = 13 } },
+            { Key(() => HierarchyComparers.BaseComparer), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
+            { Key(() => HierarchyComparers.BaseComparer), new HierarchyDerived1 { Id = 7 }, new HierarchyDerived2 { Id = 13 } },
+            { Key(() => HierarchyComparers.Derived1Comparer), new HierarchyDerived1 { Id = 7 }, new HierarchyDerived1 { Id = 13 } },
+
+            // Reference
+            { Key(() => EqualityComparerBuilder.For<int[]>().Reference()), new[] { 7 }, new[] { 13 } },
+            { Key(() => EqualityComparerBuilder.For<HierarchyBase>().Reference()), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
+            { Key(() => EqualityComparerBuilder.For<string>().Reference()), "test", "other" },
+            { Key(() => EqualityComparerBuilder.For<object>().Reference()), "test", "other" },
+
+            // Reverse
+            { Key(() => ComparerBuilder.For<int>().Default().Reverse()), 7, 13 },
+            { Key(() => ComparerBuilder.For<int?>().Default().Reverse()), 7, 13 },
+            { Key(() => ComparerBuilder.For<int[]>().Default().Reverse()), new[] { 7 }, new[] { 13 } },
+            { Key(() => ComparerBuilder.For<HierarchyBase>().OrderBy(x => x.Id, null, false, false).Reverse()), new HierarchyBase { Id = 7 }, new HierarchyBase { Id = 13 } },
+            { Key(() => ComparerBuilder.For<string>().Default().Reverse()), "test", "other" },
+            { Key(() => ComparerBuilder.For<object>().Default().Reverse()), "test", "other" },
         };
     }
 }


Startup link working directory fix

Startup link working directory fix

Fixes the created startup link, to include a working directory, to read the saved "DuckDNS.cfg"

--- DuckDNS/ShellLink.cs
+++ DuckDNS/ShellLink.cs
@@ -17,6 +17,7 @@
             // setup shortcut information
             link.SetDescription(description);
             link.SetPath(path);
+            link.SetWorkingDirectory(Path.GetDirectoryName(path));

             // save it
             IPersistFile file = (IPersistFile)link;


adjust bracket

adjust bracket

--- test/MSBuild.Test/NuGetTaskUnitTest.cs
+++ test/MSBuild.Test/NuGetTaskUnitTest.cs
@@ -31,8 +31,7 @@
         }

         [TestMethod]
-        public void WillSetOutputPathWhenRun()
-        {
+        public void WillSetOutputPathWhenRun() {
             var packageStreamStub = new Mock<Stream>();
             var packageBuilderStub = new Mock<IPackageBuilder>();
             NuGet.MSBuild.NuGet task = CreateTaskWithDefaultStubs(packageBuilderStub: packageBuilderStub, packageStreamStub: packageStreamStub);


disable parallel execution for YoloTest

disable parallel execution for YoloTest

--- test/OpenCvSharp.Tests/dnn/YoloTest.cs
+++ test/OpenCvSharp.Tests/dnn/YoloTest.cs
@@ -7,6 +7,7 @@

 namespace OpenCvSharp.Tests.Dnn
 {
+    [Xunit.Collection(nameof(YoloTest))]
     public class YoloTest : TestBase
     {
         // https://github.com/opencv/opencv/blob/24bed38c2b2c71d35f2e92aa66648f8485a70892/samples/dnn/yolo_object_detection.cpp


fixed indentation

fixed indentation

--- src/Abp.MailKit/EmailExtensions.cs
+++ src/Abp.MailKit/EmailExtensions.cs
@@ -242,7 +242,7 @@
         /// </summary>
         /// <returns>The equivalent <see cref="MailboxAddress"/>.</returns>
         /// <param name="address">The mail address.</param>
-		private static MailboxAddress ToMailboxAddress(this MailAddress address)
+        private static MailboxAddress ToMailboxAddress(this MailAddress address)
         {
             return address != null ? new MailboxAddress(address.DisplayName, address.Address) : null;
         }
@@ -253,7 +253,7 @@
         /// </summary>
         /// <returns>The equivalent <see cref="InternetAddressList"/>.</returns>
         /// <param name="addresses">The mail address.</param>
-		private static InternetAddressList ToInternetAddressList(this MailAddressCollection addresses)
+        private static InternetAddressList ToInternetAddressList(this MailAddressCollection addresses)
         {
             if (addresses == null)
                 return null;


fix 15 ,RangeFacetHandler support  NumericField test case

--- src/BoboBrowse.Tests/BasicTests.cs
+++ src/BoboBrowse.Tests/BasicTests.cs
@@ -77,14 +77,14 @@
                     var doc = new Document();
                     doc.Add(new Field("name", book.Name, Field.Store.YES, Field.Index.ANALYZED));
                     doc.Add(new Field("category", book.Category.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
-                    doc.Add(new NumericField("price", Field.Store.YES, true).SetDoubleValue(book.Price));
+                    doc.Add(new NumericField("price", int.MaxValue - 1, Field.Store.YES, true).SetDoubleValue(book.Price));
                     doc.Add(new Field("author", book.Author, Field.Store.YES, Field.Index.ANALYZED));
                     doc.Add(new Field("path", book.Path, Field.Store.YES, Field.Index.ANALYZED));
                     doc.Add(new Field("year", book.Year.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
                     indexWriter.AddDocument(doc);
                 }
                 indexWriter.Optimize();
-            }
+            }
         }

         [Test]
@@ -215,15 +215,14 @@

         [Test]
         public void TestRangeFacetHandler()
-        {
+        {
             var query = new MatchAllDocsQuery();
             Console.WriteLine(string.Format("query: <{0}>", query.ToString()));

             var testRangeFacetHandlers = new List<FacetHandler>();
             testRangeFacetHandlers.Add(new RangeFacetHandler("year", true));//auto range
             testRangeFacetHandlers.Add(new RangeFacetHandler("year", new List<string>(new string[] { "[* TO 2000]", "[2000 TO 2005]", "[2006 TO 2010]", "[2011 TO *]" })));
-            //WARNING : RangeFacetHandler not support a NumberField type because NumericField uses a spezial encoding.
-            //testRangeFacetHandlers.Add(new RangeFacetHandler("price", true));this will throw exception.
+            testRangeFacetHandlers.Add(new RangeFacetHandler("price","price", new NumberFieldFactory(), true));

             for (var i = 0; i < testRangeFacetHandlers.Count; i++)
             {
@@ -255,6 +254,31 @@
             }
         }
     }
+
+    public class NumberFieldFactory : TermListFactory
+    {
+
+        public override ITermValueList CreateTermList()
+        {
+            return new PriceValueList();
+        }
+
+        private class PriceValueList : TermStringList
+        {
+            public override void Add(string o)
+            {
+                if (o == null)
+                {
+                    base.Add(o);
+
+                }
+                else
+                {
+                    base.Add(Lucene.Net.Util.NumericUtils.PrefixCodedToDouble(o).ToString());
+                }
+            }
+        }
+    }
 }