Skip to content

Commit 43e50c6

Browse files
Renamed ContextAwareHashtable to CollectibleKeyHashtable
1 parent 7467087 commit 43e50c6

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/libraries/System.ComponentModel.TypeConverter/src/System.ComponentModel.TypeConverter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<Compile Include="System\ComponentModel\UInt64Converter.cs" />
4646
<Compile Include="System\ComponentModel\UriTypeConverter.cs" />
4747
<Compile Include="System\ComponentModel\VersionConverter.cs" />
48-
<Compile Include="System\ComponentModel\ContextAwareHashtable.cs" />
48+
<Compile Include="System\ComponentModel\CollectibleKeyHashtable.cs" />
4949
<Compile Include="System\Timers\ElapsedEventArgs.cs" />
5050
<Compile Include="System\Timers\ElapsedEventHandler.cs" />
5151
<Compile Include="System\Timers\Timer.cs">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace System.ComponentModel
1515
/// This ensures that collectible <see cref="MemberInfo"/> instances (such as those from collectible assemblies) do not prevent their assemblies from being unloaded.
1616
/// </para>
1717
/// </summary>
18-
internal sealed class ContextAwareHashtable
18+
internal sealed class CollectibleKeyHashtable
1919
{
2020
private readonly Hashtable _defaultTable = new Hashtable();
2121
private readonly ConditionalWeakTable<object, object?> _collectibleTable = new ConditionalWeakTable<object, object?>();

src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ internal sealed partial class ReflectTypeDescriptionProvider : TypeDescriptionPr
4848
// on Control, Component and object are also automatically filled
4949
// in. The keys to the property and event caches are types.
5050
// The keys to the attribute cache are either MemberInfos or types.
51-
private static ContextAwareHashtable? s_propertyCache;
52-
private static ContextAwareHashtable? s_eventCache;
53-
private static ContextAwareHashtable? s_attributeCache;
54-
private static ContextAwareHashtable? s_extendedPropertyCache;
51+
private static CollectibleKeyHashtable? s_propertyCache;
52+
private static CollectibleKeyHashtable? s_eventCache;
53+
private static CollectibleKeyHashtable? s_attributeCache;
54+
private static CollectibleKeyHashtable? s_extendedPropertyCache;
5555

5656
// These are keys we stuff into our object cache. We use this
5757
// cache data to store extender provider info for an object.
@@ -192,13 +192,13 @@ private static Dictionary<object, IntrinsicTypeConverterData> IntrinsicTypeConve
192192
Justification = "IntrinsicTypeConverters is marked with RequiresUnreferencedCode. It is the only place that should call this.")]
193193
private static NullableConverter CreateNullableConverter(Type type) => new NullableConverter(type);
194194

195-
private static ContextAwareHashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new ContextAwareHashtable());
195+
private static CollectibleKeyHashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new CollectibleKeyHashtable());
196196

197-
private static ContextAwareHashtable EventCache => LazyInitializer.EnsureInitialized(ref s_eventCache, () => new ContextAwareHashtable());
197+
private static CollectibleKeyHashtable EventCache => LazyInitializer.EnsureInitialized(ref s_eventCache, () => new CollectibleKeyHashtable());
198198

199-
private static ContextAwareHashtable AttributeCache => LazyInitializer.EnsureInitialized(ref s_attributeCache, () => new ContextAwareHashtable());
199+
private static CollectibleKeyHashtable AttributeCache => LazyInitializer.EnsureInitialized(ref s_attributeCache, () => new CollectibleKeyHashtable());
200200

201-
private static ContextAwareHashtable ExtendedPropertyCache => LazyInitializer.EnsureInitialized(ref s_extendedPropertyCache, () => new ContextAwareHashtable());
201+
private static CollectibleKeyHashtable ExtendedPropertyCache => LazyInitializer.EnsureInitialized(ref s_extendedPropertyCache, () => new CollectibleKeyHashtable());
202202

203203
/// <summary>Clear the global caches this maintains on top of reflection.</summary>
204204
internal static void ClearReflectionCaches()
@@ -1095,7 +1095,7 @@ internal bool IsPopulated(Type type)
10951095
/// </summary>
10961096
internal static Attribute[] ReflectGetAttributes(Type type)
10971097
{
1098-
ContextAwareHashtable attributeCache = AttributeCache;
1098+
CollectibleKeyHashtable attributeCache = AttributeCache;
10991099
Attribute[]? attrs = (Attribute[]?)attributeCache[type];
11001100
if (attrs != null)
11011101
{
@@ -1123,7 +1123,7 @@ internal static Attribute[] ReflectGetAttributes(Type type)
11231123
/// </summary>
11241124
internal static Attribute[] ReflectGetAttributes(MemberInfo member)
11251125
{
1126-
ContextAwareHashtable attributeCache = AttributeCache;
1126+
CollectibleKeyHashtable attributeCache = AttributeCache;
11271127
Attribute[]? attrs = (Attribute[]?)attributeCache[member];
11281128
if (attrs != null)
11291129
{
@@ -1151,7 +1151,7 @@ internal static Attribute[] ReflectGetAttributes(MemberInfo member)
11511151
/// </summary>
11521152
private static EventDescriptor[] ReflectGetEvents(Type type)
11531153
{
1154-
ContextAwareHashtable eventCache = EventCache;
1154+
CollectibleKeyHashtable eventCache = EventCache;
11551155
EventDescriptor[]? events = (EventDescriptor[]?)eventCache[type];
11561156
if (events != null)
11571157
{
@@ -1251,7 +1251,7 @@ private static PropertyDescriptor[] ReflectGetExtendedProperties(IExtenderProvid
12511251
// property store.
12521252
//
12531253
Type providerType = provider.GetType();
1254-
ContextAwareHashtable extendedPropertyCache = ExtendedPropertyCache;
1254+
CollectibleKeyHashtable extendedPropertyCache = ExtendedPropertyCache;
12551255
ReflectPropertyDescriptor[]? extendedProperties = (ReflectPropertyDescriptor[]?)extendedPropertyCache[providerType];
12561256
if (extendedProperties == null)
12571257
{
@@ -1336,7 +1336,7 @@ private static PropertyDescriptor[] ReflectGetPropertiesFromRegisteredType(Type
13361336

13371337
private static PropertyDescriptor[] ReflectGetPropertiesImpl(Type type)
13381338
{
1339-
ContextAwareHashtable propertyCache = PropertyCache;
1339+
CollectibleKeyHashtable propertyCache = PropertyCache;
13401340
PropertyDescriptor[]? properties = (PropertyDescriptor[]?)propertyCache[type];
13411341
if (properties != null)
13421342
{

0 commit comments

Comments
 (0)