Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3ec09b8

Browse files
stephentoubjkotas
authored andcommitted
Add ICloneable back to several globalization types on Unix (#6307)
The globalization implementation used for corefx on Unix came from corert, which didn't have ICloneable, and thus the globalization types that implement ICloneable in desktop and coreclr on Windows don't on Unix. Now that ICloneable is coming back, we need these types to implement ICloneable appropriately.
1 parent 91eb031 commit 3ec09b8

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/mscorlib/corefx/System/Globalization/Calendar.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace System.Globalization
3131

3232

3333
[System.Runtime.InteropServices.ComVisible(true)]
34-
public abstract class Calendar
34+
public abstract class Calendar : ICloneable
3535
{
3636
// Number of 100ns (10E-7 second) ticks per time unit
3737
internal const long TicksPerMillisecond = 10000;
@@ -143,11 +143,11 @@ public bool IsReadOnly
143143
//
144144
// Clone
145145
//
146-
// Is the implementation of IColnable.
146+
// Is the implementation of ICloneable.
147147
//
148148
////////////////////////////////////////////////////////////////////////
149149
[System.Runtime.InteropServices.ComVisible(false)]
150-
internal virtual Object Clone()
150+
public virtual object Clone()
151151
{
152152
object o = MemberwiseClone();
153153
((Calendar)o).SetReadOnlyState(false);

src/mscorlib/corefx/System/Globalization/CultureInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace System.Globalization
4747
using StringCultureInfoDictionary = LowLevelDictionary<string, CultureInfo>;
4848
#endif
4949

50-
public partial class CultureInfo : IFormatProvider
50+
public partial class CultureInfo : IFormatProvider, ICloneable
5151
{
5252
//--------------------------------------------------------------------//
5353
// Internal Information //

src/mscorlib/corefx/System/Globalization/DateTimeFormatInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ internal enum DateTimeFormatFlags
5555

5656

5757
[System.Runtime.InteropServices.ComVisible(true)]
58-
public sealed class DateTimeFormatInfo : IFormatProvider
58+
public sealed class DateTimeFormatInfo : IFormatProvider, ICloneable
5959
{
6060
// cache for the invariant culture.
6161
// invariantInfo is constant irrespective of your current culture.

src/mscorlib/corefx/System/Globalization/NumberFormatInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace System.Globalization
4141
//
4242

4343
[System.Runtime.InteropServices.ComVisible(true)]
44-
sealed public class NumberFormatInfo : IFormatProvider
44+
sealed public class NumberFormatInfo : IFormatProvider, ICloneable
4545
{
4646
// invariantInfo is constant irrespective of your current culture.
4747
private static volatile NumberFormatInfo invariantInfo;

src/mscorlib/corefx/System/Globalization/TextInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
namespace System.Globalization
2727
{
28-
public partial class TextInfo
28+
public partial class TextInfo : ICloneable
2929
{
3030
////--------------------------------------------------------------------//
3131
//// Internal Information //
@@ -145,7 +145,7 @@ public bool IsReadOnly
145145
//// Is the implementation of IColnable.
146146
////
147147
//////////////////////////////////////////////////////////////////////////
148-
internal virtual Object Clone()
148+
public virtual Object Clone()
149149
{
150150
object o = MemberwiseClone();
151151
((TextInfo)o).SetReadOnlyState(false);

src/mscorlib/src/System/Globalization/Calendar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public bool IsReadOnly
170170
//
171171
// Clone
172172
//
173-
// Is the implementation of IColnable.
173+
// Is the implementation of ICloneable.
174174
//
175175
////////////////////////////////////////////////////////////////////////
176176
[System.Runtime.InteropServices.ComVisible(false)]

src/mscorlib/src/System/Globalization/TextInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public bool IsReadOnly
433433
//
434434
// Clone
435435
//
436-
// Is the implementation of IColnable.
436+
// Is the implementation of ICloneable.
437437
//
438438
////////////////////////////////////////////////////////////////////////
439439
[System.Runtime.InteropServices.ComVisible(false)]

0 commit comments

Comments
 (0)