Author: robertj
Date: 2006-01-16 14:24:18 -0500 (Mon, 16 Jan 2006)
New Revision: 55648
Modified:
trunk/mcs/class/corlib/System.Resources/ChangeLog
trunk/mcs/class/corlib/System.Resources/ResourceManager.cs
trunk/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
Log:
Reverted until I get more details. See #77242.
Modified: trunk/mcs/class/corlib/System.Resources/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Resources/ChangeLog 2006-01-16 19:19:02 UTC
(rev 55647)
+++ trunk/mcs/class/corlib/System.Resources/ChangeLog 2006-01-16 19:24:18 UTC
(rev 55648)
@@ -1,9 +1,3 @@
-2006-01-13 Robert Jordan <[EMAIL PROTECTED]>
-
- * ResourceManager.cs: Fixed GetString/GetObject's recursion
- which never fall back to the invariant or neutral culture if
- the key was not found in a specific culture. Fixes bug #77242.
-
2005-11-19 Zoltan Varga <[EMAIL PROTECTED]>
* Win32Resources.cs: Add a new 'FileVersion' property.
Modified: trunk/mcs/class/corlib/System.Resources/ResourceManager.cs
===================================================================
--- trunk/mcs/class/corlib/System.Resources/ResourceManager.cs 2006-01-16
19:19:02 UTC (rev 55647)
+++ trunk/mcs/class/corlib/System.Resources/ResourceManager.cs 2006-01-16
19:24:18 UTC (rev 55648)
@@ -9,7 +9,7 @@
//
//
-// Copyright (C) 2004, 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -161,37 +161,44 @@
return(GetObject(name, null));
}
- public virtual object GetObject (string name, CultureInfo
culture)
+ public virtual object GetObject(string name, CultureInfo
culture)
{
- if (name == null) {
- throw new ArgumentNullException("name");
+ if(name==null) {
+ throw new ArgumentNullException("name is null");
}
- if (culture == null) {
- culture = CultureInfo.CurrentUICulture;
+ if(culture==null) {
+ culture=CultureInfo.CurrentUICulture;
}
- lock (this) {
- while (true) {
-
- ResourceSet set =
InternalGetResourceSet (culture, true, true);
+ lock(this) {
+ ResourceSet set=InternalGetResourceSet(culture,
true, true);
+ object obj=null;
- if (set != null) {
- object obj =
set.GetObject(name, ignoreCase);
- if (obj != null) {
- return obj;
- }
+ if(set != null) {
+ obj=set.GetObject(name, ignoreCase);
+ if(obj != null) {
+ return(obj);
}
+ }
+
+ /* Try parent cultures */
- if (culture == neutral_culture ||
- culture ==
CultureInfo.InvariantCulture)
- break;
+ do {
+ culture=culture.Parent;
- culture = culture.Parent;
- }
+ set=InternalGetResourceSet(culture,
true, true);
+ if(set!=null) {
+ obj=set.GetObject(name,
ignoreCase);
+ if(obj != null) {
+ return(obj);
+ }
+ }
+ } while(!culture.Equals(neutral_culture) &&
+
!culture.Equals(CultureInfo.InvariantCulture));
}
- return null;
+ return(null);
}
@@ -216,33 +223,41 @@
public virtual string GetString (string name, CultureInfo
culture)
{
if (name == null) {
- throw new ArgumentNullException ("name");
+ throw new ArgumentNullException ("Name is
null.");
}
- if(culture == null) {
- culture = CultureInfo.CurrentUICulture;
+ if(culture==null) {
+ culture=CultureInfo.CurrentUICulture;
}
- lock (this) {
- while (true) {
- ResourceSet set =
InternalGetResourceSet (culture, true, true);
+ lock(this) {
+ ResourceSet set=InternalGetResourceSet(culture,
true, true);
+ string str=null;
- if (set != null) {
- string str = set.GetString
(name, ignoreCase);
- if (str != null) {
- return str;
- }
+ if(set!=null) {
+ str=set.GetString(name, ignoreCase);
+ if(str!=null) {
+ return(str);
}
+ }
- if (culture == neutral_culture ||
- culture ==
CultureInfo.InvariantCulture)
- break;
+ /* Try parent cultures */
- culture = culture.Parent;
- }
+ do {
+ culture=culture.Parent;
+
+ set=InternalGetResourceSet(culture,
true, true);
+ if(set!=null) {
+ str=set.GetString(name,
ignoreCase);
+ if(str!=null) {
+ return(str);
+ }
+ }
+ } while(!culture.Equals(neutral_culture) &&
+
!culture.Equals(CultureInfo.InvariantCulture));
}
- return null;
+ return(null);
}
protected virtual string GetResourceFileName (CultureInfo
culture)
Modified: trunk/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
2006-01-16 19:19:02 UTC (rev 55647)
+++ trunk/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
2006-01-16 19:24:18 UTC (rev 55648)
@@ -42,6 +42,7 @@
public class ResourceManagerTest
{
[Test]
+ [Category ("NotWorking")]
public void TestInvariantCulture ()
{
Thread.CurrentThread.CurrentUICulture =
CultureInfo.InvariantCulture;
@@ -52,6 +53,7 @@
}
[Test]
+ [Category ("NotWorking")]
public void TestGermanCulture ()
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo
("de-DE");
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches