Update ProcessStartInfo to fix some inconsistency
authorMarius Ungureanu <teromario@yahoo.com>
Tue, 25 Nov 2014 14:03:34 +0000 (16:03 +0200)
committerUngureanu Marius <marius.ungureanu@xamarin.com>
Wed, 26 Nov 2014 11:32:58 +0000 (13:32 +0200)
mcs/class/System/System.Diagnostics/ProcessStartInfo.cs

index 1586f6137538b70ab54c159d6cdc5e454c9ae0c6..346f68de74d19ce016c094aec16d2ff7be83f82d 100644 (file)
@@ -47,11 +47,11 @@ namespace System.Diagnostics
        public sealed class ProcessStartInfo 
        {
                /* keep these fields in this order and in sync with metadata/process.h */
-               private string arguments = "";
+               private string arguments;
                private IntPtr error_dialog_parent_handle = (IntPtr)0;
-               private string filename = "";
-               private string verb = "";
-               private string working_directory = "";
+               private string filename;
+               private string verb;
+               private string working_directory;
                private ProcessStringDictionary envVars;
                private bool create_no_window = false;
                private bool error_dialog = false;
@@ -87,7 +87,7 @@ namespace System.Diagnostics
                [NotifyParentPropertyAttribute (true)]
                public string Arguments {
                        get {
-                               return(arguments);
+                               return arguments ?? string.Empty;
                        }
                        set {
                                arguments = value;
@@ -155,7 +155,7 @@ namespace System.Diagnostics
                [NotifyParentPropertyAttribute (true)]
                public string FileName {
                        get {
-                               return(filename);
+                               return filename ?? string.Empty;
                        }
                        set {
                                filename = value;
@@ -187,7 +187,7 @@ namespace System.Diagnostics
                }
                
                [DefaultValue (false)]
-               [MonitoringDescription ("Standart output of this process is redirected.")]
+               [MonitoringDescription ("Standard output of this process is redirected.")]
                [NotifyParentPropertyAttribute (true)]
                public bool RedirectStandardOutput {
                        get {
@@ -226,7 +226,7 @@ namespace System.Diagnostics
                [NotifyParentPropertyAttribute (true)]
                public string Verb {
                        get {
-                               return(verb);
+                               return verb ?? string.Empty;
                        }
                        set {
                                verb = value;
@@ -292,10 +292,10 @@ namespace System.Diagnostics
                [NotifyParentPropertyAttribute (true)]
                public string WorkingDirectory {
                        get {
-                               return(working_directory);
+                               return working_directory ?? string.Empty;
                        }
                        set {
-                               working_directory = value == null ? String.Empty : value;
+                               working_directory = value;
                        }
                }
 
@@ -307,13 +307,13 @@ namespace System.Diagnostics
 
                [NotifyParentPropertyAttribute (true)]
                public string UserName {
-                       get { return username; }
+                       get { return username ?? string.Empty; }
                        set { username = value; }
                }
 
                [NotifyParentPropertyAttribute (true)]
                public string Domain {
-                       get { return domain; }
+                       get { return domain ?? string.Empty; }
                        set { domain = value; }
                }