You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by cc...@apache.org on 2011/11/12 11:44:27 UTC
[Lucene.Net] svn commit: r1201243 [7/8] - in
/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk: src/core/
src/core/Analysis/ src/core/Analysis/Standard/
src/core/Analysis/Tokenattributes/ src/core/Document/ src/core/Index/
src/core/QueryParser/ src/core/Search/...
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitUtil.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitUtil.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitUtil.cs Sat Nov 12 10:44:21 2011
@@ -16,6 +16,7 @@
*/
using System;
+using Lucene.Net.Support;
namespace Lucene.Net.Util
{
@@ -46,12 +47,12 @@ namespace Lucene.Net.Util
***/
// 64 bit java version of the C function from above
- x = x - ((SupportClass.Number.URShift(x, 1)) & 0x5555555555555555L);
- x = (x & 0x3333333333333333L) + ((SupportClass.Number.URShift(x, 2)) & 0x3333333333333333L);
- x = (x + (SupportClass.Number.URShift(x, 4))) & 0x0F0F0F0F0F0F0F0FL;
- x = x + (SupportClass.Number.URShift(x, 8));
- x = x + (SupportClass.Number.URShift(x, 16));
- x = x + (SupportClass.Number.URShift(x, 32));
+ x = x - ((Number.URShift(x, 1)) & 0x5555555555555555L);
+ x = (x & 0x3333333333333333L) + ((Number.URShift(x, 2)) & 0x3333333333333333L);
+ x = (x + (Number.URShift(x, 4))) & 0x0F0F0F0F0F0F0F0FL;
+ x = x + (Number.URShift(x, 8));
+ x = x + (Number.URShift(x, 16));
+ x = x + (Number.URShift(x, 32));
return ((int) x) & 0x7F;
}
@@ -726,15 +727,15 @@ namespace Lucene.Net.Util
if (lower != 0)
{
- lowByte = (SupportClass.Number.URShift(lower, 8)) & 0xff;
+ lowByte = (Number.URShift(lower, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 8;
- lowByte = (SupportClass.Number.URShift(lower, 16)) & 0xff;
+ lowByte = (Number.URShift(lower, 16)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 16;
// no need to mask off low byte for the last byte in the 32 bit word
// no need to check for zero on the last byte either.
- return ntzTable[SupportClass.Number.URShift(lower, 24)] + 24;
+ return ntzTable[Number.URShift(lower, 24)] + 24;
}
else
{
@@ -743,15 +744,15 @@ namespace Lucene.Net.Util
lowByte = upper & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 32;
- lowByte = (SupportClass.Number.URShift(upper, 8)) & 0xff;
+ lowByte = (Number.URShift(upper, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 40;
- lowByte = (SupportClass.Number.URShift(upper, 16)) & 0xff;
+ lowByte = (Number.URShift(upper, 16)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 48;
// no need to mask off low byte for the last byte in the 32 bit word
// no need to check for zero on the last byte either.
- return ntzTable[SupportClass.Number.URShift(upper, 24)] + 56;
+ return ntzTable[Number.URShift(upper, 24)] + 56;
}
}
@@ -765,15 +766,15 @@ namespace Lucene.Net.Util
int lowByte = val & 0xff;
if (lowByte != 0)
return ntzTable[lowByte];
- lowByte = (SupportClass.Number.URShift(val, 8)) & 0xff;
+ lowByte = (Number.URShift(val, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 8;
- lowByte = (SupportClass.Number.URShift(val, 16)) & 0xff;
+ lowByte = (Number.URShift(val, 16)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 16;
// no need to mask off low byte for the last byte.
// no need to check for zero on the last byte either.
- return ntzTable[SupportClass.Number.URShift(val, 24)] + 24;
+ return ntzTable[Number.URShift(val, 24)] + 24;
}
/// <summary>returns 0 based index of first set bit
@@ -786,15 +787,15 @@ namespace Lucene.Net.Util
int y = (int) x;
if (y == 0)
{
- n += 32; y = (int) (SupportClass.Number.URShift(x, 32));
+ n += 32; y = (int) (Number.URShift(x, 32));
} // the only 64 bit shift necessary
if ((y & 0x0000FFFF) == 0)
{
- n += 16; y = SupportClass.Number.URShift(y, 16);
+ n += 16; y = Number.URShift(y, 16);
}
if ((y & 0x000000FF) == 0)
{
- n += 8; y = SupportClass.Number.URShift(y, 8);
+ n += 8; y = Number.URShift(y, 8);
}
return (ntzTable[y & 0xff]) + n;
}
@@ -813,23 +814,23 @@ namespace Lucene.Net.Util
int y = (int) x;
if (y == 0)
{
- n += 32; y = (int) (SupportClass.Number.URShift(x, 32));
+ n += 32; y = (int) (Number.URShift(x, 32));
}
if ((y & 0x0000FFFF) == 0)
{
- n += 16; y = SupportClass.Number.URShift(y, 16);
+ n += 16; y = Number.URShift(y, 16);
}
if ((y & 0x000000FF) == 0)
{
- n += 8; y = SupportClass.Number.URShift(y, 8);
+ n += 8; y = Number.URShift(y, 8);
}
if ((y & 0x0000000F) == 0)
{
- n += 4; y = SupportClass.Number.URShift(y, 4);
+ n += 4; y = Number.URShift(y, 4);
}
if ((y & 0x00000003) == 0)
{
- n += 2; y = SupportClass.Number.URShift(y, 2);
+ n += 2; y = Number.URShift(y, 2);
}
return n - (y & 1);
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitVector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitVector.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitVector.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/BitVector.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using Directory = Lucene.Net.Store.Directory;
using IndexInput = Lucene.Net.Store.IndexInput;
using IndexOutput = Lucene.Net.Store.IndexOutput;
@@ -298,13 +298,13 @@ namespace Lucene.Net.Util
// Special case -- return empty vector is start == end
if (end == start)
return new BitVector(0);
- byte[] bits = new byte[(SupportClass.Number.URShift((end - start - 1), 3)) + 1];
- int s = SupportClass.Number.URShift(start, 3);
+ byte[] bits = new byte[(Number.URShift((end - start - 1), 3)) + 1];
+ int s = Number.URShift(start, 3);
for (int i = 0; i < bits.Length; i++)
{
int cur = 0xFF & this.bits[i + s];
int next = i + s + 1 >= this.bits.Length?0:0xFF & this.bits[i + s + 1];
- bits[i] = (byte) ((SupportClass.Number.URShift(cur, (start & 7))) | ((next << (8 - (start & 7)))));
+ bits[i] = (byte) ((Number.URShift(cur, (start & 7))) | ((next << (8 - (start & 7)))));
}
int bitsToClear = (bits.Length * 8 - (end - start)) % 8;
bits[bits.Length - 1] &= (byte) (~ (0xFF << (8 - bitsToClear)));
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs Sat Nov 12 10:44:21 2011
@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
+using Lucene.Net.Support;
namespace Lucene.Net.Util
{
@@ -80,11 +81,11 @@ namespace Lucene.Net.Util
public virtual void Set(T @object)
{
//+-- For Debuging
- if (SupportClass.CloseableThreadLocalProfiler.EnableCloseableThreadLocalProfiler == true)
+ if (CloseableThreadLocalProfiler.EnableCloseableThreadLocalProfiler == true)
{
- lock (SupportClass.CloseableThreadLocalProfiler.Instances)
+ lock (CloseableThreadLocalProfiler.Instances)
{
- SupportClass.CloseableThreadLocalProfiler.Instances.Add(new WeakReference(@object));
+ CloseableThreadLocalProfiler.Instances.Add(new WeakReference(@object));
}
}
//+--
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/Constants.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/Constants.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/Constants.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/Constants.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using LucenePackage = Lucene.Net.LucenePackage;
namespace Lucene.Net.Util
@@ -30,7 +30,7 @@ namespace Lucene.Net.Util
} // can't construct
/// <summary>The value of <tt>System.getProperty("java.version")</tt>. *</summary>
- public static readonly System.String JAVA_VERSION = SupportClass.AppSettings.Get("java.version", "");
+ public static readonly System.String JAVA_VERSION = AppSettings.Get("java.version", "");
/// <summary>True iff this is Java version 1.1. </summary>
public static readonly bool JAVA_1_1 = JAVA_VERSION.StartsWith("1.1.");
/// <summary>True iff this is Java version 1.2. </summary>
@@ -49,7 +49,7 @@ namespace Lucene.Net.Util
public static readonly System.String OS_ARCH = GetEnvironmentVariable("PROCESSOR_ARCHITECTURE","x86");
public static readonly System.String OS_VERSION = GetEnvironmentVariable("OS_VERSION", "?");
- public static readonly System.String JAVA_VENDOR = SupportClass.AppSettings.Get("java.vendor", "");
+ public static readonly System.String JAVA_VENDOR = AppSettings.Get("java.vendor", "");
// NOTE: this logic may not be correct; if you know of a
// more reliable approach please raise it on java-dev!
@@ -63,7 +63,7 @@ namespace Lucene.Net.Util
return s.ToString();
}
- public static readonly System.String LUCENE_MAIN_VERSION = Ident("2.9.4");
+ public static readonly System.String LUCENE_MAIN_VERSION = Ident("3.0.3");
public static System.String LUCENE_VERSION="8.8.8.8";
static Constants()
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/DocIdBitSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/DocIdBitSet.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/DocIdBitSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/DocIdBitSet.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using DocIdSet = Lucene.Net.Search.DocIdSet;
using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
@@ -68,7 +68,7 @@ namespace Lucene.Net.Util
public override int NextDoc()
{
// (docId + 1) on next line requires -1 initial value for docNr:
- int d = SupportClass.BitSetSupport.NextSetBit(bitSet, docId + 1);
+ int d = BitSetSupport.NextSetBit(bitSet, docId + 1);
// -1 returned by BitSet.nextSetBit() when exhausted
docId = d == - 1?NO_MORE_DOCS:d;
return docId;
@@ -76,7 +76,7 @@ namespace Lucene.Net.Util
public override int Advance(int target)
{
- int d = SupportClass.BitSetSupport.NextSetBit(bitSet, target);
+ int d = BitSetSupport.NextSetBit(bitSet, target);
// -1 returned by BitSet.nextSetBit() when exhausted
docId = d == - 1?NO_MORE_DOCS:d;
return docId;
Added: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IdentityDictionary.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IdentityDictionary.cs?rev=1201243&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IdentityDictionary.cs (added)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IdentityDictionary.cs Sat Nov 12 10:44:21 2011
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace Lucene.Net.Util
+{
+ /// <summary>
+ /// A class that mimics Java's IdentityHashMap in that it determines
+ /// object equality solely on ReferenceEquals rather than (possibly overloaded)
+ /// object.Equals().
+ ///
+ /// NOTE: Java's documentation on IdentityHashMap says that it also uses
+ /// ReferenceEquals on it's Values as well. This class does not follow this behavior
+ /// </summary>
+ /// <typeparam name="TKey">The type of the keys in the dictionary</typeparam>
+ /// <typeparam name="TValue">The type of the values in the dictionary</typeparam>
+ public class IdentityDictionary<TKey, TValue> : Dictionary<TKey, TValue>
+ {
+ public IdentityDictionary(IDictionary<TKey, TValue> other) : base(other, new IdentityComparer())
+ { }
+
+ public IdentityDictionary(int capacity) : base(capacity, new IdentityComparer())
+ { }
+
+ public IdentityDictionary() : this(16)
+ { }
+
+ class IdentityComparer : IEqualityComparer<TKey>
+ {
+ public bool Equals(TKey x, TKey y)
+ {
+ return ReferenceEquals(x, y);
+ }
+
+ public int GetHashCode(TKey obj)
+ {
+ return obj.GetHashCode();
+ }
+ }
+ }
+}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IndexableBinaryStringTools.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IndexableBinaryStringTools.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IndexableBinaryStringTools.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/IndexableBinaryStringTools.cs Sat Nov 12 10:44:21 2011
@@ -16,6 +16,7 @@
*/
using System;
+using Lucene.Net.Support;
// {{Aroush-2.9}} Port issue? Both of those were treated as: System.IO.MemoryStream
//using CharBuffer = java.nio.CharBuffer;
@@ -138,12 +139,12 @@ namespace Lucene.Net.Util
codingCase = CODING_CASES[caseNum];
if (2 == codingCase.numBytes)
{
- output[outputCharNum] = (char)(((input[inputByteNum] & 0xFF) << codingCase.initialShift) + ((SupportClass.Number.URShift((input[inputByteNum + 1] & 0xFF), codingCase.finalShift)) & codingCase.finalMask) & (short)0x7FFF);
+ output[outputCharNum] = (char)(((input[inputByteNum] & 0xFF) << codingCase.initialShift) + ((Number.URShift((input[inputByteNum + 1] & 0xFF), codingCase.finalShift)) & codingCase.finalMask) & (short)0x7FFF);
}
else
{
// numBytes is 3
- output[outputCharNum] = (char)(((input[inputByteNum] & 0xFF) << codingCase.initialShift) + ((input[inputByteNum + 1] & 0xFF) << codingCase.middleShift) + ((SupportClass.Number.URShift((input[inputByteNum + 2] & 0xFF), codingCase.finalShift)) & codingCase.finalMask) & (short)0x7FFF);
+ output[outputCharNum] = (char)(((input[inputByteNum] & 0xFF) << codingCase.initialShift) + ((input[inputByteNum + 1] & 0xFF) << codingCase.middleShift) + ((Number.URShift((input[inputByteNum + 2] & 0xFF), codingCase.finalShift)) & codingCase.finalMask) & (short)0x7FFF);
}
inputByteNum += codingCase.advanceBytes;
if (++caseNum == CODING_CASES.Length)
@@ -221,19 +222,19 @@ namespace Lucene.Net.Util
{
if (0 == caseNum)
{
- output[outputByteNum] = (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift));
+ output[outputByteNum] = (byte) (Number.URShift(inputChar, codingCase.initialShift));
}
else
{
- output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift)));
+ output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (Number.URShift(inputChar, codingCase.initialShift)));
}
output[outputByteNum + 1] = (byte) ((inputChar & codingCase.finalMask) << codingCase.finalShift);
}
else
{
// numBytes is 3
- output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift)));
- output[outputByteNum + 1] = (byte) (SupportClass.Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
+ output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (Number.URShift(inputChar, codingCase.initialShift)));
+ output[outputByteNum + 1] = (byte) (Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
output[outputByteNum + 2] = (byte) ((inputChar & codingCase.finalMask) << codingCase.finalShift);
}
outputByteNum += codingCase.advanceBytes;
@@ -249,18 +250,18 @@ namespace Lucene.Net.Util
{
output[outputByteNum] = 0;
}
- output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift)));
+ output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (Number.URShift(inputChar, codingCase.initialShift)));
long bytesLeft = numOutputBytes - outputByteNum;
if (bytesLeft > 1)
{
if (2 == codingCase.numBytes)
{
- output[outputByteNum + 1] = (byte) (SupportClass.Number.URShift((inputChar & codingCase.finalMask), codingCase.finalShift));
+ output[outputByteNum + 1] = (byte) (Number.URShift((inputChar & codingCase.finalMask), codingCase.finalShift));
}
else
{
// numBytes is 3
- output[outputByteNum + 1] = (byte) (SupportClass.Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
+ output[outputByteNum + 1] = (byte) (Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
if (bytesLeft > 2)
{
output[outputByteNum + 2] = (byte) ((inputChar & codingCase.finalMask) << codingCase.finalShift);
@@ -321,7 +322,7 @@ namespace Lucene.Net.Util
this.initialShift = initialShift;
this.middleShift = middleShift;
this.finalShift = finalShift;
- this.finalMask = (short) (SupportClass.Number.URShift((short) 0xFF, finalShift));
+ this.finalMask = (short) (Number.URShift((short) 0xFF, finalShift));
this.middleMask = (short) ((short) 0xFF << middleShift);
}
@@ -330,7 +331,7 @@ namespace Lucene.Net.Util
this.numBytes = 2;
this.initialShift = initialShift;
this.finalShift = finalShift;
- this.finalMask = (short) (SupportClass.Number.URShift((short) 0xFF, finalShift));
+ this.finalMask = (short) (Number.URShift((short) 0xFF, finalShift));
if (finalShift != 0)
{
advanceBytes = 1;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/NumericUtils.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/NumericUtils.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/NumericUtils.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/NumericUtils.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NumericTokenStream = Lucene.Net.Analysis.NumericTokenStream;
using NumericField = Lucene.Net.Documents.NumericField;
using NumericRangeFilter = Lucene.Net.Search.NumericRangeFilter;
@@ -173,14 +173,14 @@ namespace Lucene.Net.Util
int nChars = (31 - shift) / 7 + 1, len = nChars + 1;
buffer[0] = (char) (SHIFT_START_INT + shift);
int sortableBits = val ^ unchecked((int) 0x80000000);
- sortableBits = SupportClass.Number.URShift(sortableBits, shift);
+ sortableBits = Number.URShift(sortableBits, shift);
while (nChars >= 1)
{
// Store 7 bits per character for good efficiency when UTF-8 encoding.
// The whole number is right-justified so that lucene can prefix-encode
// the terms more efficiently.
buffer[nChars--] = (char) (sortableBits & 0x7f);
- sortableBits = SupportClass.Number.URShift(sortableBits, 7);
+ sortableBits = Number.URShift(sortableBits, 7);
}
return len;
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/OpenBitSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/OpenBitSet.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/OpenBitSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/OpenBitSet.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using DocIdSet = Lucene.Net.Search.DocIdSet;
using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
@@ -942,7 +942,7 @@ namespace Lucene.Net.Util
for (int i = bits.Length; --i >= 0; )
{
h ^= bits[i];
- h = (h << 1) | (SupportClass.Number.URShift(h, 63)); // rotate left
+ h = (h << 1) | (Number.URShift(h, 63)); // rotate left
}
// fold leftmost bits into right and add a constant to prevent
// empty sets from returning 0, which is too common.
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/PriorityQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/PriorityQueue.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/PriorityQueue.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/PriorityQueue.cs Sat Nov 12 10:44:21 2011
@@ -16,6 +16,7 @@
*/
using System;
+using Lucene.Net.Support;
namespace Lucene.Net.Util
{
@@ -240,12 +241,12 @@ namespace Lucene.Net.Util
{
int i = size;
T node = heap[i]; // save bottom node
- int j = SupportClass.Number.URShift(i, 1);
+ int j = Number.URShift(i, 1);
while (j > 0 && LessThan(node, heap[j]))
{
heap[i] = heap[j]; // shift parents down
i = j;
- j = SupportClass.Number.URShift(j, 1);
+ j = Number.URShift(j, 1);
}
heap[i] = node; // install saved node
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/RamUsageEstimator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/RamUsageEstimator.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/RamUsageEstimator.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/RamUsageEstimator.cs Sat Nov 12 10:44:21 2011
@@ -16,6 +16,7 @@
*/
using System;
+using System.Collections.Generic;
namespace Lucene.Net.Util
{
@@ -36,7 +37,7 @@ namespace Lucene.Net.Util
{
private MemoryModel memoryModel;
- private System.Collections.IDictionary seen;
+ private IDictionary<object, object> seen;
private int refSize;
private int arraySize;
@@ -79,7 +80,7 @@ namespace Lucene.Net.Util
this.checkInterned = checkInterned;
// Use Map rather than Set so that we can use an IdentityHashMap - not
// seeing an IdentityHashSet
- seen = new System.Collections.Hashtable(64); // {{Aroush-2.9}} Port issue; need to mimic java's IdentityHashMap equals() through C#'s Equals()
+ seen = new IdentityDictionary<object, object>(64);
this.refSize = memoryModel.GetReferenceSize();
this.arraySize = memoryModel.GetArraySize();
this.classSize = memoryModel.GetClassSize();
@@ -108,7 +109,7 @@ namespace Lucene.Net.Util
}
// skip if we have seen before
- if (seen.Contains(obj))
+ if (seen.ContainsKey(obj))
{
return 0;
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ReaderUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ReaderUtil.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ReaderUtil.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ReaderUtil.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using IndexReader = Lucene.Net.Index.IndexReader;
namespace Lucene.Net.Util
@@ -29,7 +29,7 @@ namespace Lucene.Net.Util
/// <summary>Gathers sub-readers from reader into a List.</summary>
/// <param name="allSubReaders"></param>
/// <param name="reader"></param>
- public static void GatherSubReaders(System.Collections.Generic.List<IndexReader> allSubReaders, IndexReader reader)
+ public static void GatherSubReaders(System.Collections.Generic.IList<IndexReader> allSubReaders, IndexReader reader)
{
IndexReader[] subReaders = reader.GetSequentialSubReaders();
if (subReaders == null)
@@ -100,7 +100,7 @@ namespace Lucene.Net.Util
int hi = size - 1; // for first element less than n, return its index
while (hi >= lo)
{
- int mid = SupportClass.Number.URShift((lo + hi), 1);
+ int mid = Number.URShift((lo + hi), 1);
int midValue = docStarts[mid];
if (n < midValue)
hi = mid - 1;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ScorerDocQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ScorerDocQueue.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ScorerDocQueue.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/ScorerDocQueue.cs Sat Nov 12 10:44:21 2011
@@ -18,7 +18,7 @@
/* Derived from Lucene.Net.Util.PriorityQueue of March 2005 */
using System;
-
+using Lucene.Net.Support;
using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
using Scorer = Lucene.Net.Search.Scorer;
@@ -236,12 +236,12 @@ namespace Lucene.Net.Util
{
int i = size;
HeapedScorerDoc node = heap[i]; // save bottom node
- int j = SupportClass.Number.URShift(i, 1);
+ int j = Number.URShift(i, 1);
while ((j > 0) && (node.doc < heap[j].doc))
{
heap[i] = heap[j]; // shift parents down
i = j;
- j = SupportClass.Number.URShift(j, 1);
+ j = Number.URShift(j, 1);
}
heap[i] = node; // install saved node
topHSD = heap[1];
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/SortedVIntList.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/SortedVIntList.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/SortedVIntList.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/SortedVIntList.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using DocIdSet = Lucene.Net.Search.DocIdSet;
using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
@@ -141,11 +141,11 @@ namespace Lucene.Net.Util
public SortedVIntList(System.Collections.BitArray bits)
{
SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
- int nextInt = SupportClass.BitSetSupport.NextSetBit(bits, 0);
+ int nextInt = BitSetSupport.NextSetBit(bits, 0);
while (nextInt != - 1)
{
builder.AddInt(nextInt);
- nextInt = SupportClass.BitSetSupport.NextSetBit(bits, nextInt + 1);
+ nextInt = BitSetSupport.NextSetBit(bits, nextInt + 1);
}
builder.Done();
}
@@ -226,7 +226,7 @@ namespace Lucene.Net.Util
{
// The high bit of the next byte needs to be set.
Enclosing_Instance.bytes[Enclosing_Instance.lastBytePos++] = (sbyte) ((diff & Lucene.Net.Util.SortedVIntList.VB1) | ~ Lucene.Net.Util.SortedVIntList.VB1);
- diff = SupportClass.Number.URShift(diff, Lucene.Net.Util.SortedVIntList.BIT_SHIFT);
+ diff = Number.URShift(diff, Lucene.Net.Util.SortedVIntList.BIT_SHIFT);
}
Enclosing_Instance.bytes[Enclosing_Instance.lastBytePos++] = (sbyte) diff; // Last byte, high bit not set.
Enclosing_Instance.size++;
Added: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/Demo.Common.csproj.user
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/Demo.Common.csproj.user?rev=1201243&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/Demo.Common.csproj.user (added)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/Demo.Common.csproj.user Sat Nov 12 10:44:21 2011
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectView>ProjectFiles</ProjectView>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/HTMLParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/HTMLParser.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/HTMLParser.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/HTMLParser.cs Sat Nov 12 10:44:21 2011
@@ -18,6 +18,7 @@
/* Generated By:JavaCC: Do not edit this line. HTMLParser.java */
using System;
+using Lucene.Net.Support;
namespace Lucene.Net.Demo.Html
{
@@ -167,7 +168,7 @@ namespace Lucene.Net.Demo.Html
pipeIn = new System.IO.StreamReader(pipeInStream.BaseStream, System.Text.Encoding.GetEncoding("UTF-16BE"));
pipeOut = new System.IO.StreamWriter(pipeOutStream.BaseStream, System.Text.Encoding.GetEncoding("UTF-16BE"));
- SupportClass.ThreadClass thread = new ParserThread(this);
+ ThreadClass thread = new ParserThread(this);
thread.Start(); // start parsing
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParseException.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParseException.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParseException.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParseException.cs Sat Nov 12 10:44:21 2011
@@ -18,6 +18,7 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
using System;
+using Lucene.Net.Support;
namespace Lucene.Net.Demo.Html
{
@@ -161,7 +162,7 @@ namespace Lucene.Net.Demo.Html
public System.String[] tokenImage;
/// <summary> The end of line string for this machine.</summary>
- protected internal System.String eol = SupportClass.AppSettings.Get("line.separator", "\n");
+ protected internal System.String eol = AppSettings.Get("line.separator", "\n");
/// <summary> Used to convert raw characters to their escaped version
/// when these raw version cannot be used as part of an ASCII
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParserThread.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParserThread.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParserThread.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/demo/Demo.Common/HTML/ParserThread.cs Sat Nov 12 10:44:21 2011
@@ -16,11 +16,12 @@
*/
using System;
+using Lucene.Net.Support;
namespace Lucene.Net.Demo.Html
{
- class ParserThread:SupportClass.ThreadClass
+ class ParserThread:ThreadClass
{
internal HTMLParser parser;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestAtomicUpdate.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestAtomicUpdate.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestAtomicUpdate.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestAtomicUpdate.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using Lucene.Net.Analysis;
@@ -68,7 +68,7 @@ namespace Lucene.Net.Index
}
}
- abstract public class TimedThread:SupportClass.ThreadClass
+ abstract public class TimedThread:ThreadClass
{
internal bool failed;
internal int count;
@@ -98,7 +98,7 @@ namespace Lucene.Net.Index
}
catch (System.Exception e)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": exc");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": exc");
System.Console.Out.WriteLine(e.StackTrace);
failed = true;
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestBackwardsCompatibility.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestBackwardsCompatibility.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestBackwardsCompatibility.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestBackwardsCompatibility.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -499,7 +499,7 @@ namespace Lucene.Net.Index
System.String[] actual = dir.ListAll();
System.Array.Sort(expected);
System.Array.Sort(actual);
- if (!SupportClass.CollectionsHelper.Equals(expected, actual))
+ if (!CollectionsHelper.Equals(expected, actual))
{
Assert.Fail("incorrect filenames in index: expected:\n " + AsString(expected) + "\n actual:\n " + AsString(actual));
}
@@ -570,7 +570,7 @@ namespace Lucene.Net.Index
tmpBool = System.IO.Directory.Exists(fileDir.FullName);
if (tmpBool)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(fileDir);
+ System.IO.FileInfo[] files = FileSupport.GetFiles(fileDir);
if (files != null)
{
for (int i = 0; i < files.Length; i++)
@@ -610,7 +610,7 @@ namespace Lucene.Net.Index
public static System.String FullDir(System.String dirName)
{
- return new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), dirName)).FullName;
+ return new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), dirName)).FullName;
}
internal const System.String TEXT_TO_COMPRESS = "this is a compressed field and should appear in 3.0 as an uncompressed field after merge";
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestCompoundFile.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestCompoundFile.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestCompoundFile.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestCompoundFile.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using Directory = Lucene.Net.Store.Directory;
@@ -63,7 +63,7 @@ namespace Lucene.Net.Index
public override void SetUp()
{
base.SetUp();
- System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "testIndex"));
+ System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "testIndex"));
_TestUtil.RmDir(file);
// use a simple FSDir here, to be sure to have SimpleFSInputs
dir = new SimpleFSDirectory(file, null);
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestDoc.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestDoc.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestDoc.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestDoc.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using SimpleAnalyzer = Lucene.Net.Analysis.SimpleAnalyzer;
@@ -59,7 +59,7 @@ namespace Lucene.Net.Index
public override void SetUp()
{
base.SetUp();
- workDir = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "TestDoc"));
+ workDir = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "TestDoc"));
System.IO.Directory.CreateDirectory(workDir.FullName);
indexDir = new System.IO.FileInfo(System.IO.Path.Combine(workDir.FullName, "testIndex"));
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestFieldsReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestFieldsReader.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestFieldsReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestFieldsReader.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -151,15 +151,15 @@ namespace Lucene.Net.Index
Assert.IsTrue(reader != null);
Assert.IsTrue(reader.Size() == 1);
System.Collections.Hashtable loadFieldNames = new System.Collections.Hashtable();
- SupportClass.CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_1_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_UTF1_KEY);
+ CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_1_KEY);
+ CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_UTF1_KEY);
System.Collections.Hashtable lazyFieldNames = new System.Collections.Hashtable();
//new String[]{DocHelper.LARGE_LAZY_FIELD_KEY, DocHelper.LAZY_FIELD_KEY, DocHelper.LAZY_FIELD_BINARY_KEY};
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_BINARY_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.TEXT_FIELD_UTF2_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.COMPRESSED_TEXT_FIELD_2_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_BINARY_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.TEXT_FIELD_UTF2_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.COMPRESSED_TEXT_FIELD_2_KEY);
SetBasedFieldSelector fieldSelector = new SetBasedFieldSelector(loadFieldNames, lazyFieldNames);
Document doc = reader.Doc(0, fieldSelector);
Assert.IsTrue(doc != null, "doc is null and it shouldn't be");
@@ -211,14 +211,14 @@ namespace Lucene.Net.Index
Assert.IsTrue(reader != null);
Assert.IsTrue(reader.Size() == 1);
System.Collections.Hashtable loadFieldNames = new System.Collections.Hashtable();
- SupportClass.CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_1_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_UTF1_KEY);
+ CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_1_KEY);
+ CollectionsHelper.AddIfNotContains(loadFieldNames, DocHelper.TEXT_FIELD_UTF1_KEY);
System.Collections.Hashtable lazyFieldNames = new System.Collections.Hashtable();
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_BINARY_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.TEXT_FIELD_UTF2_KEY);
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.COMPRESSED_TEXT_FIELD_2_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LAZY_FIELD_BINARY_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.TEXT_FIELD_UTF2_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.COMPRESSED_TEXT_FIELD_2_KEY);
SetBasedFieldSelector fieldSelector = new SetBasedFieldSelector(loadFieldNames, lazyFieldNames);
Document doc = reader.Doc(0, fieldSelector);
Assert.IsTrue(doc != null, "doc is null and it shouldn't be");
@@ -270,7 +270,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestLazyPerformance()
{
- System.String tmpIODir = SupportClass.AppSettings.Get("tempDir", "");
+ System.String tmpIODir = AppSettings.Get("tempDir", "");
System.String userName = System.Environment.UserName;
System.String path = tmpIODir + System.IO.Path.DirectorySeparatorChar.ToString() + "lazyDir" + userName;
System.IO.FileInfo file = new System.IO.FileInfo(path);
@@ -289,7 +289,7 @@ namespace Lucene.Net.Index
long regularTime = 0;
int length = 50;
System.Collections.Hashtable lazyFieldNames = new System.Collections.Hashtable();
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
+ CollectionsHelper.AddIfNotContains(lazyFieldNames, DocHelper.LARGE_LAZY_FIELD_KEY);
SetBasedFieldSelector fieldSelector = new SetBasedFieldSelector(new System.Collections.Hashtable(), lazyFieldNames);
for (int i = 0; i < length; i++)
@@ -356,9 +356,9 @@ namespace Lucene.Net.Index
private void AssertSizeEquals(int size, byte[] sizebytes)
{
- Assert.AreEqual((byte) (SupportClass.Number.URShift(size, 24)), sizebytes[0]);
- Assert.AreEqual((byte) (SupportClass.Number.URShift(size, 16)), sizebytes[1]);
- Assert.AreEqual((byte) (SupportClass.Number.URShift(size, 8)), sizebytes[2]);
+ Assert.AreEqual((byte) (Number.URShift(size, 24)), sizebytes[0]);
+ Assert.AreEqual((byte) (Number.URShift(size, 16)), sizebytes[1]);
+ Assert.AreEqual((byte) (Number.URShift(size, 8)), sizebytes[2]);
Assert.AreEqual((byte) size, sizebytes[3]);
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexFileDeleter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexFileDeleter.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexFileDeleter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexFileDeleter.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -164,9 +164,9 @@ namespace Lucene.Net.Index
System.Collections.Hashtable dif = DifFiles(files, files2);
- if (!SupportClass.CollectionsHelper.Equals(files, files2))
+ if (!CollectionsHelper.Equals(files, files2))
{
- Assert.Fail("IndexFileDeleter failed to delete unreferenced extra files: should have deleted " + (filesPre.Length - files.Length) + " files but only deleted " + (filesPre.Length - files2.Length) + "; expected files:\n " + AsString(files) + "\n actual files:\n " + AsString(files2) + "\ndif: " + SupportClass.CollectionsHelper.CollectionToString(dif));
+ Assert.Fail("IndexFileDeleter failed to delete unreferenced extra files: should have deleted " + (filesPre.Length - files.Length) + " files but only deleted " + (filesPre.Length - files2.Length) + "; expected files:\n " + AsString(files) + "\n actual files:\n " + AsString(files2) + "\ndif: " + CollectionsHelper.CollectionToString(dif));
}
}
@@ -177,11 +177,11 @@ namespace Lucene.Net.Index
System.Collections.Hashtable extra = new System.Collections.Hashtable();
for (int x = 0; x < files1.Length; x++)
{
- SupportClass.CollectionsHelper.AddIfNotContains(set1, files1[x]);
+ CollectionsHelper.AddIfNotContains(set1, files1[x]);
}
for (int x = 0; x < files2.Length; x++)
{
- SupportClass.CollectionsHelper.AddIfNotContains(set2, files2[x]);
+ CollectionsHelper.AddIfNotContains(set2, files2[x]);
}
System.Collections.IEnumerator i1 = set1.GetEnumerator();
while (i1.MoveNext())
@@ -189,7 +189,7 @@ namespace Lucene.Net.Index
System.Object o = i1.Current;
if (!set2.Contains(o))
{
- SupportClass.CollectionsHelper.AddIfNotContains(extra, o);
+ CollectionsHelper.AddIfNotContains(extra, o);
}
}
System.Collections.IEnumerator i2 = set2.GetEnumerator();
@@ -198,7 +198,7 @@ namespace Lucene.Net.Index
System.Object o = i2.Current;
if (!set1.Contains(o))
{
- SupportClass.CollectionsHelper.AddIfNotContains(extra, o);
+ CollectionsHelper.AddIfNotContains(extra, o);
}
}
return extra;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexModifier.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexModifier.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexModifier.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexModifier.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using Analyzer = Lucene.Net.Analysis.Analyzer;
@@ -188,7 +188,7 @@ namespace Lucene.Net.Index
private void RmDir(System.IO.FileInfo dir)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(dir);
+ System.IO.FileInfo[] files = FileSupport.GetFiles(dir);
for (int i = 0; i < files.Length; i++)
{
bool tmpBool;
@@ -253,7 +253,7 @@ namespace Lucene.Net.Index
}
}
- class IndexThread:SupportClass.ThreadClass
+ class IndexThread:ThreadClass
{
private const int TEST_SECONDS = 3; // how many seconds to run each test
@@ -330,7 +330,7 @@ namespace Lucene.Net.Index
}
catch (System.Threading.ThreadInterruptedException ie)
{
- SupportClass.ThreadClass.Current().Interrupt();
+ ThreadClass.Current().Interrupt();
throw new System.SystemException("", ie);
}
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReader.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReader.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -156,10 +156,10 @@ namespace Lucene.Net.Index
// set up reader
IndexReader reader = IndexReader.Open(d);
System.Collections.Generic.ICollection<string> fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unstored"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "keyword"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "text"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unindexed"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unstored"));
reader.Close();
// add more documents
writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
@@ -184,57 +184,57 @@ namespace Lucene.Net.Index
reader = IndexReader.Open(d);
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.ALL);
Assert.AreEqual(13, fieldNames.Count); // the following fields
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unstored"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unstored2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvnot"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "termvector"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvposition"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvoffset"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "keyword"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "text"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unindexed"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unstored"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "keyword2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "text2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unindexed2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unstored2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvnot"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "termvector"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvposition"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
// verify that only indexed fields were returned
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.INDEXED);
Assert.AreEqual(11, fieldNames.Count); // 6 original + the 5 termvector fields
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unstored"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "keyword2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "text2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unstored2"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvnot"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "termvector"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvposition"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvoffset"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "keyword"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "text"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unstored"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "keyword2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "text2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unstored2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvnot"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "termvector"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvposition"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
// verify that only unindexed fields were returned
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.UNINDEXED);
Assert.AreEqual(2, fieldNames.Count); // the following fields
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed"));
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "unindexed2"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unindexed"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "unindexed2"));
// verify index term vector fields
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.TERMVECTOR);
Assert.AreEqual(1, fieldNames.Count); // 1 field has term vector only
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "termvector"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "termvector"));
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.TERMVECTOR_WITH_POSITION);
Assert.AreEqual(1, fieldNames.Count); // 4 fields are indexed with term vectors
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvposition"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvposition"));
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.TERMVECTOR_WITH_OFFSET);
Assert.AreEqual(1, fieldNames.Count); // 4 fields are indexed with term vectors
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvoffset"));
fieldNames = reader.GetFieldNames(IndexReader.FieldOption.TERMVECTOR_WITH_POSITION_OFFSET);
Assert.AreEqual(1, fieldNames.Count); // 4 fields are indexed with term vectors
- Assert.IsTrue(SupportClass.CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
+ Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "tvpositionoffset"));
reader.Close();
d.Close();
}
@@ -393,7 +393,7 @@ namespace Lucene.Net.Index
Assert.AreEqual(bin[i], data1[i + b1.GetBinaryOffset()]);
}
System.Collections.Hashtable lazyFields = new System.Collections.Hashtable();
- SupportClass.CollectionsHelper.AddIfNotContains(lazyFields, "bin1");
+ CollectionsHelper.AddIfNotContains(lazyFields, "bin1");
FieldSelector sel = new SetBasedFieldSelector(new System.Collections.Hashtable(), lazyFields);
doc = reader.Document(reader.MaxDoc() - 1, sel);
Fieldable[] fieldables = doc.GetFieldables("bin1");
@@ -557,7 +557,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestWritingNorms()
{
- System.String tempDir = SupportClass.AppSettings.Get("tempDir", "");
+ System.String tempDir = AppSettings.Get("tempDir", "");
if (tempDir == null)
throw new System.IO.IOException("tempDir undefined, cannot run test");
@@ -761,14 +761,14 @@ namespace Lucene.Net.Index
private Directory GetDirectory()
{
- return FSDirectory.Open(new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "testIndex")));
+ return FSDirectory.Open(new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "testIndex")));
}
[Test]
public virtual void TestFilesOpenClose()
{
// Create initial data set
- System.IO.FileInfo dirFile = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "testIndex"));
+ System.IO.FileInfo dirFile = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "testIndex"));
Directory dir = GetDirectory();
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
AddDoc(writer, "test");
@@ -800,7 +800,7 @@ namespace Lucene.Net.Index
public virtual void TestLastModified()
{
Assert.IsFalse(IndexReader.IndexExists("there_is_no_such_index"));
- System.IO.FileInfo fileDir = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "testIndex"));
+ System.IO.FileInfo fileDir = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "testIndex"));
for (int i = 0; i < 2; i++)
{
try
@@ -1111,7 +1111,7 @@ namespace Lucene.Net.Index
// System.out.println(" startFiles: " + i + ": " + startFiles[i]);
//}
- if (!SupportClass.CollectionsHelper.Equals(startFiles, endFiles))
+ if (!CollectionsHelper.Equals(startFiles, endFiles))
{
System.String successStr;
if (success)
@@ -1311,7 +1311,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestOpenReaderAfterDelete()
{
- System.IO.FileInfo dirFile = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "deletetest"));
+ System.IO.FileInfo dirFile = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "deletetest"));
Directory dir = FSDirectory.Open(dirFile);
try
{
@@ -1499,7 +1499,7 @@ namespace Lucene.Net.Index
}
private void RmDir(System.IO.FileInfo dir)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(dir);
+ System.IO.FileInfo[] files = FileSupport.GetFiles(dir);
for (int i = 0; i < files.Length; i++)
{
bool tmpBool;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReaderReopen.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReaderReopen.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReaderReopen.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexReaderReopen.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using KeywordAnalyzer = Lucene.Net.Analysis.KeywordAnalyzer;
@@ -395,8 +395,8 @@ namespace Lucene.Net.Index
{
// refresh reader synchronized
ReaderCouple c = (Enclosing_Instance.RefreshReader(r, test, index, true));
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, c.newReader);
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, c.refreshedReader);
+ CollectionsHelper.AddIfNotContains(readersToClose, c.newReader);
+ CollectionsHelper.AddIfNotContains(readersToClose, c.refreshedReader);
readers.Add(c);
// prevent too many readers
break;
@@ -424,7 +424,7 @@ namespace Lucene.Net.Index
{
refreshed.Close();
}
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, refreshed);
+ CollectionsHelper.AddIfNotContains(readersToClose, refreshed);
}
lock (this)
{
@@ -1107,7 +1107,7 @@ namespace Lucene.Net.Index
IndexReader refreshed = reader.Reopen();
if (refreshed != reader)
{
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, reader);
+ CollectionsHelper.AddIfNotContains(readersToClose, reader);
}
reader = refreshed;
}
@@ -1200,7 +1200,7 @@ namespace Lucene.Net.Index
public abstract void Run();
}
- private class ReaderThread:SupportClass.ThreadClass
+ private class ReaderThread:ThreadClass
{
private ReaderThreadTask task;
internal /*private*/ System.Exception error;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using Analyzer = Lucene.Net.Analysis.Analyzer;
@@ -204,7 +204,7 @@ namespace Lucene.Net.Index
return new CrashingFilter(this.enclosingInstance, fieldName, new WhitespaceTokenizer(reader));
}
}
- private class AnonymousClassThread : SupportClass.ThreadClass
+ private class AnonymousClassThread : ThreadClass
{
public AnonymousClassThread(int NUM_ITER, IndexWriter writer, int finalI, TestIndexWriter enclosingInstance)
{
@@ -263,14 +263,14 @@ namespace Lucene.Net.Index
{
lock (this)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": ERROR: hit unexpected exception");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": ERROR: hit unexpected exception");
System.Console.Out.WriteLine(t.StackTrace);
}
Assert.Fail();
}
}
}
- private class AnonymousClassThread1 : SupportClass.ThreadClass
+ private class AnonymousClassThread1 : ThreadClass
{
public AnonymousClassThread1(IndexWriter finalWriter, Document doc, System.Collections.ArrayList failure, TestIndexWriter enclosingInstance)
{
@@ -995,7 +995,7 @@ namespace Lucene.Net.Index
System.Array.Sort(startFiles);
System.Array.Sort(endFiles);
- if (!SupportClass.CollectionsHelper.Equals(startFiles, endFiles))
+ if (!CollectionsHelper.Equals(startFiles, endFiles))
{
Assert.Fail(message + ": before delete:\n " + ArrayToString(startFiles) + "\n after delete:\n " + ArrayToString(endFiles));
}
@@ -1009,7 +1009,7 @@ namespace Lucene.Net.Index
IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
char[] chars = new char[DocumentsWriter.CHAR_BLOCK_SIZE_ForNUnit - 1];
- SupportClass.CollectionsHelper.Fill(chars, 'x');
+ CollectionsHelper.Fill(chars, 'x');
Document doc = new Document();
System.String bigTerm = new System.String(chars);
@@ -2233,7 +2233,7 @@ namespace Lucene.Net.Index
private void RmDir(System.IO.FileInfo dir)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(dir);
+ System.IO.FileInfo[] files = FileSupport.GetFiles(dir);
if (files != null)
{
for (int i = 0; i < files.Length; i++)
@@ -2348,7 +2348,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestMaxThreadPriority()
{
- int pri = (System.Int32)SupportClass.ThreadClass.Current().Priority;
+ int pri = (System.Int32)ThreadClass.Current().Priority;
try
{
MockRAMDirectory dir = new MockRAMDirectory();
@@ -2357,14 +2357,14 @@ namespace Lucene.Net.Index
document.Add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.YES));
iw.SetMaxBufferedDocs(2);
iw.SetMergeFactor(2);
- SupportClass.ThreadClass.Current().Priority = (System.Threading.ThreadPriority)System.Threading.ThreadPriority.Highest;
+ ThreadClass.Current().Priority = (System.Threading.ThreadPriority)System.Threading.ThreadPriority.Highest;
for (int i = 0; i < 4; i++)
iw.AddDocument(document);
iw.Close();
}
finally
{
- SupportClass.ThreadClass.Current().Priority = (System.Threading.ThreadPriority)pri;
+ ThreadClass.Current().Priority = (System.Threading.ThreadPriority)pri;
}
}
@@ -2693,7 +2693,7 @@ namespace Lucene.Net.Index
int finalI = i;
- SupportClass.ThreadClass[] threads = new SupportClass.ThreadClass[NUM_THREAD];
+ ThreadClass[] threads = new ThreadClass[NUM_THREAD];
for (int t = 0; t < NUM_THREAD; t++)
{
threads[t] = new AnonymousClassThread(NUM_ITER, writer, finalI, this);
@@ -2855,7 +2855,7 @@ namespace Lucene.Net.Index
IndexWriter finalWriter = writer;
System.Collections.ArrayList failure = new System.Collections.ArrayList();
- SupportClass.ThreadClass t1 = new AnonymousClassThread1(finalWriter, doc, failure, this);
+ ThreadClass t1 = new AnonymousClassThread1(finalWriter, doc, failure, this);
if (failure.Count > 0)
{
@@ -2881,7 +2881,7 @@ namespace Lucene.Net.Index
}
// Used by test cases below
- private class IndexerThread : SupportClass.ThreadClass
+ private class IndexerThread : ThreadClass
{
private void InitBlock(TestIndexWriter enclosingInstance)
{
@@ -2941,7 +2941,7 @@ namespace Lucene.Net.Index
}
catch (System.Threading.ThreadInterruptedException ie)
{
- SupportClass.ThreadClass.Current().Interrupt();
+ ThreadClass.Current().Interrupt();
throw new System.SystemException("", ie);
}
if (fullCount++ >= 5)
@@ -2951,7 +2951,7 @@ namespace Lucene.Net.Index
{
if (noErrors)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": ERROR: unexpected IOException:");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": ERROR: unexpected IOException:");
System.Console.Out.WriteLine(ioe.StackTrace);
error = ioe;
}
@@ -2963,7 +2963,7 @@ namespace Lucene.Net.Index
//t.printStackTrace(System.out);
if (noErrors)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": ERROR: unexpected Throwable:");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": ERROR: unexpected Throwable:");
System.Console.Out.WriteLine(t.StackTrace);
error = t;
}
@@ -3900,7 +3900,7 @@ namespace Lucene.Net.Index
{
w.AddDocument(doc);
- if (SupportClass.BuildType.Debug)
+ if (BuildType.Debug)
Assert.Fail("did not hit exception");
else
Assert.Ignore("This test is not executed in release mode");
@@ -4002,7 +4002,7 @@ namespace Lucene.Net.Index
}
((ConcurrentMergeScheduler)w.GetMergeScheduler()).Sync();
- if (SupportClass.BuildType.Debug)
+ if (BuildType.Debug)
Assert.IsTrue(w.failed);
else
Assert.Ignore("This test is not executed in release mode");
@@ -4532,7 +4532,7 @@ namespace Lucene.Net.Index
private abstract class RunAddIndexesThreads
{
- private class AnonymousClassThread2 : SupportClass.ThreadClass
+ private class AnonymousClassThread2 : ThreadClass
{
public AnonymousClassThread2(int numIter, RunAddIndexesThreads enclosingInstance)
{
@@ -4580,7 +4580,7 @@ namespace Lucene.Net.Index
}
private void InitBlock()
{
- threads = new SupportClass.ThreadClass[NUM_THREADS];
+ threads = new ThreadClass[NUM_THREADS];
}
internal Directory dir, dir2;
@@ -4591,7 +4591,7 @@ namespace Lucene.Net.Index
internal IndexReader[] readers;
internal int NUM_COPY;
internal const int NUM_THREADS = 5;
- internal SupportClass.ThreadClass[] threads;
+ internal ThreadClass[] threads;
internal ConcurrentMergeScheduler cms;
public RunAddIndexesThreads(int numCopy)
@@ -4615,7 +4615,7 @@ namespace Lucene.Net.Index
internal virtual void LaunchThreads(int numIter)
{
- threads = new SupportClass.ThreadClass[NUM_THREADS]; //{{DIGY}} Should this be created somewhere else?
+ threads = new ThreadClass[NUM_THREADS]; //{{DIGY}} Should this be created somewhere else?
for (int i = 0; i < NUM_THREADS; i++)
{
threads[i] = new AnonymousClassThread2(numIter, this);
@@ -4956,7 +4956,7 @@ namespace Lucene.Net.Index
try
{
w.Rollback();
- if (SupportClass.BuildType.Debug)
+ if (BuildType.Debug)
Assert.Fail("did not hit intentional RuntimeException");
else
Assert.Ignore("This test is not executed in release mode");
@@ -5008,7 +5008,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestMergeCompressedFields()
{
- System.IO.FileInfo indexDir = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "mergecompressedfields"));
+ System.IO.FileInfo indexDir = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "mergecompressedfields"));
Directory dir = FSDirectory.Open(indexDir);
try
{
@@ -5416,7 +5416,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestOtherFiles()
{
- System.IO.FileInfo indexDir = new System.IO.FileInfo(System.IO.Path.Combine(SupportClass.AppSettings.Get("tempDir", ""), "otherfiles"));
+ System.IO.FileInfo indexDir = new System.IO.FileInfo(System.IO.Path.Combine(AppSettings.Get("tempDir", ""), "otherfiles"));
Directory dir = FSDirectory.Open(indexDir);
try
{
@@ -5476,7 +5476,7 @@ namespace Lucene.Net.Index
dir.Close();
}
- private class IndexerThreadInterrupt : SupportClass.ThreadClass
+ private class IndexerThreadInterrupt : ThreadClass
{
public IndexerThreadInterrupt(TestIndexWriter enclosingInstance)
{
@@ -5766,7 +5766,7 @@ namespace Lucene.Net.Index
dir.Close();
}
- class LUCENE_2095_Thread : SupportClass.ThreadClass
+ class LUCENE_2095_Thread : ThreadClass
{
IndexWriter w = null;
Directory dir = null;
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterDelete.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterDelete.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterDelete.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterDelete.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -922,7 +922,7 @@ namespace Lucene.Net.Index
new IndexFileDeleter(dir, new KeepOnlyLastCommitDeletionPolicy(), infos, null, null,null);
System.String[] endFiles = dir.ListAll();
- if (!SupportClass.CollectionsHelper.CompareStringArrays(startFiles, endFiles))
+ if (!CollectionsHelper.CompareStringArrays(startFiles, endFiles))
{
Assert.Fail("docswriter abort() failed to delete unreferenced files:\n before delete:\n " + ArrayToString(startFiles) + "\n after delete:\n " + ArrayToString(endFiles));
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterExceptions.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterExceptions.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterExceptions.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterExceptions.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using Analyzer = Lucene.Net.Analysis.Analyzer;
@@ -48,7 +48,7 @@ namespace Lucene.Net.Index
return tvSettings[random.Next(tvSettings.Length)];
}
- private class IndexerThread:SupportClass.ThreadClass
+ private class IndexerThread:ThreadClass
{
private void InitBlock(TestIndexWriterExceptions enclosingInstance)
{
@@ -110,7 +110,7 @@ namespace Lucene.Net.Index
{
if (Lucene.Net.Index.TestIndexWriterExceptions.DEBUG)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.CurrentThread().Name + ": EXC: ");
+ System.Console.Out.WriteLine(ThreadClass.CurrentThread().Name + ": EXC: ");
System.Console.Out.WriteLine(re.StackTrace);
}
try
@@ -119,7 +119,7 @@ namespace Lucene.Net.Index
}
catch (System.IO.IOException ioe)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": unexpected exception1");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": unexpected exception1");
System.Console.Out.WriteLine(ioe.StackTrace);
failure = ioe;
break;
@@ -127,7 +127,7 @@ namespace Lucene.Net.Index
}
catch (System.Exception t)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": unexpected exception2");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": unexpected exception2");
System.Console.Out.WriteLine(t.StackTrace);
failure = t;
break;
@@ -144,7 +144,7 @@ namespace Lucene.Net.Index
}
catch (System.Exception t)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": unexpected exception3");
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": unexpected exception3");
System.Console.Out.WriteLine(t.StackTrace);
failure = t;
break;
@@ -183,10 +183,10 @@ namespace Lucene.Net.Index
{
if (Lucene.Net.Index.TestIndexWriterExceptions.DEBUG)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": NOW FAIL: " + name);
+ System.Console.Out.WriteLine(ThreadClass.Current().Name + ": NOW FAIL: " + name);
//new Throwable().printStackTrace(System.out);
}
- throw new System.SystemException(SupportClass.ThreadClass.Current().Name + ": intentionally failing at " + name);
+ throw new System.SystemException(ThreadClass.Current().Name + ": intentionally failing at " + name);
}
return true;
}
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterLockRelease.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterLockRelease.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterLockRelease.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterLockRelease.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
@@ -43,7 +43,7 @@ namespace Lucene.Net.Index
base.SetUp();
if (this.__test_dir == null)
{
- System.String tmp_dir = SupportClass.AppSettings.Get("java.io.tmpdir", "tmp");
+ System.String tmp_dir = AppSettings.Get("java.io.tmpdir", "tmp");
this.__test_dir = new System.IO.FileInfo(System.IO.Path.Combine(tmp_dir, "testIndexWriter"));
bool tmpBool;
@@ -79,7 +79,7 @@ namespace Lucene.Net.Index
base.TearDown();
if (this.__test_dir != null)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(this.__test_dir);
+ System.IO.FileInfo[] files = FileSupport.GetFiles(this.__test_dir);
for (int i = 0; i < files.Length; ++i)
{
Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterReader.cs?rev=1201243&r1=1201242&r2=1201243&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriterReader.cs Sat Nov 12 10:44:21 2011
@@ -16,7 +16,7 @@
*/
using System;
-
+using Lucene.Net.Support;
using NUnit.Framework;
using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -40,7 +40,7 @@ namespace Lucene.Net.Index
[TestFixture]
public class TestIndexWriterReader:LuceneTestCase
{
- private class AnonymousClassThread:SupportClass.ThreadClass
+ private class AnonymousClassThread:ThreadClass
{
public AnonymousClassThread(long endTime, Lucene.Net.Index.IndexWriter writer, Lucene.Net.Store.Directory[] dirs, System.Collections.IList excs, TestIndexWriterReader enclosingInstance)
{
@@ -83,7 +83,7 @@ namespace Lucene.Net.Index
}
}
}
- private class AnonymousClassThread1:SupportClass.ThreadClass
+ private class AnonymousClassThread1:ThreadClass
{
public AnonymousClassThread1(long endTime, Lucene.Net.Index.IndexWriter writer, System.Collections.IList excs, TestIndexWriterReader enclosingInstance)
{
@@ -415,7 +415,7 @@ namespace Lucene.Net.Index
private class DeleteThreads
{
- private class AnonymousClassThread2:SupportClass.ThreadClass
+ private class AnonymousClassThread2:ThreadClass
{
public AnonymousClassThread2(DeleteThreads enclosingInstance)
{
@@ -454,7 +454,7 @@ namespace Lucene.Net.Index
private void InitBlock(TestIndexWriterReader enclosingInstance)
{
this.enclosingInstance = enclosingInstance;
- threads = new SupportClass.ThreadClass[NUM_THREADS];
+ threads = new ThreadClass[NUM_THREADS];
}
private TestIndexWriterReader enclosingInstance;
public TestIndexWriterReader Enclosing_Instance
@@ -466,7 +466,7 @@ namespace Lucene.Net.Index
}
internal const int NUM_THREADS = 5;
- internal SupportClass.ThreadClass[] threads;
+ internal ThreadClass[] threads;
internal IndexWriter mainWriter;
internal System.Collections.IList deletedTerms = new System.Collections.ArrayList();
internal System.Collections.ArrayList toDeleteTerms = new System.Collections.ArrayList();
@@ -526,14 +526,14 @@ namespace Lucene.Net.Index
}
catch (System.Threading.ThreadInterruptedException ie)
{
- SupportClass.ThreadClass.Current().Interrupt();
+ ThreadClass.Current().Interrupt();
}
}
}
private class AddDirectoriesThreads
{
- private class AnonymousClassThread2:SupportClass.ThreadClass
+ private class AnonymousClassThread2:ThreadClass
{
public AnonymousClassThread2(int numIter, AddDirectoriesThreads enclosingInstance)
{
@@ -585,7 +585,7 @@ namespace Lucene.Net.Index
private void InitBlock(TestIndexWriterReader enclosingInstance)
{
this.enclosingInstance = enclosingInstance;
- threads = new SupportClass.ThreadClass[NUM_THREADS];
+ threads = new ThreadClass[NUM_THREADS];
}
private TestIndexWriterReader enclosingInstance;
public TestIndexWriterReader Enclosing_Instance
@@ -600,7 +600,7 @@ namespace Lucene.Net.Index
internal const int NUM_THREADS = 5;
internal const int NUM_INIT_DOCS = 100;
internal int numDirs;
- internal SupportClass.ThreadClass[] threads;
+ internal ThreadClass[] threads;
internal IndexWriter mainWriter;
internal System.Collections.IList failures = new System.Collections.ArrayList();
internal IndexReader[] readers;
@@ -638,7 +638,7 @@ namespace Lucene.Net.Index
}
catch (System.Threading.ThreadInterruptedException ie)
{
- SupportClass.ThreadClass.Current().Interrupt();
+ ThreadClass.Current().Interrupt();
}
}
@@ -968,7 +968,7 @@ namespace Lucene.Net.Index
long endTime = (long) ((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + 1000.0 * SECONDS);
System.Collections.IList excs = (System.Collections.IList) System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(new System.Collections.ArrayList()));
- SupportClass.ThreadClass[] threads = new SupportClass.ThreadClass[NUM_THREAD];
+ ThreadClass[] threads = new ThreadClass[NUM_THREAD];
for (int i = 0; i < NUM_THREAD; i++)
{
threads[i] = new AnonymousClassThread(endTime, writer, dirs, excs, this);
@@ -1047,7 +1047,7 @@ namespace Lucene.Net.Index
long endTime = (long)((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + 1000.0 * SECONDS);
System.Collections.IList excs = (System.Collections.IList)System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(new System.Collections.ArrayList()));
- SupportClass.ThreadClass[] threads = new SupportClass.ThreadClass[NUM_THREAD];
+ ThreadClass[] threads = new ThreadClass[NUM_THREAD];
for (int i = 0; i < NUM_THREAD; i++)
{
threads[i] = new AnonymousClassThread(endTime, writer, dirs, excs, this);
@@ -1103,7 +1103,7 @@ namespace Lucene.Net.Index
long endTime = (long) ((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + 1000.0 * SECONDS);
System.Collections.IList excs = (System.Collections.IList) System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(new System.Collections.ArrayList()));
- SupportClass.ThreadClass[] threads = new SupportClass.ThreadClass[NUM_THREAD];
+ ThreadClass[] threads = new ThreadClass[NUM_THREAD];
for (int i = 0; i < NUM_THREAD; i++)
{
threads[i] = new AnonymousClassThread1(endTime, writer, excs, this);