This is an automated email from the ASF dual-hosted git repository. nightowl888 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit 6ba76131007aeed33844e10dff57cd793eab2f25 Author: Shad Storhaug <[email protected]> AuthorDate: Mon Dec 16 00:35:51 2019 +0700 Lucene.Net.Tests.Util.TestWeakIdentityMap: Factored out AtomicReferenceArray from support in favor of the implementation in J2N --- src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs | 4 +- src/Lucene.Net/Support/AtomicReferenceArray.cs | 52 ------------------------ 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs b/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs index 95237b3..cc808fa 100644 --- a/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs +++ b/src/Lucene.Net.Tests/Util/TestWeakIdentityMap.cs @@ -1,10 +1,8 @@ +using J2N.Threading.Atomic; using Lucene.Net.Attributes; -using Lucene.Net.Randomized.Generators; -using Lucene.Net.Support; using Lucene.Net.Support.Threading; using NUnit.Framework; using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.Threading; diff --git a/src/Lucene.Net/Support/AtomicReferenceArray.cs b/src/Lucene.Net/Support/AtomicReferenceArray.cs deleted file mode 100644 index 6ac1064..0000000 --- a/src/Lucene.Net/Support/AtomicReferenceArray.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Threading; - -namespace Lucene.Net.Support -{ - /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - /// <summary> - /// Mimics Java's AtomicReferenceArray class (partial implementation) - /// </summary> - /// <typeparam name="T"></typeparam> - public class AtomicReferenceArray<T> where T : class - { - private T[] _array; - - public AtomicReferenceArray(int length) - { - _array = new T[length]; - } - - public int Length - { - get { return _array.Length; } - } - - public T this[int index] - { - get - { - return Volatile.Read(ref _array[index]); - } - set - { - Volatile.Write(ref _array[index], value); - } - } - } -}
