[Mono-bugs] [Bug 36109][Nor] Changed - Activator.CreateInstance returns null

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
26 Dec 2002 07:10:09 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mathpup@mylinuxisp.com.

http://bugzilla.ximian.com/show_bug.cgi?id=36109

--- shadow/36109	Thu Dec 26 00:37:55 2002
+++ shadow/36109.tmp.5896	Thu Dec 26 02:10:08 2002
@@ -1,14 +1,14 @@
 Bug#: 36109
 Product: Mono/Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: System
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: mathpup@mylinuxisp.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -60,6 +60,23 @@
 listed exceptions, we weren't expecting that CreateInstance might be returning null.
 
 ------- Additional Comments From mathpup@mylinuxisp.com  2002-12-26 00:37 -------
 Created an attachment (id=3035)
 Test case
 
+
+------- Additional Comments From mathpup@mylinuxisp.com  2002-12-26 02:10 -------
+I found several places in Activator.cs where CreateInstance returns null. I 
+created a patch file that throws the MissingMethodException if an appropriate 
+constructor is not found. The Rotor docs also indicate some other exceptions 
+that provide finer-grained information about that failed, but I wasn't sure how 
+to handle that. 
+ 
+I also noticed that CreateInstanceFrom() returns null under some 
+circumstances. Unlike the case of CreateInstance(), the docs are not consistent 
+about whether CreateInstanceFrom()... In the method 
+CreateInstanceFrom(string assemblyFile, string typeName), it is mentioned 
+that null may be return if the requested type cannot be created, but no 
+mention of null is given in the other overloads. However, there are exceptions 
+that can be throw in various cases I didn't do anything with the 
+CreateInstanceFrom() methods because someone more experienced needs to 
+look at those, perhaps.