lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnas...@apache.org
Subject svn commit: r1353077 - in /incubator/lucene.net/branches/Lucene.Net_3_5: build/vs2010/core/ src/core/ src/core/Analysis/ src/core/Index/ src/core/Search/ src/core/Search/Spans/ src/core/Store/ src/core/Support/Compatibility/ src/core/Util/
Date Sat, 23 Jun 2012 06:39:46 GMT
Author: pnasser
Date: Sat Jun 23 06:39:43 2012
New Revision: 1353077

URL: http://svn.apache.org/viewvc?rev=1353077&view=rev
Log:
LUCENENET-480 .Net 3.5 support. Added #NET35 compiler flag to Lucene.Net core. Support/Compatibility/SortedSet.cs
needs adjustments. Test and Contrib will need to be looked at 

Added:
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ISet.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SetFactory.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SortedSet.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ThreadLocal.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/WrappedHashSet.cs
Modified:
    incubator/lucene.net/branches/Lucene.Net_3_5/build/vs2010/core/Lucene.Net.Core.sln
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Analysis/WordlistLoader.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/DirectoryReader.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/IndexWriter.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/ParallelReader.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentMerger.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentReader.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Lucene.Net.csproj
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/MultiSearcher.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/ParallelMultiSearcher.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/NearSpansUnordered.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/SpanWeight.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Store/RAMDirectory.cs
    incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Util/CloseableThreadLocal.cs

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/build/vs2010/core/Lucene.Net.Core.sln
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/build/vs2010/core/Lucene.Net.Core.sln?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/build/vs2010/core/Lucene.Net.Core.sln (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/build/vs2010/core/Lucene.Net.Core.sln Sat
Jun 23 06:39:43 2012
@@ -1,36 +1,19 @@
 
 Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C# Express 2010
-#
-#
-# 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.
-#
-#
+# Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net", "..\..\..\src\core\Lucene.Net.csproj",
"{5D4AD9BE-1FFB-41AB-9943-25737971BF57}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		NET35|Any CPU = NET35|Any CPU
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.NET35|Any CPU.ActiveCfg = NET35|Any CPU
+		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.NET35|Any CPU.Build.0 = NET35|Any CPU
 		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5D4AD9BE-1FFB-41AB-9943-25737971BF57}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Analysis/WordlistLoader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Analysis/WordlistLoader.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Analysis/WordlistLoader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Analysis/WordlistLoader.cs Sat Jun
