[netcore] Change an ArrayList to a List<T>. (mono/mono#16842)
authorZoltan Varga <vargaz@gmail.com>
Mon, 16 Sep 2019 00:45:13 +0000 (20:45 -0400)
committerSteve Pfister <steveisok@users.noreply.github.com>
Mon, 16 Sep 2019 00:45:13 +0000 (20:45 -0400)
* [netcore] Change an ArrayList to a List<T>.

* [netcore] Call the generic version of Array.IndexOf () in the ICollection wrappers. Update exclusions file.

Commit migrated from https://github.com/mono/mono/commit/cdb04c042f1e57053047e28373ef35fe2a898270

src/mono/netcore/System.Private.CoreLib/src/LinkerDescriptor/System.Private.CoreLib.xml
src/mono/netcore/System.Private.CoreLib/src/System.Reflection.Emit/ILGenerator.cs
src/mono/netcore/System.Private.CoreLib/src/System/Array.cs

index 8ab7011..548692c 100644 (file)
                        <!-- mono_exception_from_name -->
                        <method signature="System.Void .ctor()" />
                </type>
+
+               <type fullname="System.Security.VerificationException" >
+                 <!-- mini.c:mini_method_verify -->
+                 <method signature="System.Void .ctor()" />
+               </type>
                
                <!-- domain.c: mono_defaults.array_class -->
                <type fullname="System.Array">
                        <method signature="System.Void .ctor()" />
                </type>
 
+               <!-- domain.c: mono_defaults.threadabortexception_class -->
+               <type fullname="System.Threading.ThreadAbortException">
+               </type>
+
                <!-- debugger-agent.c: create_event_list -->
                <type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute"/>
                <type fullname="System.Diagnostics.DebuggerHiddenAttribute"/>
                -->
                <type fullname="System.DllNotFoundException">
                        <!-- mono_exception_from_name_msg -->
-                       <method signature="System.Void .ctor(System.String)" />
+                       <method signature="System.Void .ctor()" />
                </type>
                
                <!-- domain.c: mono_defaults.double_class -->
                <!-- exception.c (mono_get_exception_execution_engine) -->
                <type fullname="System.ExecutionEngineException">
                        <!-- mono_exception_from_name_msg -->
-                       <method signature="System.Void .ctor(System.String)" />
+                       <method signature="System.Void .ctor()" />
                </type>
 
                <type fullname="System.FieldAccessException">
         
                <type fullname="System.MissingMethodException">
                        <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
-                       <method signature="System.Void .ctor(System.String)" />
+                       <method signature="System.Void .ctor()" />
                </type>
                
                <!-- threadpool.c: mono_thread_pool_init (assert) -->
                
                <!-- domain.c: mono_defaults.methodhandle_class -->
                <type fullname="System.RuntimeMethodHandle" preserve="fields" />
-               
+
+               <!-- domain.c: mono_defaults.runtimetype_class -->
+               <type fullname="System.RuntimeType" preserve="fields" />
+
                <!-- domain.c: mono_defaults.typehandle_class -->
                <type fullname="System.RuntimeTypeHandle" preserve="fields" />
 
                <type fullname="System.AppContext">
                  <!-- appdomain.c: mono_runtime_install_appctx_properties -->
                  <method name="Setup"/>
+                 <method name="OnProcessExit"/>
                </type>
 
                <typename fullname="Mono.NullByRefReturnException">
index 5f19d65..4a513c5 100644 (file)
@@ -34,7 +34,6 @@
 
 #if MONO_FEATURE_SRE
 using System;
-using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics.SymbolStore;
 using System.Runtime.InteropServices;
@@ -231,7 +230,7 @@ namespace System.Reflection.Emit {
                const int defaultLabelsSize = 4;
                const int defaultExceptionStackSize = 2;
                
-               ArrayList sequencePointLists;
+               List<SequencePointList> sequencePointLists;
                SequencePointList currentSequence;
 
                internal ILGenerator (Module m, TokenGenerator token_gen, int size)
@@ -908,7 +907,7 @@ namespace System.Reflection.Emit {
                {
                        if (currentSequence == null || currentSequence.Document != document) {
                                if (sequencePointLists == null)
-                                       sequencePointLists = new ArrayList ();
+                                       sequencePointLists = new List<SequencePointList> ();
                                currentSequence = new SequencePointList (document);
                                sequencePointLists.Add (currentSequence);
                        }
index a9b2015..403fccf 100644 (file)
@@ -553,7 +553,7 @@ namespace System
 
                internal bool InternalArray__ICollection_Contains<T> (T item)
                {
-                       return IndexOf (this, item, 0, Length) >= 0;
+                       return IndexOf ((T[])this, item, 0, Length) >= 0;
                }
 
                internal void InternalArray__ICollection_CopyTo<T> (T[] array, int arrayIndex)
@@ -588,7 +588,7 @@ namespace System
 
                internal int InternalArray__IndexOf<T> (T item)
                {
-                       return IndexOf (this, item, 0, Length);
+                       return IndexOf ((T[])this, item, 0, Length);
                }
 
                internal T InternalArray__get_Item<T> (int index)