[Mono-patches] r63993 - trunk/mcs/class/corlib/System

Zoltan Varga (vargaz AT gmail.com) mono-patches-list at lists.ximian.com
Fri Aug 18 11:43:16 EDT 2006


Author: zoltan
Date: 2006-08-18 11:43:15 -0400 (Fri, 18 Aug 2006)
New Revision: 63993

Modified:
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/Enum.cs
   trunk/mcs/class/corlib/System/Environment.cs
   trunk/mcs/class/corlib/System/Exception.cs
   trunk/mcs/class/corlib/System/Guid.cs
   trunk/mcs/class/corlib/System/Nullable.cs
   trunk/mcs/class/corlib/System/NumberFormatter.cs
   trunk/mcs/class/corlib/System/String.cs
   trunk/mcs/class/corlib/System/TermInfoDriver.cs
   trunk/mcs/class/corlib/System/Version.cs
   trunk/mcs/class/corlib/System/WindowsConsoleDriver.cs
Log:
2006-08-18  Zoltan Varga  <vargaz at gmail.com>

	* *.cs: Use String.Empty instead of "" in a lot of places.


Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/ChangeLog	2006-08-18 15:43:15 UTC (rev 63993)
@@ -1,3 +1,7 @@
+2006-08-18  Zoltan Varga  <vargaz at gmail.com>
+
+	* *.cs: Use String.Empty instead of "" in a lot of places.
+
 2006-08-17  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* DateTime.cs: Remove last patch to DateTime as the fix wasn't correct

Modified: trunk/mcs/class/corlib/System/Enum.cs
===================================================================
--- trunk/mcs/class/corlib/System/Enum.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Enum.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -505,7 +505,7 @@
 
 		static string FormatFlags (Type enumType, object value)
 		{
-			string retVal = "";
+			string retVal = String.Empty;
 			MonoEnumInfo info;
 			MonoEnumInfo.GetInfo (enumType, out info);
 			string asString = value.ToString ();
@@ -527,7 +527,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -543,7 +543,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -559,7 +559,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -575,7 +575,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -591,7 +591,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -607,7 +607,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -623,7 +623,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -639,7 +639,7 @@
 						continue;
 
 					if ((flags & enumValue) == enumValue) {
-						retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
+						retVal = info.names[i] + (retVal == String.Empty ? String.Empty : ", ") + retVal;
 						flags -= enumValue;
 					}
 				}
@@ -648,7 +648,7 @@
 				break;
 			}
 
-			if (retVal == "")
+			if (retVal == String.Empty)
 				return asString;
 
 			return retVal;
@@ -693,7 +693,7 @@
 			if ((formatChar == 'f' || formatChar == 'F'))
 				return FormatFlags (enumType, value);
 
-			retVal = "";
+			retVal = String.Empty;
 			switch (formatChar) {
 			case 'X':
 			case 'x':

Modified: trunk/mcs/class/corlib/System/Environment.cs
===================================================================
--- trunk/mcs/class/corlib/System/Environment.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Environment.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -510,7 +510,7 @@
 		}
 
 		// FIXME: Anyone using this anywhere ?
-		static internal string GetResourceString (string s) { return ""; }
+		static internal string GetResourceString (string s) { return String.Empty; }
 
                 
 #if NET_2_0

