@@ -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