Пример #1
0
            public virtual System.Object Get(IndexReader reader, Entry key)
            {
                IDictionary <Entry, Object> innerCache;

                System.Object value_Renamed;
                System.Object readerKey = reader.GetFieldCacheKey();
                lock (readerCache)
                {
                    innerCache = readerCache[readerKey];
                    if (innerCache == null)
                    {
                        innerCache             = new Support.Dictionary <Entry, Object>();
                        readerCache[readerKey] = innerCache;
                        value_Renamed          = null;
                    }
                    else
                    {
                        value_Renamed = innerCache[key];
                    }
                    if (value_Renamed == null)
                    {
                        value_Renamed   = new CreationPlaceholder();
                        innerCache[key] = value_Renamed;
                    }
                }
                if (value_Renamed is CreationPlaceholder)
                {
                    lock (value_Renamed)
                    {
                        CreationPlaceholder progress = (CreationPlaceholder)value_Renamed;
                        if (progress.value_Renamed == null)
                        {
                            progress.value_Renamed = CreateValue(reader, key);
                            lock (readerCache)
                            {
                                innerCache[key] = progress.value_Renamed;
                            }

                            // Only check if key.custom (the parser) is
                            // non-null; else, we check twice for a single
                            // call to FieldCache.getXXX
                            if (key.custom != null && wrapper != null)
                            {
                                System.IO.StreamWriter infoStream = wrapper.GetInfoStream();
                                if (infoStream != null)
                                {
                                    PrintNewInsanity(infoStream, progress.value_Renamed);
                                }
                            }
                        }
                        return(progress.value_Renamed);
                    }
                }
                return(value_Renamed);
            }
Пример #2
0
            public virtual object Get(IndexReader reader, object key)
            {
                System.Collections.IDictionary innerCache;
                object value_Renamed;

                lock (readerCache.SyncRoot)
                {
                    innerCache = (System.Collections.IDictionary)readerCache[reader];
                    if (innerCache == null)
                    {
                        innerCache          = new System.Collections.Hashtable();
                        readerCache[reader] = innerCache;
                        value_Renamed       = null;
                    }
                    else
                    {
                        value_Renamed = innerCache[key];
                    }
                    if (value_Renamed == null)
                    {
                        value_Renamed   = new CreationPlaceholder();
                        innerCache[key] = value_Renamed;
                    }
                }
                if (value_Renamed is CreationPlaceholder)
                {
                    lock (value_Renamed)
                    {
                        CreationPlaceholder progress = (CreationPlaceholder)value_Renamed;
                        if (progress.value_Renamed == null)
                        {
                            progress.value_Renamed = CreateValue(reader, key);
                            lock (readerCache.SyncRoot)
                            {
                                innerCache[key] = progress.value_Renamed;
                            }
                        }
                        return(progress.value_Renamed);
                    }
                }
                return(value_Renamed);
            }
Пример #3
0
 public virtual System.Object Get(IndexReader reader, Entry key)
 {
     IDictionary<Entry, object> innerCache;
     System.Object value;
     System.Object readerKey = reader.FieldCacheKey;
     lock (readerCache)
     {
         innerCache = readerCache[readerKey];
         if (innerCache == null)
         {
             innerCache = new HashMap<Entry, object>();
             readerCache[readerKey] = innerCache;
             value = null;
         }
         else
         {
             value = innerCache[key];
         }
         if (value == null)
         {
             value = new CreationPlaceholder();
             innerCache[key] = value;
         }
     }
     if (value is CreationPlaceholder)
     {
         lock (value)
         {
             CreationPlaceholder progress = (CreationPlaceholder) value;
             if (progress.value_Renamed == null)
             {
                 progress.value_Renamed = CreateValue(reader, key);
                 lock (readerCache)
                 {
                     innerCache[key] = progress.value_Renamed;
                 }
                 
                 // Only check if key.custom (the parser) is
                 // non-null; else, we check twice for a single
                 // call to FieldCache.getXXX
                 if (key.custom != null && wrapper != null)
                 {
                     System.IO.StreamWriter infoStream = wrapper.InfoStream;
                     if (infoStream != null)
                     {
                         PrintNewInsanity(infoStream, progress.value_Renamed);
                     }
                 }
             }
             return progress.value_Renamed;
         }
     }
     return value;
 }
Пример #4
0
			public virtual System.Object Get(IndexReader reader, System.Object key)
			{
				System.Collections.IDictionary innerCache;
				System.Object value_Renamed;
				lock (readerCache.SyncRoot)
				{
					innerCache = (System.Collections.IDictionary) readerCache[reader];
					if (innerCache == null)
					{
						innerCache = new System.Collections.Hashtable();
						readerCache[reader] = innerCache;
						value_Renamed = null;
					}
					else
					{
						value_Renamed = innerCache[key];
					}
					if (value_Renamed == null)
					{
						value_Renamed = new CreationPlaceholder();
						innerCache[key] = value_Renamed;
					}
				}
				if (value_Renamed is CreationPlaceholder)
				{
					lock (value_Renamed)
					{
						CreationPlaceholder progress = (CreationPlaceholder) value_Renamed;
						if (progress.value_Renamed == null)
						{
							progress.value_Renamed = CreateValue(reader, key);
							lock (readerCache.SyncRoot)
							{
								innerCache[key] = progress.value_Renamed;
							}
						}
						return progress.value_Renamed;
					}
				}
				return value_Renamed;
			}