Modified: trunk/mcs/class/corlib/System/Exception.cs
===================================================================
--- trunk/mcs/class/corlib/System/Exception.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Exception.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -301,20 +301,20 @@
 
 		internal string GetFullNameForStackTrace (MethodBase mi)
 		{
-			string parms = "";
+			string parms = String.Empty;
 			ParameterInfo[] p = mi.GetParameters ();
 			for (int i = 0; i < p.Length; ++i) {
 				if (i > 0)
 					parms = parms + ", ";
-				string paramName = (p [i].Name == null) ? "" : (" " + p [i].Name);
+				string paramName = (p [i].Name == null) ? String.Empty : (" " + p [i].Name);
 				Type pt = p[i].ParameterType;
-				if (pt.IsClass && pt.Namespace != "")
+				if (pt.IsClass && pt.Namespace != String.Empty)
 					parms = parms + pt.Namespace + "." + pt.Name + paramName;
 				else
 					parms = parms + pt.Name + paramName;
 			}
 
-			string generic = "";
+			string generic = String.Empty;
 #if NET_2_0 || BOOTSTRAP_NET_2_0
 			if (mi.IsGenericMethod) {
 				Type[] gen_params = mi.GetGenericArguments ();

Modified: trunk/mcs/class/corlib/System/Guid.cs
===================================================================
--- trunk/mcs/class/corlib/System/Guid.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Guid.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -598,7 +598,7 @@
 				else if (f == "n") {
 					h = false;
 				}
-				else if (f != "d" && f != "") {
+				else if (f != "d" && f != String.Empty) {
 					throw new FormatException (Locale.GetText (
 						"Argument to Guid.ToString(string format) should be \"b\", \"B\", \"d\", \"D\", \"n\", \"N\", \"p\" or \"P\""));
 				}

Modified: trunk/mcs/class/corlib/System/Nullable.cs
===================================================================
--- trunk/mcs/class/corlib/System/Nullable.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Nullable.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -144,7 +144,7 @@
 			if (has_value)
 				return value.ToString ();
 			else
-				return "";
+				return String.Empty;
 		}
 
 		public static implicit operator Nullable<T> (T value)

Modified: trunk/mcs/class/corlib/System/NumberFormatter.cs
===================================================================
--- trunk/mcs/class/corlib/System/NumberFormatter.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/NumberFormatter.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -788,7 +788,7 @@
 			int length = 0;
 			CustomInfo.GetActiveSection (format,ref p, ns.ZeroOnly, ref offset, ref length);
 			if (length == 0) {
-				return ns.Positive ? "" : nfi.NegativeSign;
+				return ns.Positive ? String.Empty : nfi.NegativeSign;
 			}
 			ns.Positive = p;
 

Modified: trunk/mcs/class/corlib/System/String.cs
===================================================================
--- trunk/mcs/class/corlib/System/String.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/String.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -1290,7 +1290,7 @@
 						formatter = provider.GetFormat (typeof (ICustomFormatter))
 							as ICustomFormatter;
 					if (arg == null)
-						str = "";
+						str = String.Empty;
 					else if (formatter != null)
 						str = formatter.Format (arg_format, arg, provider);
 					else if (arg is IFormattable)
@@ -1800,7 +1800,7 @@
 				else {
 					width = 0;
 					left_align = false;
-					format = "";
+					format = String.Empty;
 				}
 
 				// F = argument format (string)

Modified: trunk/mcs/class/corlib/System/TermInfoDriver.cs
===================================================================
--- trunk/mcs/class/corlib/System/TermInfoDriver.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/TermInfoDriver.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -37,8 +37,8 @@
 		TermInfoReader reader;
 		int cursorLeft;
 		int cursorTop;
-		string title = "";
-		string titleFormat = "";
+		string title = String.Empty;
+		string titleFormat = String.Empty;
 		bool cursorVisible = true;
 		string csrVisible;
 		string csrInvisible;
@@ -78,7 +78,7 @@
 
 		static string SearchTerminfo (string term)
 		{
-			if (term == null || term == "")
+			if (term == null || term == String.Empty)
 				return null;
 
 			// Ignore TERMINFO and TERMINFO_DIRS by now
@@ -200,7 +200,7 @@
 
 			cursorAddress = reader.Get (TermInfoStrings.CursorAddress);
 			if (cursorAddress != null) {
-				string result = cursorAddress.Replace ("%i", "");
+				string result = cursorAddress.Replace ("%i", String.Empty);
 				home_1_1 = (cursorAddress != result);
 				cursorAddress = MangleParameters (result);
 			}
@@ -654,7 +654,7 @@
 
 		public void SetBufferSize (int width, int height)
 		{
-			throw new NotImplementedException ("");
+			throw new NotImplementedException (String.Empty);
 		}
 
 		public void SetCursorPosition (int left, int top)

Modified: trunk/mcs/class/corlib/System/Version.cs
===================================================================
--- trunk/mcs/class/corlib/System/Version.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/Version.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -254,7 +254,7 @@
 		public string ToString (int fields)
 		{
 			if (fields == 0)
-				return "";
+				return String.Empty;
 			if (fields == 1)
 				return _Major.ToString ();
 			if (fields == 2)

Modified: trunk/mcs/class/corlib/System/WindowsConsoleDriver.cs
===================================================================
--- trunk/mcs/class/corlib/System/WindowsConsoleDriver.cs	2006-08-18 15:27:05 UTC (rev 63992)
+++ trunk/mcs/class/corlib/System/WindowsConsoleDriver.cs	2006-08-18 15:43:15 UTC (rev 63993)
@@ -438,7 +438,7 @@
 			SmallRect region = new SmallRect (sourceLeft, sourceTop, sourceLeft + sourceWidth - 1, sourceTop + sourceHeight - 1);
 			fixed (void *ptr = &buffer [0]) {
 				if (!ReadConsoleOutput (outputHandle, ptr, bsize, bpos, ref region))
-					throw new ArgumentException ("", "Cannot read from the specified coordinates.");
+					throw new ArgumentException (String.Empty, "Cannot read from the specified coordinates.");
 			}
 
 			int written;
@@ -453,7 +453,7 @@
 			bpos = new Coord (0, 0);
 			region = new SmallRect (targetLeft, targetTop, targetLeft + sourceWidth - 1, targetTop + sourceHeight - 1);
 			if (!WriteConsoleOutput (outputHandle, buffer, bsize, bpos, ref region))
-				throw new ArgumentException ("", "Cannot write to the specified coordinates.");
+				throw new ArgumentException (String.Empty, "Cannot write to the specified coordinates.");
 		}
 
 		public ConsoleKeyInfo ReadKey (bool intercept)



More information about the Mono-patches mailing list