You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by pn...@apache.org on 2011/05/07 08:22:27 UTC
[Lucene.Net] svn commit: r1100459 [4/6] - in
/incubator/lucene.net/branches/Lucene.Net_2_9_4g: ./ 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/ s...
Added: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/TextSupport.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/TextSupport.cs?rev=1100459&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/TextSupport.cs (added)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/TextSupport.cs Sat May 7 06:22:20 2011
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+namespace Lucene.Net.Support
+{
+ public class TextSupport
+ {
+ /// <summary>
+ /// Copies an array of chars obtained from a String into a specified array of chars
+ /// </summary>
+ /// <param name="sourceString">The String to get the chars from</param>
+ /// <param name="sourceStart">Position of the String to start getting the chars</param>
+ /// <param name="sourceEnd">Position of the String to end getting the chars</param>
+ /// <param name="destinationArray">Array to return the chars</param>
+ /// <param name="destinationStart">Position of the destination array of chars to start storing the chars</param>
+ /// <returns>An array of chars</returns>
+ public static void GetCharsFromString(string sourceString, int sourceStart, int sourceEnd, char[] destinationArray, int destinationStart)
+ {
+ int sourceCounter;
+ int destinationCounter;
+ sourceCounter = sourceStart;
+ destinationCounter = destinationStart;
+ while (sourceCounter < sourceEnd)
+ {
+ destinationArray[destinationCounter] = (char)sourceString[sourceCounter];
+ sourceCounter++;
+ destinationCounter++;
+ }
+ }
+ }
+}
\ No newline at end of file
Added: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/ThreadClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/ThreadClass.cs?rev=1100459&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/ThreadClass.cs (added)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/ThreadClass.cs Sat May 7 06:22:20 2011
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Lucene.Net.Support
+{
+ /// <summary>
+ /// Support class used to handle threads
+ /// </summary>
+ public class ThreadClass : IThreadRunnable
+ {
+ /// <summary>
+ /// The instance of System.Threading.Thread
+ /// </summary>
+ private System.Threading.Thread threadField;
+
+
+ /// <summary>
+ /// Initializes a new instance of the ThreadClass class
+ /// </summary>
+ public ThreadClass()
+ {
+ threadField = new System.Threading.Thread(new System.Threading.ThreadStart(Run));
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the Thread class.
+ /// </summary>
+ /// <param name="Name">The name of the thread</param>
+ public ThreadClass(System.String Name)
+ {
+ threadField = new System.Threading.Thread(new System.Threading.ThreadStart(Run));
+ this.Name = Name;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the Thread class.
+ /// </summary>
+ /// <param name="Start">A ThreadStart delegate that references the methods to be invoked when this thread begins executing</param>
+ public ThreadClass(System.Threading.ThreadStart Start)
+ {
+ threadField = new System.Threading.Thread(Start);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the Thread class.
+ /// </summary>
+ /// <param name="Start">A ThreadStart delegate that references the methods to be invoked when this thread begins executing</param>
+ /// <param name="Name">The name of the thread</param>
+ public ThreadClass(System.Threading.ThreadStart Start, System.String Name)
+ {
+ threadField = new System.Threading.Thread(Start);
+ this.Name = Name;
+ }
+
+ /// <summary>
+ /// This method has no functionality unless the method is overridden
+ /// </summary>
+ public virtual void Run()
+ {
+ }
+
+ /// <summary>
+ /// Causes the operating system to change the state of the current thread instance to ThreadState.Running
+ /// </summary>
+ public virtual void Start()
+ {
+ threadField.Start();
+ }
+
+ /// <summary>
+ /// Interrupts a thread that is in the WaitSleepJoin thread state
+ /// </summary>
+ public virtual void Interrupt()
+ {
+ threadField.Interrupt();
+ }
+
+ /// <summary>
+ /// Gets the current thread instance
+ /// </summary>
+ public System.Threading.Thread Instance
+ {
+ get
+ {
+ return threadField;
+ }
+ set
+ {
+ threadField = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the thread
+ /// </summary>
+ public System.String Name
+ {
+ get
+ {
+ return threadField.Name;
+ }
+ set
+ {
+ if (threadField.Name == null)
+ threadField.Name = value;
+ }
+ }
+
+ public void SetDaemon(bool isDaemon)
+ {
+ threadField.IsBackground = isDaemon;
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating the scheduling priority of a thread
+ /// </summary>
+ public System.Threading.ThreadPriority Priority
+ {
+ get
+ {
+ try
+ {
+ return threadField.Priority;
+ }
+ catch
+ {
+ return System.Threading.ThreadPriority.Normal;
+ }
+ }
+ set
+ {
+ try
+ {
+ threadField.Priority = value;
+ }
+ catch{}
+
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating the execution status of the current thread
+ /// </summary>
+ public bool IsAlive
+ {
+ get
+ {
+ return threadField.IsAlive;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether or not a thread is a background thread.
+ /// </summary>
+ public bool IsBackground
+ {
+ get
+ {
+ return threadField.IsBackground;
+ }
+ set
+ {
+ threadField.IsBackground = value;
+ }
+ }
+
+ /// <summary>
+ /// Blocks the calling thread until a thread terminates
+ /// </summary>
+ public void Join()
+ {
+ threadField.Join();
+ }
+
+ /// <summary>
+ /// Blocks the calling thread until a thread terminates or the specified time elapses
+ /// </summary>
+ /// <param name="MiliSeconds">Time of wait in milliseconds</param>
+ public void Join(long MiliSeconds)
+ {
+ threadField.Join(new System.TimeSpan(MiliSeconds * 10000));
+ }
+
+ /// <summary>
+ /// Blocks the calling thread until a thread terminates or the specified time elapses
+ /// </summary>
+ /// <param name="MiliSeconds">Time of wait in milliseconds</param>
+ /// <param name="NanoSeconds">Time of wait in nanoseconds</param>
+ public void Join(long MiliSeconds, int NanoSeconds)
+ {
+ threadField.Join(new System.TimeSpan(MiliSeconds * 10000 + NanoSeconds * 100));
+ }
+
+ /// <summary>
+ /// Resumes a thread that has been suspended
+ /// </summary>
+ public void Resume()
+ {
+ System.Threading.Monitor.PulseAll(threadField);
+ }
+
+ /// <summary>
+ /// Raises a ThreadAbortException in the thread on which it is invoked,
+ /// to begin the process of terminating the thread. Calling this method
+ /// usually terminates the thread
+ /// </summary>
+ public void Abort()
+ {
+ threadField.Abort();
+ }
+
+ /// <summary>
+ /// Raises a ThreadAbortException in the thread on which it is invoked,
+ /// to begin the process of terminating the thread while also providing
+ /// exception information about the thread termination.
+ /// Calling this method usually terminates the thread.
+ /// </summary>
+ /// <param name="stateInfo">An object that contains application-specific information, such as state, which can be used by the thread being aborted</param>
+ public void Abort(object stateInfo)
+ {
+ threadField.Abort(stateInfo);
+ }
+
+ /// <summary>
+ /// Suspends the thread, if the thread is already suspended it has no effect
+ /// </summary>
+ public void Suspend()
+ {
+ System.Threading.Monitor.Wait(threadField);
+ }
+
+ /// <summary>
+ /// Obtain a String that represents the current object
+ /// </summary>
+ /// <returns>A String that represents the current object</returns>
+ public override System.String ToString()
+ {
+ return "Thread[" + Name + "," + Priority.ToString() + "]";
+ }
+
+ [ThreadStatic]
+ static ThreadClass This = null;
+
+ // named as the Java version
+ public static ThreadClass CurrentThread()
+ {
+ return Current();
+ }
+
+ public static void Sleep(long ms)
+ {
+ // casting long ms to int ms could lose resolution, however unlikely
+ // that someone would want to sleep for that long...
+ System.Threading.Thread.Sleep((int)ms);
+ }
+
+ /// <summary>
+ /// Gets the currently running thread
+ /// </summary>
+ /// <returns>The currently running thread</returns>
+ public static ThreadClass Current()
+ {
+ if (This == null)
+ {
+ This = new ThreadClass();
+ This.Instance = System.Threading.Thread.CurrentThread;
+ }
+ return This;
+ }
+
+ public static bool operator ==(ThreadClass t1, object t2)
+ {
+ if (((object)t1) == null) return t2 == null;
+ return t1.Equals(t2);
+ }
+
+ public static bool operator !=(ThreadClass t1, object t2)
+ {
+ return !(t1 == t2);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == null) return false;
+ if (obj is ThreadClass) return this.threadField.Equals( ((ThreadClass)obj).threadField );
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return this.threadField.GetHashCode();
+ }
+ }
+}
\ No newline at end of file
Added: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/WeakHashTable.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/WeakHashTable.cs?rev=1100459&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/WeakHashTable.cs (added)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Support/WeakHashTable.cs Sat May 7 06:22:20 2011
@@ -0,0 +1,274 @@
+/*
+ * 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;
+using System.Collections;
+
+namespace Lucene.Net.Support
+{
+ /// <summary>
+ /// A Hashtable which holds weak references to its keys so they
+ /// can be collected during GC.
+ /// </summary>
+ [System.Diagnostics.DebuggerDisplay("Count = {Values.Count}")]
+ public class WeakHashTable : Hashtable, IEnumerable
+ {
+ /// <summary>
+ /// A weak referene wrapper for the hashtable keys. Whenever a key\value pair
+ /// is added to the hashtable, the key is wrapped using a WeakKey. WeakKey saves the
+ /// value of the original object hashcode for fast comparison.
+ /// </summary>
+ class WeakKey
+ {
+ WeakReference reference;
+ int hashCode;
+
+ public WeakKey(object key)
+ {
+ if (key == null)
+ throw new ArgumentNullException("key");
+
+ hashCode = key.GetHashCode();
+ reference = new WeakReference(key);
+ }
+
+ public override int GetHashCode()
+ {
+ return hashCode;
+ }
+
+ public object Target
+ {
+ get { return reference.Target; }
+ }
+
+ public bool IsAlive
+ {
+ get { return reference.IsAlive; }
+ }
+ }
+
+ /// <summary>
+ /// A Dictionary enumerator which wraps the original hashtable enumerator
+ /// and performs 2 tasks: Extract the real key from a WeakKey and skip keys
+ /// that were already collected.
+ /// </summary>
+ class WeakDictionaryEnumerator : IDictionaryEnumerator
+ {
+ IDictionaryEnumerator baseEnumerator;
+ object currentKey;
+ object currentValue;
+
+ public WeakDictionaryEnumerator(IDictionaryEnumerator baseEnumerator)
+ {
+ this.baseEnumerator = baseEnumerator;
+ }
+
+ public DictionaryEntry Entry
+ {
+ get
+ {
+ return new DictionaryEntry(this.currentKey, this.currentValue);
+ }
+ }
+
+ public object Key
+ {
+ get
+ {
+ return this.currentKey;
+ }
+ }
+
+ public object Value
+ {
+ get
+ {
+ return this.currentValue;
+ }
+ }
+
+ public object Current
+ {
+ get
+ {
+ return Entry;
+ }
+ }
+
+ public bool MoveNext()
+ {
+ while (baseEnumerator.MoveNext())
+ {
+ object key = ((WeakKey)baseEnumerator.Key).Target;
+ if (key != null)
+ {
+ this.currentKey = key;
+ this.currentValue = baseEnumerator.Value;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void Reset()
+ {
+ baseEnumerator.Reset();
+ this.currentKey = null;
+ this.currentValue = null;
+ }
+ }
+
+
+ /// <summary>
+ /// Serves as a simple "GC Monitor" that indicates whether cleanup is needed.
+ /// If collectableObject.IsAlive is false, GC has occurred and we should perform cleanup
+ /// </summary>
+ WeakReference collectableObject = new WeakReference(new Object());
+
+ /// <summary>
+ /// Customize the hashtable lookup process by overriding KeyEquals. KeyEquals
+ /// will compare both WeakKey to WeakKey and WeakKey to real keys
+ /// </summary>
+ protected override bool KeyEquals(object x, object y)
+ {
+ if (x == y)
+ return true;
+
+ if (x is WeakKey)
+ {
+ x = ((WeakKey)x).Target;
+ if (x == null)
+ return false;
+ }
+
+ if (y is WeakKey)
+ {
+ y = ((WeakKey)y).Target;
+ if (y == null)
+ return false;
+ }
+
+ return x.Equals(y);
+ }
+
+ protected override int GetHash(object key)
+ {
+ return key.GetHashCode();
+ }
+
+ /// <summary>
+ /// Perform cleanup if GC occurred
+ /// </summary>
+ private void CleanIfNeeded()
+ {
+ if (collectableObject.Target == null)
+ {
+ Clean();
+ collectableObject = new WeakReference(new Object());
+ }
+ }
+
+ /// <summary>
+ /// Iterate over all keys and remove keys that were collected
+ /// </summary>
+ private void Clean()
+ {
+ foreach (WeakKey wtk in ((Hashtable)base.Clone()).Keys)
+ {
+ if (!wtk.IsAlive)
+ {
+ Remove(wtk);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Wrap each key with a WeakKey and add it to the hashtable
+ /// </summary>
+ public override void Add(object key, object value)
+ {
+ CleanIfNeeded();
+ base.Add(new WeakKey(key), value);
+ }
+
+ public override IDictionaryEnumerator GetEnumerator()
+ {
+ Hashtable tmp = null;
+ tmp = (Hashtable)base.Clone();
+ return new WeakDictionaryEnumerator(tmp.GetEnumerator());
+ }
+
+ /// <summary>
+ /// Create a temporary copy of the real keys and return that
+ /// </summary>
+ public override ICollection Keys
+ {
+ get
+ {
+ ArrayList keys = new ArrayList(Count);
+ Hashtable tmpTable = (Hashtable)base.Clone();
+
+ foreach (WeakKey key in tmpTable.Keys)
+ {
+ object realKey = key.Target;
+ if (realKey != null)
+ keys.Add(realKey);
+ }
+
+ return keys;
+ }
+ }
+
+ public override object this[object key]
+ {
+ get
+ {
+ return base[key];
+ }
+ set
+ {
+ CleanIfNeeded();
+ base[new WeakKey(key)] = value;
+ }
+ }
+
+ public override void CopyTo(Array array, int index)
+ {
+ int arrayIndex = index;
+ foreach (DictionaryEntry de in this)
+ {
+ array.SetValue(de, arrayIndex++);
+ }
+ }
+
+ public override int Count
+ {
+ get
+ {
+ CleanIfNeeded();
+ return base.Count;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
\ No newline at end of file
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/AttributeSource.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/AttributeSource.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/AttributeSource.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/AttributeSource.cs Sat May 7 06:22:20 2011
@@ -48,7 +48,7 @@ namespace Lucene.Net.Util
private sealed class DefaultAttributeFactory:AttributeFactory
{
- private static readonly SupportClass.WeakHashTable attClassImplMap = new SupportClass.WeakHashTable();
+ private static readonly Support.WeakHashTable attClassImplMap = new Support.WeakHashTable();
internal DefaultAttributeFactory()
{
@@ -96,8 +96,8 @@ namespace Lucene.Net.Util
// These two maps must always be in sync!!!
// So they are private, final and read-only from the outside (read-only iterators)
- private SupportClass.GeneralKeyedCollection<Type, SupportClass.AttributeImplItem> attributes;
- private SupportClass.GeneralKeyedCollection<Type, SupportClass.AttributeImplItem> attributeImpls;
+ private Support.GeneralKeyedCollection<Type, Support.AttributeImplItem> attributes;
+ private Support.GeneralKeyedCollection<Type, Support.AttributeImplItem> attributeImpls;
private AttributeFactory factory;
@@ -121,8 +121,8 @@ namespace Lucene.Net.Util
/// <summary> An AttributeSource using the supplied {@link AttributeFactory} for creating new {@link Attribute} instances.</summary>
public AttributeSource(AttributeFactory factory)
{
- this.attributes = new SupportClass.GeneralKeyedCollection<Type, SupportClass.AttributeImplItem>(delegate(SupportClass.AttributeImplItem att) { return att.Key; });
- this.attributeImpls = new SupportClass.GeneralKeyedCollection<Type, SupportClass.AttributeImplItem>(delegate(SupportClass.AttributeImplItem att) { return att.Key; });
+ this.attributes = new Support.GeneralKeyedCollection<Type, Support.AttributeImplItem>(delegate(Support.AttributeImplItem att) { return att.Key; });
+ this.attributeImpls = new Support.GeneralKeyedCollection<Type, Support.AttributeImplItem>(delegate(Support.AttributeImplItem att) { return att.Key; });
this.factory = factory;
}
@@ -141,7 +141,7 @@ namespace Lucene.Net.Util
/// </summary>
public virtual IEnumerable<Type> GetAttributeClassesIterator()
{
- foreach (SupportClass.AttributeImplItem item in this.attributes)
+ foreach (Support.AttributeImplItem item in this.attributes)
{
yield return item.Key;
}
@@ -170,7 +170,7 @@ namespace Lucene.Net.Util
}
/// <summary>a cache that stores all interfaces for known implementation classes for performance (slow reflection) </summary>
- private static readonly SupportClass.WeakHashTable knownImplClasses = new SupportClass.WeakHashTable();
+ private static readonly Support.WeakHashTable knownImplClasses = new Support.WeakHashTable();
// {{Aroush-2.9 Port issue, need to mimic java's IdentityHashMap
/*
@@ -229,10 +229,10 @@ namespace Lucene.Net.Util
{
// invalidate state to force recomputation in captureState()
this.currentState = null;
- attributes.Add(new SupportClass.AttributeImplItem(curInterface, att));
+ attributes.Add(new Support.AttributeImplItem(curInterface, att));
if (!attributeImpls.ContainsKey(clazz))
{
- attributeImpls.Add(new SupportClass.AttributeImplItem(clazz, att));
+ attributeImpls.Add(new Support.AttributeImplItem(clazz, att));
}
}
}
@@ -335,7 +335,7 @@ namespace Lucene.Net.Util
{
currentState = new State();
State c = currentState;
- IEnumerator<SupportClass.AttributeImplItem> it = attributeImpls.GetEnumerator();
+ IEnumerator<Support.AttributeImplItem> it = attributeImpls.GetEnumerator();
if (it.MoveNext())
c.attribute = it.Current.Value;
while (it.MoveNext())
@@ -524,14 +524,14 @@ namespace Lucene.Net.Util
for (State state = currentState; state != null; state = state.next)
{
AttributeImpl impl = (AttributeImpl) state.attribute.Clone();
- clone.attributeImpls.Add(new SupportClass.AttributeImplItem(impl.GetType(), impl));
+ clone.attributeImpls.Add(new Support.AttributeImplItem(impl.GetType(), impl));
}
}
// now the interfaces
- foreach (SupportClass.AttributeImplItem att in this.attributes)
+ foreach (Support.AttributeImplItem att in this.attributes)
{
- clone.attributes.Add(new SupportClass.AttributeImplItem(att.Key, clone.attributeImpls[att.Value.GetType()].Value));
+ clone.attributes.Add(new Support.AttributeImplItem(att.Key, clone.attributeImpls[att.Value.GetType()].Value));
}
return clone;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitUtil.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitUtil.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitUtil.cs Sat May 7 06:22:20 2011
@@ -46,12 +46,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 - ((Support.Number.URShift(x, 1)) & 0x5555555555555555L);
+ x = (x & 0x3333333333333333L) + ((Support.Number.URShift(x, 2)) & 0x3333333333333333L);
+ x = (x + (Support.Number.URShift(x, 4))) & 0x0F0F0F0F0F0F0F0FL;
+ x = x + (Support.Number.URShift(x, 8));
+ x = x + (Support.Number.URShift(x, 16));
+ x = x + (Support.Number.URShift(x, 32));
return ((int) x) & 0x7F;
}
@@ -726,15 +726,15 @@ namespace Lucene.Net.Util
if (lower != 0)
{
- lowByte = (SupportClass.Number.URShift(lower, 8)) & 0xff;
+ lowByte = (Support.Number.URShift(lower, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 8;
- lowByte = (SupportClass.Number.URShift(lower, 16)) & 0xff;
+ lowByte = (Support.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[Support.Number.URShift(lower, 24)] + 24;
}
else
{
@@ -743,15 +743,15 @@ namespace Lucene.Net.Util
lowByte = upper & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 32;
- lowByte = (SupportClass.Number.URShift(upper, 8)) & 0xff;
+ lowByte = (Support.Number.URShift(upper, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 40;
- lowByte = (SupportClass.Number.URShift(upper, 16)) & 0xff;
+ lowByte = (Support.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[Support.Number.URShift(upper, 24)] + 56;
}
}
@@ -765,15 +765,15 @@ namespace Lucene.Net.Util
int lowByte = val & 0xff;
if (lowByte != 0)
return ntzTable[lowByte];
- lowByte = (SupportClass.Number.URShift(val, 8)) & 0xff;
+ lowByte = (Support.Number.URShift(val, 8)) & 0xff;
if (lowByte != 0)
return ntzTable[lowByte] + 8;
- lowByte = (SupportClass.Number.URShift(val, 16)) & 0xff;
+ lowByte = (Support.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[Support.Number.URShift(val, 24)] + 24;
}
/// <summary>returns 0 based index of first set bit
@@ -786,15 +786,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) (Support.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 = Support.Number.URShift(y, 16);
}
if ((y & 0x000000FF) == 0)
{
- n += 8; y = SupportClass.Number.URShift(y, 8);
+ n += 8; y = Support.Number.URShift(y, 8);
}
return (ntzTable[y & 0xff]) + n;
}
@@ -813,23 +813,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) (Support.Number.URShift(x, 32));
}
if ((y & 0x0000FFFF) == 0)
{
- n += 16; y = SupportClass.Number.URShift(y, 16);
+ n += 16; y = Support.Number.URShift(y, 16);
}
if ((y & 0x000000FF) == 0)
{
- n += 8; y = SupportClass.Number.URShift(y, 8);
+ n += 8; y = Support.Number.URShift(y, 8);
}
if ((y & 0x0000000F) == 0)
{
- n += 4; y = SupportClass.Number.URShift(y, 4);
+ n += 4; y = Support.Number.URShift(y, 4);
}
if ((y & 0x00000003) == 0)
{
- n += 2; y = SupportClass.Number.URShift(y, 2);
+ n += 2; y = Support.Number.URShift(y, 2);
}
return n - (y & 1);
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitVector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitVector.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitVector.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/BitVector.cs Sat May 7 06:22:20 2011
@@ -300,13 +300,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[(Support.Number.URShift((end - start - 1), 3)) + 1];
+ int s = Support.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) ((Support.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_2_9_4g/src/core/Util/Cache/SimpleMapCache.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Cache/SimpleMapCache.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Cache/SimpleMapCache.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Cache/SimpleMapCache.cs Sat May 7 06:22:20 2011
@@ -27,13 +27,13 @@ namespace Lucene.Net.Util.Cache
/// </summary>
public class SimpleMapCache<K, V> : Cache<K, V>
{
- internal SupportClass.Dictionary<K, V> map;
+ internal Support.Dictionary<K, V> map;
- public SimpleMapCache():this(new SupportClass.Dictionary<K,V>())
+ public SimpleMapCache():this(new Support.Dictionary<K,V>())
{
}
- public SimpleMapCache(SupportClass.Dictionary<K, V> map)
+ public SimpleMapCache(Support.Dictionary<K, V> map)
{
this.map = map;
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/CloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/CloseableThreadLocal.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/CloseableThreadLocal.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/CloseableThreadLocal.cs Sat May 7 06:22:20 2011
@@ -45,7 +45,7 @@ namespace Lucene.Net.Util
{
[ThreadStatic]
- static SupportClass.WeakHashTable slots;
+ static Support.WeakHashTable slots;
public /*protected internal*/ virtual System.Object InitialValue()
{
@@ -80,7 +80,7 @@ namespace Lucene.Net.Util
public virtual void Set(System.Object object_Renamed)
{
if (slots == null)
- slots = new SupportClass.WeakHashTable();
+ slots = new Support.WeakHashTable();
slots[this] = object_Renamed;
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Constants.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Constants.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Constants.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Constants.cs Sat May 7 06:22:20 2011
@@ -37,7 +37,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 = Support.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>
@@ -56,7 +56,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 = Support.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!
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/DocIdBitSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/DocIdBitSet.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/DocIdBitSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/DocIdBitSet.cs Sat May 7 06:22:20 2011
@@ -88,7 +88,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 = Support.BitSetSupport.NextSetBit(bitSet, docId + 1);
// -1 returned by BitSet.nextSetBit() when exhausted
docId = d == - 1?NO_MORE_DOCS:d;
return docId;
@@ -104,7 +104,7 @@ namespace Lucene.Net.Util
public override int Advance(int target)
{
- int d = SupportClass.BitSetSupport.NextSetBit(bitSet, target);
+ int d = Support.BitSetSupport.NextSetBit(bitSet, target);
// -1 returned by BitSet.nextSetBit() when exhausted
docId = d == - 1?NO_MORE_DOCS:d;
return docId;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/IndexableBinaryStringTools.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/IndexableBinaryStringTools.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/IndexableBinaryStringTools.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/IndexableBinaryStringTools.cs Sat May 7 06:22:20 2011
@@ -139,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) + ((Support.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) + ((Support.Number.URShift((input[inputByteNum + 2] & 0xFF), codingCase.finalShift)) & codingCase.finalMask) & (short)0x7FFF);
}
inputByteNum += codingCase.advanceBytes;
if (++caseNum == CODING_CASES.Length)
@@ -222,19 +222,19 @@ namespace Lucene.Net.Util
{
if (0 == caseNum)
{
- output[outputByteNum] = (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift));
+ output[outputByteNum] = (byte) (Support.Number.URShift(inputChar, codingCase.initialShift));
}
else
{
- output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (SupportClass.Number.URShift(inputChar, codingCase.initialShift)));
+ output[outputByteNum] = (byte) (output[outputByteNum] + (byte) (Support.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) (Support.Number.URShift(inputChar, codingCase.initialShift)));
+ output[outputByteNum + 1] = (byte) (Support.Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
output[outputByteNum + 2] = (byte) ((inputChar & codingCase.finalMask) << codingCase.finalShift);
}
outputByteNum += codingCase.advanceBytes;
@@ -250,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) (Support.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) (Support.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) (Support.Number.URShift((inputChar & codingCase.middleMask), codingCase.middleShift));
if (bytesLeft > 2)
{
output[outputByteNum + 2] = (byte) ((inputChar & codingCase.finalMask) << codingCase.finalShift);
@@ -322,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) (Support.Number.URShift((short) 0xFF, finalShift));
this.middleMask = (short) ((short) 0xFF << middleShift);
}
@@ -331,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) (Support.Number.URShift((short) 0xFF, finalShift));
if (finalShift != 0)
{
advanceBytes = 1;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/NumericUtils.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/NumericUtils.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/NumericUtils.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/NumericUtils.cs Sat May 7 06:22:20 2011
@@ -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 = Support.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 = Support.Number.URShift(sortableBits, 7);
}
return len;
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/OpenBitSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/OpenBitSet.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/OpenBitSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/OpenBitSet.cs Sat May 7 06:22:20 2011
@@ -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) | (Support.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_2_9_4g/src/core/Util/PriorityQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/PriorityQueue.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/PriorityQueue.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/PriorityQueue.cs Sat May 7 06:22:20 2011
@@ -303,12 +303,12 @@ namespace Lucene.Net.Util
{
int i = size;
T node = heap[i]; // save bottom node
- int j = SupportClass.Number.URShift(i, 1);
+ int j = Support.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 = Support.Number.URShift(j, 1);
}
heap[i] = node; // install saved node
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ReaderUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ReaderUtil.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ReaderUtil.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ReaderUtil.cs Sat May 7 06:22:20 2011
@@ -107,7 +107,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 = Support.Number.URShift((lo + hi), 1);
int midValue = docStarts[mid];
if (n < midValue)
hi = mid - 1;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ScorerDocQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ScorerDocQueue.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ScorerDocQueue.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/ScorerDocQueue.cs Sat May 7 06:22:20 2011
@@ -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 = Support.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 = Support.Number.URShift(j, 1);
}
heap[i] = node; // install saved node
topHSD = heap[1];
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/SortedVIntList.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/SortedVIntList.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/SortedVIntList.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/SortedVIntList.cs Sat May 7 06:22:20 2011
@@ -166,11 +166,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 = Support.BitSetSupport.NextSetBit(bits, 0);
while (nextInt != - 1)
{
builder.AddInt(nextInt);
- nextInt = SupportClass.BitSetSupport.NextSetBit(bits, nextInt + 1);
+ nextInt = Support.BitSetSupport.NextSetBit(bits, nextInt + 1);
}
builder.Done();
}
@@ -251,7 +251,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 = Support.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++;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/HTMLParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/HTMLParser.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/HTMLParser.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/HTMLParser.cs Sat May 7 06:22:20 2011
@@ -167,7 +167,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);
+ Support.ThreadClass thread = new ParserThread(this);
thread.Start(); // start parsing
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParseException.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParseException.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParseException.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParseException.cs Sat May 7 06:22:20 2011
@@ -161,7 +161,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 = Support.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_2_9_4g/src/demo/Demo.Common/HTML/ParserThread.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParserThread.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParserThread.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/demo/Demo.Common/HTML/ParserThread.cs Sat May 7 06:22:20 2011
@@ -20,7 +20,7 @@ using System;
namespace Lucene.Net.Demo.Html
{
- class ParserThread:SupportClass.ThreadClass
+ class ParserThread:Support.ThreadClass
{
internal HTMLParser parser;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestAtomicUpdate.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestAtomicUpdate.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestAtomicUpdate.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestAtomicUpdate.cs Sat May 7 06:22:20 2011
@@ -68,7 +68,7 @@ namespace Lucene.Net.Index
}
}
- abstract public class TimedThread:SupportClass.ThreadClass
+ abstract public class TimedThread:Support.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(Support.ThreadClass.Current().Name + ": exc");
System.Console.Out.WriteLine(e.StackTrace);
failed = true;
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestBackwardsCompatibility.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestBackwardsCompatibility.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestBackwardsCompatibility.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestBackwardsCompatibility.cs Sat May 7 06:22:20 2011
@@ -496,7 +496,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 (!Support.CollectionsHelper.Equals(expected, actual))
{
Assert.Fail("incorrect filenames in index: expected:\n " + AsString(expected) + "\n actual:\n " + AsString(actual));
}
@@ -567,7 +567,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 = Support.FileSupport.GetFiles(fileDir);
if (files != null)
{
for (int i = 0; i < files.Length; i++)
@@ -607,7 +607,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(Support.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_2_9_4g/test/core/Index/TestCompoundFile.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestCompoundFile.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestCompoundFile.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestCompoundFile.cs Sat May 7 06:22:20 2011
@@ -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(Support.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_2_9_4g/test/core/Index/TestDoc.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestDoc.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestDoc.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestDoc.cs Sat May 7 06:22:20 2011
@@ -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(Support.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_2_9_4g/test/core/Index/TestFieldsReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestFieldsReader.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestFieldsReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestFieldsReader.cs Sat May 7 06:22:20 2011
@@ -150,10 +150,10 @@ namespace Lucene.Net.Index
FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
Assert.IsTrue(reader != null);
Assert.IsTrue(reader.Size() == 1);
- SupportClass.Set<string> loadFieldNames = new SupportClass.Set<string>();
+ Support.Set<string> loadFieldNames = new Support.Set<string>();
loadFieldNames.Add(DocHelper.TEXT_FIELD_1_KEY);
loadFieldNames.Add(DocHelper.TEXT_FIELD_UTF1_KEY);
- SupportClass.Set<string> lazyFieldNames = new SupportClass.Set<string>();
+ Support.Set<string> lazyFieldNames = new Support.Set<string>();
//new String[]{DocHelper.LARGE_LAZY_FIELD_KEY, DocHelper.LAZY_FIELD_KEY, DocHelper.LAZY_FIELD_BINARY_KEY};
lazyFieldNames.Add(DocHelper.LARGE_LAZY_FIELD_KEY);
lazyFieldNames.Add(DocHelper.LAZY_FIELD_KEY);
@@ -210,10 +210,10 @@ namespace Lucene.Net.Index
FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
Assert.IsTrue(reader != null);
Assert.IsTrue(reader.Size() == 1);
- SupportClass.Set<string> loadFieldNames = new SupportClass.Set<string>();
+ Support.Set<string> loadFieldNames = new Support.Set<string>();
loadFieldNames.Add(DocHelper.TEXT_FIELD_1_KEY);
loadFieldNames.Add(DocHelper.TEXT_FIELD_UTF1_KEY);
- SupportClass.Set<string> lazyFieldNames = new SupportClass.Set<string>();
+ Support.Set<string> lazyFieldNames = new Support.Set<string>();
lazyFieldNames.Add(DocHelper.LARGE_LAZY_FIELD_KEY);
lazyFieldNames.Add(DocHelper.LAZY_FIELD_KEY);
lazyFieldNames.Add(DocHelper.LAZY_FIELD_BINARY_KEY);
@@ -270,7 +270,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestLazyPerformance()
{
- System.String tmpIODir = SupportClass.AppSettings.Get("tempDir", "");
+ System.String tmpIODir = Support.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);
@@ -288,9 +288,9 @@ namespace Lucene.Net.Index
long lazyTime = 0;
long regularTime = 0;
int length = 50;
- SupportClass.Set<string> lazyFieldNames = new SupportClass.Set<string>();
+ Support.Set<string> lazyFieldNames = new Support.Set<string>();
lazyFieldNames.Add(DocHelper.LARGE_LAZY_FIELD_KEY);
- SetBasedFieldSelector fieldSelector = new SetBasedFieldSelector(new SupportClass.Set<string>(), lazyFieldNames);
+ SetBasedFieldSelector fieldSelector = new SetBasedFieldSelector(new Support.Set<string>(), 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) (Support.Number.URShift(size, 24)), sizebytes[0]);
+ Assert.AreEqual((byte) (Support.Number.URShift(size, 16)), sizebytes[1]);
+ Assert.AreEqual((byte) (Support.Number.URShift(size, 8)), sizebytes[2]);
Assert.AreEqual((byte) size, sizebytes[3]);
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexFileDeleter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexFileDeleter.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexFileDeleter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexFileDeleter.cs Sat May 7 06:22:20 2011
@@ -164,9 +164,9 @@ namespace Lucene.Net.Index
System.Collections.Hashtable dif = DifFiles(files, files2);
- if (!SupportClass.CollectionsHelper.Equals(files, files2))
+ if (!Support.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: " + Support.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]);
+ Support.CollectionsHelper.AddIfNotContains(set1, files1[x]);
}
for (int x = 0; x < files2.Length; x++)
{
- SupportClass.CollectionsHelper.AddIfNotContains(set2, files2[x]);
+ Support.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);
+ Support.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);
+ Support.CollectionsHelper.AddIfNotContains(extra, o);
}
}
return extra;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexModifier.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexModifier.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexModifier.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexModifier.cs Sat May 7 06:22:20 2011
@@ -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 = Support.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:Support.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();
+ Support.ThreadClass.Current().Interrupt();
throw new System.SystemException("", ie);
}
}
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReader.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReader.cs Sat May 7 06:22:20 2011
@@ -392,9 +392,9 @@ namespace Lucene.Net.Index
{
Assert.AreEqual(bin[i], data1[i + b1.GetBinaryOffset()]);
}
- SupportClass.Set<string> lazyFields = new SupportClass.Set<string>();
+ Support.Set<string> lazyFields = new Support.Set<string>();
lazyFields.Add("bin1");
- FieldSelector sel = new SetBasedFieldSelector(new SupportClass.Set<string>(), lazyFields);
+ FieldSelector sel = new SetBasedFieldSelector(new Support.Set<string>(), lazyFields);
doc = reader.Document(reader.MaxDoc() - 1, sel);
Fieldable[] fieldables = doc.GetFieldables("bin1");
Assert.IsNotNull(fieldables);
@@ -557,7 +557,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestWritingNorms()
{
- System.String tempDir = SupportClass.AppSettings.Get("tempDir", "");
+ System.String tempDir = Support.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(Support.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(Support.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(Support.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 (!Support.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(Support.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 = Support.FileSupport.GetFiles(dir);
for (int i = 0; i < files.Length; i++)
{
bool tmpBool;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReaderReopen.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReaderReopen.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReaderReopen.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexReaderReopen.cs Sat May 7 06:22:20 2011
@@ -396,8 +396,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);
+ Support.CollectionsHelper.AddIfNotContains(readersToClose, c.newReader);
+ Support.CollectionsHelper.AddIfNotContains(readersToClose, c.refreshedReader);
readers.Add(c);
// prevent too many readers
break;
@@ -425,7 +425,7 @@ namespace Lucene.Net.Index
{
refreshed.Close();
}
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, refreshed);
+ Support.CollectionsHelper.AddIfNotContains(readersToClose, refreshed);
}
lock (this)
{
@@ -1108,7 +1108,7 @@ namespace Lucene.Net.Index
IndexReader refreshed = reader.Reopen();
if (refreshed != reader)
{
- SupportClass.CollectionsHelper.AddIfNotContains(readersToClose, reader);
+ Support.CollectionsHelper.AddIfNotContains(readersToClose, reader);
}
reader = refreshed;
}
@@ -1201,7 +1201,7 @@ namespace Lucene.Net.Index
public abstract void Run();
}
- private class ReaderThread:SupportClass.ThreadClass
+ private class ReaderThread:Support.ThreadClass
{
private ReaderThreadTask task;
internal /*private*/ System.Exception error;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriter.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriter.cs Sat May 7 06:22:20 2011
@@ -205,7 +205,7 @@ namespace Lucene.Net.Index
return new CrashingFilter(this.enclosingInstance, fieldName, new WhitespaceTokenizer(reader));
}
}
- private class AnonymousClassThread : SupportClass.ThreadClass
+ private class AnonymousClassThread : Support.ThreadClass
{
public AnonymousClassThread(int NUM_ITER, IndexWriter writer, int finalI, TestIndexWriter enclosingInstance)
{
@@ -264,14 +264,14 @@ namespace Lucene.Net.Index
{
lock (this)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": ERROR: hit unexpected exception");
+ System.Console.Out.WriteLine(Support.ThreadClass.Current().Name + ": ERROR: hit unexpected exception");
System.Console.Out.WriteLine(t.StackTrace);
}
Assert.Fail();
}
}
}
- private class AnonymousClassThread1 : SupportClass.ThreadClass
+ private class AnonymousClassThread1 : Support.ThreadClass
{
public AnonymousClassThread1(IndexWriter finalWriter, Document doc, System.Collections.ArrayList failure, TestIndexWriter enclosingInstance)
{
@@ -996,7 +996,7 @@ namespace Lucene.Net.Index
System.Array.Sort(startFiles);
System.Array.Sort(endFiles);
- if (!SupportClass.CollectionsHelper.Equals(startFiles, endFiles))
+ if (!Support.CollectionsHelper.Equals(startFiles, endFiles))
{
Assert.Fail(message + ": before delete:\n " + ArrayToString(startFiles) + "\n after delete:\n " + ArrayToString(endFiles));
}
@@ -1010,7 +1010,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');
+ Support.CollectionsHelper.Fill(chars, 'x');
Document doc = new Document();
System.String bigTerm = new System.String(chars);
@@ -2234,7 +2234,7 @@ namespace Lucene.Net.Index
private void RmDir(System.IO.FileInfo dir)
{
- System.IO.FileInfo[] files = SupportClass.FileSupport.GetFiles(dir);
+ System.IO.FileInfo[] files = Support.FileSupport.GetFiles(dir);
if (files != null)
{
for (int i = 0; i < files.Length; i++)
@@ -2349,7 +2349,7 @@ namespace Lucene.Net.Index
[Test]
public virtual void TestMaxThreadPriority()
{
- int pri = (System.Int32)SupportClass.ThreadClass.Current().Priority;
+ int pri = (System.Int32)Support.ThreadClass.Current().Priority;
try
{
MockRAMDirectory dir = new MockRAMDirectory();
@@ -2358,14 +2358,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;
+ Support.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;
+ Support.ThreadClass.Current().Priority = (System.Threading.ThreadPriority)pri;
}
}
@@ -2694,7 +2694,7 @@ namespace Lucene.Net.Index
int finalI = i;
- SupportClass.ThreadClass[] threads = new SupportClass.ThreadClass[NUM_THREAD];
+ Support.ThreadClass[] threads = new Support.ThreadClass[NUM_THREAD];
for (int t = 0; t < NUM_THREAD; t++)
{
threads[t] = new AnonymousClassThread(NUM_ITER, writer, finalI, this);
@@ -2856,7 +2856,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);
+ Support.ThreadClass t1 = new AnonymousClassThread1(finalWriter, doc, failure, this);
if (failure.Count > 0)
{
@@ -2882,7 +2882,7 @@ namespace Lucene.Net.Index
}
// Used by test cases below
- private class IndexerThread : SupportClass.ThreadClass
+ private class IndexerThread : Support.ThreadClass
{
private void InitBlock(TestIndexWriter enclosingInstance)
{
@@ -2942,7 +2942,7 @@ namespace Lucene.Net.Index
}
catch (System.Threading.ThreadInterruptedException ie)
{
- SupportClass.ThreadClass.Current().Interrupt();
+ Support.ThreadClass.Current().Interrupt();
throw new System.SystemException("", ie);
}
if (fullCount++ >= 5)
@@ -2952,7 +2952,7 @@ namespace Lucene.Net.Index
{
if (noErrors)
{
- System.Console.Out.WriteLine(SupportClass.ThreadClass.Current().Name + ": ERROR: unexpected IOException:");
+ System.Console.Out.WriteLine(Support.ThreadClass.Current().Name + ": ERROR: unexpected IOException:");
System.Console.Out.WriteLine(ioe.StackTrace);
error = ioe;
}
@@ -2964,7 +2964,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(Support.ThreadClass.Current().Name + ": ERROR: unexpected Throwable:");
System.Console.Out.WriteLine(t.StackTrace);
error = t;
}
@@ -3901,7 +3901,7 @@ namespace Lucene.Net.Index
{
w.AddDocument(doc);
- if (SupportClass.BuildType.Debug)
+ if (Support.BuildType.Debug)
Assert.Fail("did not hit exception");
else
Assert.Ignore("This test is not executed in release mode");
@@ -4003,7 +4003,7 @@ namespace Lucene.Net.Index
}
((ConcurrentMergeScheduler)w.GetMergeScheduler()).Sync();
- if (SupportClass.BuildType.Debug)
+ if (Support.BuildType.Debug)
Assert.IsTrue(w.failed);
else
Assert.Ignore("This test is not executed in release mode");
@@ -4529,7 +4529,7 @@ namespace Lucene.Net.Index
private abstract class RunAddIndexesThreads
{
- private class AnonymousClassThread2 : SupportClass.ThreadClass
+ private class AnonymousClassThread2 : Support.ThreadClass
{
public AnonymousClassThread2(int numIter, RunAddIndexesThreads enclosingInstance)
{
@@ -4577,7 +4577,7 @@ namespace Lucene.Net.Index
}
private void InitBlock()
{
- threads = new SupportClass.ThreadClass[NUM_THREADS];
+ threads = new Support.ThreadClass[NUM_THREADS];
}
internal Directory dir, dir2;
@@ -4588,7 +4588,7 @@ namespace Lucene.Net.Index
internal IndexReader[] readers;
internal int NUM_COPY;
internal const int NUM_THREADS = 5;
- internal SupportClass.ThreadClass[] threads;
+ internal Support.ThreadClass[] threads;
internal ConcurrentMergeScheduler cms;
public RunAddIndexesThreads(int numCopy)
@@ -4612,7 +4612,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 Support.ThreadClass[NUM_THREADS]; //{{DIGY}} Should this be created somewhere else?
for (int i = 0; i < NUM_THREADS; i++)
{
threads[i] = new AnonymousClassThread2(numIter, this);
@@ -4953,7 +4953,7 @@ namespace Lucene.Net.Index
try
{
w.Rollback();
- if (SupportClass.BuildType.Debug)
+ if (Support.BuildType.Debug)
Assert.Fail("did not hit intentional RuntimeException");
else
Assert.Ignore("This test is not executed in release mode");
@@ -5005,7 +5005,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(Support.AppSettings.Get("tempDir", ""), "mergecompressedfields"));
Directory dir = FSDirectory.Open(indexDir);
try
{
@@ -5413,7 +5413,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(Support.AppSettings.Get("tempDir", ""), "otherfiles"));
Directory dir = FSDirectory.Open(indexDir);
try
{
@@ -5473,7 +5473,7 @@ namespace Lucene.Net.Index
dir.Close();
}
- private class IndexerThreadInterrupt : SupportClass.ThreadClass
+ private class IndexerThreadInterrupt : Support.ThreadClass
{
public IndexerThreadInterrupt(TestIndexWriter enclosingInstance)
{
@@ -5763,7 +5763,7 @@ namespace Lucene.Net.Index
dir.Close();
}
- class LUCENE_2095_Thread : SupportClass.ThreadClass
+ class LUCENE_2095_Thread : Support.ThreadClass
{
IndexWriter w = null;
Directory dir = null;
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriterDelete.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriterDelete.cs?rev=1100459&r1=1100458&r2=1100459&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriterDelete.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Index/TestIndexWriterDelete.cs Sat May 7 06:22:20 2011
@@ -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 (!Support.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));
}