23 06:39:43 2012
@@ -34,7 +34,7 @@ namespace Lucene.Net.Analysis
 		/// <returns> A HashSet with the file's words</returns>
 		public static ISet<string> GetWordSet(System.IO.FileInfo wordfile)
 		{
-			ISet<string> result = new HashSet<string>();
+			ISet<string> result =  Support.Compatibility.SetFactory.GetSet<string>();
 			System.IO.StreamReader reader = null;
 			try
 			{
@@ -82,9 +82,9 @@ namespace Lucene.Net.Analysis
 		/// </summary>
 		/// <param name="reader">Reader containing the wordlist</param>
 		/// <returns>A HashSet with the reader's words</returns>
-		public static HashSet<string> GetWordSet(System.IO.TextReader reader)
+		public static ISet<string> GetWordSet(System.IO.TextReader reader)
 		{
-			HashSet<string> result = new HashSet<string>();
+			ISet<string> result =  Support.Compatibility.SetFactory.GetSet<string>();
 			System.IO.TextReader br = null;
 			try
 			{

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/DirectoryReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/DirectoryReader.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/DirectoryReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/DirectoryReader.cs Sat Jun
23 06:39:43 2012
@@ -1066,7 +1066,7 @@ namespace Lucene.Net.Index
         internal static System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption
fieldNames, IndexReader[] subReaders)
         {
             // maintain a unique set of field names
-            System.Collections.Generic.ISet<string> fieldSet = new System.Collections.Generic.HashSet<string>();
+            System.Collections.Generic.ISet<string> fieldSet = Support.Compatibility.SetFactory.GetSet<string>();
             foreach (IndexReader reader in subReaders)
             {
                 fieldSet.UnionWith(reader.GetFieldNames(fieldNames));

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/IndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/IndexWriter.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/IndexWriter.cs Sat Jun 23
06:39:43 2012
@@ -244,7 +244,7 @@ namespace Lucene.Net.Index
 		private DocumentsWriter docWriter;
 		private IndexFileDeleter deleter;
 
-        private ISet<SegmentInfo> segmentsToOptimize = new HashSet<SegmentInfo>();
// used by optimize to note those needing optimization
+        private ISet<SegmentInfo> segmentsToOptimize = Support.Compatibility.SetFactory.GetSet<SegmentInfo>();
// used by optimize to note those needing optimization
 		
 		private Lock writeLock;
 		
@@ -260,7 +260,7 @@ namespace Lucene.Net.Index
 		private MergePolicy mergePolicy;
 		private MergeScheduler mergeScheduler = new ConcurrentMergeScheduler();
         private LinkedList<MergePolicy.OneMerge> pendingMerges = new LinkedList<MergePolicy.OneMerge>();
-		private ISet<MergePolicy.OneMerge> runningMerges = new HashSet<MergePolicy.OneMerge>();
+	    private ISet<MergePolicy.OneMerge> runningMerges = Support.Compatibility.SetFactory.GetSet<MergePolicy.OneMerge>();
 		private IList<MergePolicy.OneMerge> mergeExceptions = new List<MergePolicy.OneMerge>();
 		private long mergeGen;
 		private bool stopMerges;
@@ -2733,7 +2733,7 @@ namespace Lucene.Net.Index
 			lock (this)
 			{
 				ResetMergeExceptions();
-				segmentsToOptimize = new HashSet<SegmentInfo>();
+				segmentsToOptimize =  Support.Compatibility.SetFactory.GetSet<SegmentInfo>();
                 optimizeMaxNumSegments = maxNumSegments;
 				int numSegments = segmentInfos.Count;
 				for (int i = 0; i < numSegments; i++)

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/ParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/ParallelReader.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/ParallelReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/ParallelReader.cs Sat Jun
23 06:39:43 2012
@@ -531,7 +531,7 @@ namespace Lucene.Net.Index
         public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption
fieldNames)
 		{
 			EnsureOpen();
-            ISet<string> fieldSet = new HashSet<string>();
+            ISet<string> fieldSet =  Support.Compatibility.SetFactory.GetSet<string>();
 			foreach(var reader in readers)
 			{
 				ICollection<string> names = reader.GetFieldNames(fieldNames);

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentMerger.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentMerger.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentMerger.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentMerger.cs Sat Jun 23
06:39:43 2012
@@ -232,7 +232,7 @@ namespace Lucene.Net.Index
 
         internal ICollection<string> GetMergedFiles()
 		{
-            ISet<string> fileSet = new HashSet<string>();
+            ISet<string> fileSet =  Support.Compatibility.SetFactory.GetSet<string>();
 			
 			// Basic files
 			for (int i = 0; i < IndexFileNames.COMPOUND_EXTENSIONS.Length; i++)

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentReader.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Index/SegmentReader.cs Sat Jun 23
06:39:43 2012
@@ -1273,7 +1273,7 @@ namespace Lucene.Net.Index
 		{
 			EnsureOpen();
 
-            System.Collections.Generic.ISet<string> fieldSet = new System.Collections.Generic.HashSet<string>();
+	        System.Collections.Generic.ISet<string> fieldSet = Support.Compatibility.SetFactory.GetSet<string>();
 			for (int i = 0; i < core.fieldInfos.Size(); i++)
 			{
 				FieldInfo fi = core.fieldInfos.FieldInfo(i);

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Lucene.Net.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Lucene.Net.csproj?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Lucene.Net.csproj (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Lucene.Net.csproj Sat Jun 23 06:39:43
2012
@@ -114,6 +114,26 @@
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NET35|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\build\bin\core\Net35\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;NET35</DefineConstants>
+    <BaseAddress>285212672</BaseAddress>
+    <FileAlignment>4096</FileAlignment>
+    <NoWarn>618</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\build\bin\core\Debug\Lucene.Net.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>BasicDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio
10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team
Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System">
       <Name>System</Name>
@@ -858,6 +878,9 @@
     <Compile Include="Support\CloseableThreadLocalProfiler.cs" />
     <Compile Include="Support\CollectionsHelper.cs" />
     <Compile Include="Support\Compare.cs" />
+    <Compile Include="Support\Compatibility\ThreadLocal.cs" />
+    <Compile Include="Support\Compatibility\SetFactory.cs" />
+    <Compile Include="Support\Compatibility\WrappedHashSet.cs" />
     <Compile Include="Support\CRC32.cs" />
     <Compile Include="Support\Cryptography.cs" />
     <Compile Include="Support\Deflater.cs" />
@@ -867,7 +890,9 @@
     <Compile Include="Support\GeneralKeyedCollection.cs" />
     <Compile Include="Support\HashMap.cs" />
     <Compile Include="Support\Inflater.cs" />
+    <Compile Include="Support\Compatibility\ISet.cs" />
     <Compile Include="Support\IThreadRunnable.cs" />
+    <Compile Include="Support\Compatibility\SortedSet.cs" />
     <Compile Include="Support\Number.cs" />
     <Compile Include="Support\OS.cs" />
     <Compile Include="Support\SharpZipLib.cs" />

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/MultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/MultiSearcher.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/MultiSearcher.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/MultiSearcher.cs Sat Jun
23 06:39:43 2012
@@ -357,7 +357,7 @@ namespace Lucene.Net.Search
 			Query rewrittenQuery = Rewrite(original);
 			
 			// step 2
-			ISet<Term> terms = new HashSet<Term>();
+			ISet<Term> terms =  Support.Compatibility.SetFactory.GetSet<Term>();
 			rewrittenQuery.ExtractTerms(terms);
 			
 			// step3
@@ -385,6 +385,14 @@ namespace Lucene.Net.Search
 			return rewrittenQuery.Weight(cacheSim);
 		}
 
+
+#if NET35
+        public delegate TResult Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(T1
arg1, T2 arg2, T3 arg3, T4 arg4, 
+                                                                          T5 arg5, T6 arg6,
T7 arg7, T8 arg8, T9 arg9);
+        public delegate TResult Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(T1
arg1, T2 arg2, T3 arg3, T4 arg4, 
+                                                                               T5 arg5, T6
arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10);
+#endif
+
 	    internal Func<ThreadLock, object, Searchable, Weight, Filter, int, HitQueue, int,
int[], TopDocs> MultiSearcherCallableNoSort =
 	        (threadLock, lockObj, searchable, weight, filter, nDocs, hq, i, starts) =>
 	            {

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/ParallelMultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/ParallelMultiSearcher.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/ParallelMultiSearcher.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/ParallelMultiSearcher.cs
Sat Jun 23 06:39:43 2012
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#if (!NET35)
+
 using System;
 using System.Threading;
 using System.Threading.Tasks;
@@ -210,4 +212,6 @@ namespace Lucene.Net.Search
 			}
 		}
 	}
-}
\ No newline at end of file
+}
+
+#endif

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/NearSpansUnordered.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/NearSpansUnordered.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/NearSpansUnordered.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/NearSpansUnordered.cs
Sat Jun 23 06:39:43 2012
@@ -321,7 +321,7 @@ namespace Lucene.Net.Search.Spans
 	    /// <throws>  IOException </throws>
 	    public override ICollection<byte[]> GetPayload()
 	    {
-	        System.Collections.Generic.ISet<byte[]> matchPayload = new System.Collections.Generic.HashSet<byte[]>();
+	        System.Collections.Generic.ISet<byte[]> matchPayload = Support.Compatibility.SetFactory.GetSet<byte[]>();
 	        for (SpansCell cell = first; cell != null; cell = cell.next)
 	        {
 	            if (cell.IsPayloadAvailable())

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/SpanWeight.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/SpanWeight.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/SpanWeight.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Search/Spans/SpanWeight.cs Sat Jun
23 06:39:43 2012
@@ -35,7 +35,7 @@ namespace Lucene.Net.Search.Spans
 		protected internal float queryNorm;
 		protected internal float queryWeight;
 
-        protected internal HashSet<Term> terms;
+        protected internal ISet<Term> terms;
 		protected internal SpanQuery query;
 		private IDFExplanation idfExp;
 		
@@ -44,7 +44,7 @@ namespace Lucene.Net.Search.Spans
 			this.similarity = query.GetSimilarity(searcher);
 			this.query = query;
 
-			terms = new HashSet<Term>();
+			terms =  Support.Compatibility.SetFactory.GetSet<Term>();
 			query.ExtractTerms(terms);
 
 			idfExp = similarity.IdfExplain(terms, searcher);

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Store/RAMDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Store/RAMDirectory.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Store/RAMDirectory.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Store/RAMDirectory.cs Sat Jun 23
06:39:43 2012
@@ -86,7 +86,7 @@ namespace Lucene.Net.Store
 			{
 				EnsureOpen();
                 // TODO: may have better performance if our HashMap implmented KeySet() instead
of generating one via HashSet
-				System.Collections.Generic.ISet<string> fileNames = new System.Collections.Generic.HashSet<string>(fileMap.Keys);
+				System.Collections.Generic.ISet<string> fileNames =  Support.Compatibility.SetFactory.GetSet<string>();
 				System.String[] result = new System.String[fileNames.Count];
 				int i = 0;
 				foreach(string filename in fileNames)

Added: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ISet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ISet.cs?rev=1353077&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ISet.cs (added)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ISet.cs Sat
Jun 23 06:39:43 2012
@@ -0,0 +1,59 @@
+/* 
+ * 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.
+ */
+
+#if NET35
+
+namespace System.Collections.Generic
+{
+    public interface ISet<T> : ICollection<T>
+    {
+        #region METHODS
+
+        new bool Add(T item);
+
+        void ExceptWith(IEnumerable<T> other);
+
+        void IntersectWith(IEnumerable<T> other);
+
+        bool IsProperSubsetOf(IEnumerable<T> other);
+
+        bool IsProperSupersetOf(IEnumerable<T> other);
+
+        bool IsSubsetOf(IEnumerable<T> other);
+
+        bool IsSupersetOf(IEnumerable<T> other);
+
+        bool Overlaps(IEnumerable<T> other);
+
+        bool SetEquals(IEnumerable<T> other);
+
+        void SymmetricExceptWith(IEnumerable<T> other);
+
+        void UnionWith(IEnumerable<T> other);
+
+        #endregion
+
+        #region EXTENSION METHODS
+
+
+
+        #endregion
+    }
+
+}
+
+#endif
\ No newline at end of file

Added: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SetFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SetFactory.cs?rev=1353077&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SetFactory.cs
(added)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SetFactory.cs
Sat Jun 23 06:39:43 2012
@@ -0,0 +1,33 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+
+namespace Lucene.Net.Support.Compatibility
+{
+    public static class SetFactory
+    {
+        public static ISet<T> GetSet<T>()
+        {
+            #if NET35
+                return new WrappedHashSet<T>();
+            #else
+                return new HashSet<T>();
+            #endif
+        }
+    }
+}

Added: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SortedSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SortedSet.cs?rev=1353077&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SortedSet.cs
(added)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/SortedSet.cs
Sat Jun 23 06:39:43 2012
@@ -0,0 +1,209 @@
+/* 
+ * 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.
+ */
+
+#if NET35
+
+using System.Linq;
+using System.Runtime.Serialization;
+
+namespace System.Collections.Generic
+{
+
+    public class SortedSet<T> : ISet<T>, ICollection, ISerializable, IDeserializationCallback
+    {
+        private readonly SortedDictionary<T, byte> _list;
+
+        public SortedSet(IComparer<T> comparer)
+        {
+            _list = new SortedDictionary<T, byte>(comparer);
+        }
+
+        public T Min { get { return (_list.Count) >= 1 ? _list.Keys.First() : default(T);
} }
+
+        public T Max { get { return (_list.Count) >= 1 ? _list.Keys.Last() : default(T);
} }
+
+
+        /// <summary>
+        /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
+        /// </summary>
+        /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/>
is read-only. 
+        ///                 </exception>
+        public void Clear()
+        {
+            throw new NotImplementedException();
+        }
+
+        public bool Contains(T value)
+        {
+            return _list.ContainsKey(value);
+        }
+
+        public void Add(T value)
+        {
+            //base.Add(value, 0);
+        }
+
+        #region ISet<T> Implementation
+
+        bool ISet<T>.Add(T item)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ISet<T>.ExceptWith(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ISet<T>.IntersectWith(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.IsProperSubsetOf(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.IsProperSupersetOf(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.IsSubsetOf(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.IsSupersetOf(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.Overlaps(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ISet<T>.SetEquals(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ISet<T>.SymmetricExceptWith(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ISet<T>.UnionWith(IEnumerable<T> other)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ICollection<T>.Add(T item)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ICollection<T>.Clear()
+        {
+            throw new NotImplementedException();
+        }
+
+        bool ICollection<T>.Contains(T item)
+        {
+            throw new NotImplementedException();
+        }
+
+        void ICollection<T>.CopyTo(T[] array, int arrayIndex)
+        {
+            throw new NotImplementedException();
+        }
+
+        int ICollection<T>.Count
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        bool ICollection<T>.IsReadOnly
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        bool ICollection<T>.Remove(T item)
+        {
+            throw new NotImplementedException();
+        }
+
+        IEnumerator<T> IEnumerable<T>.GetEnumerator()
+        {
+            throw new NotImplementedException();
+        }
+
+        #endregion
+
+        #region ICollection Implementation
+
+        void ICollection.CopyTo(Array array, int index)
+        {
+            throw new NotImplementedException();
+        }
+
+        int ICollection.Count
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        bool ICollection.IsSynchronized
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        object ICollection.SyncRoot
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            throw new NotImplementedException();
+        }
+
+        #endregion
+
+        #region ISerializable Implementation
+
+        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
+        {
+            throw new NotImplementedException();
+        }
+
+        #endregion
+
+        #region IDeserializationCallback Implementation
+
+        void IDeserializationCallback.OnDeserialization(object sender)
+        {
+            throw new NotImplementedException();
+        }
+
+        #endregion
+
+    }
+}
+
+#endif

Added: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ThreadLocal.cs?rev=1353077&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ThreadLocal.cs
(added)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/ThreadLocal.cs
Sat Jun 23 06:39:43 2012
@@ -0,0 +1,56 @@
+/* 
+ * 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.
+ */
+
+#if NET35
+
+using System;
+
+namespace Lucene.Net.Support.Compatibility
+{
+
+    public class ThreadLocal<T> : IDisposable
+    {
+        [ThreadStatic]
+        static WeakDictionary<ThreadLocal<T>, T> slots;
+
+        static void Init()
+        {
+            if (slots == null) slots = new WeakDictionary<ThreadLocal<T>, T>();
+        }
+
+        public T Value
+        {
+            set
+            {
+                Init();
+                slots.Add(this, value);
+            }
+            get
+            {
+                Init();
+                return (T)slots[this];
+            }
+        }
+
+        public void Dispose()
+        {
+            if (slots != null) slots.Remove(this);
+        }
+    }
+}
+
+#endif

Added: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/WrappedHashSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/WrappedHashSet.cs?rev=1353077&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/WrappedHashSet.cs
(added)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Support/Compatibility/WrappedHashSet.cs
Sat Jun 23 06:39:43 2012
@@ -0,0 +1,30 @@
+/* 
+ * 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.
+ */
+
+#if NET35
+
+using System.Collections.Generic;
+
+namespace Lucene.Net.Support.Compatibility
+{
+    class WrappedHashSet<T> : HashSet<T>, ISet<T>
+    {
+
+    }
+}
+
+#endif
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Util/CloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Util/CloseableThreadLocal.cs?rev=1353077&r1=1353076&r2=1353077&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Util/CloseableThreadLocal.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_3_5/src/core/Util/CloseableThreadLocal.cs Sat
Jun 23 06:39:43 2012
@@ -166,36 +166,4 @@ namespace Lucene.Net.Util
         }
     }
 
-    //// {{DIGY}}
-    //// To compile against Framework 2.0
-    //// Uncomment below class
-    //public class ThreadLocal<T> : IDisposable
-    //{
-    //    [ThreadStatic]
-    //    static SupportClass.WeakHashTable slots;
-
-    //    void Init()
-    //    {
-    //        if (slots == null) slots = new SupportClass.WeakHashTable();
-    //    }
-
-    //    public T Value
-    //    {
-    //        set
-    //        {
-    //            Init();
-    //            slots.Add(this, value);
-    //        }
-    //        get
-    //        {
-    //            Init();
-    //            return (T)slots[this];
-    //        }
-    //    }
-
-    //    public void Dispose()
-    //    {
-    //        if (slots != null) slots.Remove(this);
-    //    }
-    //}
 }



Mime
View raw message