public Get ( Lucene.Net.Index.IndexReader reader, Entry key ) : |
||
reader | Lucene.Net.Index.IndexReader | |
key | Entry | |
return |
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;
}