[Mono-bugs] [Bug 64230][Cos] New - Type.Namespace returns empty string instead of null

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 26 Aug 2004 19:05:59 -0400 (EDT)

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 priewasser@gmx.at.


--- shadow/64230	2004-08-26 19:05:59.000000000 -0400
+++ shadow/64230.tmp.28606	2004-08-26 19:05:59.000000000 -0400
@@ -0,0 +1,48 @@
+Bug#: 64230
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Cosmetic
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: priewasser@gmx.at               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Type.Namespace returns empty string instead of null
+Description of Problem:
+The property Type.Namespace returns an empty string if no namespace is 
+defined for a type, .Net returns null in this case.
+(I don't know which solution is better, the .Net or the mono, but the 
+property should return the same value in both environments)
+Steps to reproduce the problem:
+Run this code:
+public class NameSp{
+    public static void Main(){
+        System.Type myType = System.Type.GetType("NameSp");
+        System.Console.WriteLine("myType.Namespace==null : "+(myType.
+        System.Console.WriteLine("myType.Namespace==\"\"   : "+(myType.
+    }
+Actual Results:
+myType.Namespace==null : False
+myType.Namespace==""   : True
+Expected Results:
+myType.Namespace==null : True
+myType.Namespace==""   : False
+How often does this happen?