Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,9 @@ public static unsafe void RegisterNoGCRegionCallback(long totalSize, Action call
switch (status)
{
case EnableNoGCRegionCallbackStatus.NotStarted:
throw new InvalidOperationException(SR.Format(SR.InvalidOperationException_NoGCRegionNotInProgress));
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionNotInProgress);
case EnableNoGCRegionCallbackStatus.InsufficientBudget:
throw new InvalidOperationException(SR.Format(SR.InvalidOperationException_NoGCRegionAllocationExceeded));
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionAllocationExceeded);
case EnableNoGCRegionCallbackStatus.AlreadyRegistered:
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionCallbackAlreadyRegistered);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ public static unsafe void RegisterNoGCRegionCallback(long totalSize, Action call
switch (status)
{
case EnableNoGCRegionCallbackStatus.NotStarted:
throw new InvalidOperationException(SR.Format(SR.InvalidOperationException_NoGCRegionNotInProgress));
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionNotInProgress);
case EnableNoGCRegionCallbackStatus.InsufficientBudget:
throw new InvalidOperationException(SR.Format(SR.InvalidOperationException_NoGCRegionAllocationExceeded));
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionAllocationExceeded);
case EnableNoGCRegionCallbackStatus.AlreadyRegistered:
throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionCallbackAlreadyRegistered);
}
Expand Down
32 changes: 16 additions & 16 deletions src/libraries/System.Data.OleDb/src/OleDb_Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,19 @@ internal static OleDbException NoErrorInformation(string? provider, OleDbHResult
}
internal static InvalidOperationException MDACNotAvailable(Exception? inner)
{
return ADP.DataAdapter(SR.Format(SR.OleDb_MDACNotAvailable), inner);
return ADP.DataAdapter(SR.OleDb_MDACNotAvailable, inner);
}
internal static ArgumentException MSDASQLNotSupported()
{
return ADP.Argument(SR.Format(SR.OleDb_MSDASQLNotSupported));
return ADP.Argument(SR.OleDb_MSDASQLNotSupported);
}
internal static InvalidOperationException CommandTextNotSupported(string provider, Exception? inner)
{
return ADP.DataAdapter(SR.Format(SR.OleDb_CommandTextNotSupported, provider), inner);
}
internal static InvalidOperationException PossiblePromptNotUserInteractive()
{
return ADP.DataAdapter(SR.Format(SR.OleDb_PossiblePromptNotUserInteractive));
return ADP.DataAdapter(SR.OleDb_PossiblePromptNotUserInteractive);
}
internal static InvalidOperationException ProviderUnavailable(string provider, Exception? inner)
{
Expand All @@ -217,27 +217,27 @@ internal static InvalidOperationException TransactionsNotSupported(string provid
}
internal static ArgumentException AsynchronousNotSupported()
{
return ADP.Argument(SR.Format(SR.OleDb_AsynchronousNotSupported));
return ADP.Argument(SR.OleDb_AsynchronousNotSupported);
}
internal static ArgumentException NoProviderSpecified()
{
return ADP.Argument(SR.Format(SR.OleDb_NoProviderSpecified));
return ADP.Argument(SR.OleDb_NoProviderSpecified);
}
internal static ArgumentException InvalidProviderSpecified()
{
return ADP.Argument(SR.Format(SR.OleDb_InvalidProviderSpecified));
return ADP.Argument(SR.OleDb_InvalidProviderSpecified);
}
internal static ArgumentException InvalidRestrictionsDbInfoKeywords(string parameter)
{
return ADP.Argument(SR.Format(SR.OleDb_InvalidRestrictionsDbInfoKeywords), parameter);
return ADP.Argument(SR.OleDb_InvalidRestrictionsDbInfoKeywords, parameter);
}
internal static ArgumentException InvalidRestrictionsDbInfoLiteral(string parameter)
{
return ADP.Argument(SR.Format(SR.OleDb_InvalidRestrictionsDbInfoLiteral), parameter);
return ADP.Argument(SR.OleDb_InvalidRestrictionsDbInfoLiteral, parameter);
}
internal static ArgumentException InvalidRestrictionsSchemaGuids(string parameter)
{
return ADP.Argument(SR.Format(SR.OleDb_InvalidRestrictionsSchemaGuids), parameter);
return ADP.Argument(SR.OleDb_InvalidRestrictionsSchemaGuids, parameter);
}
internal static ArgumentException NotSupportedSchemaTable(Guid schema, OleDbConnection connection)
{
Expand All @@ -253,15 +253,15 @@ internal static Exception InvalidOleDbType(OleDbType value)
// Getting Data
internal static InvalidOperationException BadAccessor()
{
return ADP.DataAdapter(SR.Format(SR.OleDb_BadAccessor));
return ADP.DataAdapter(SR.OleDb_BadAccessor);
}
internal static InvalidCastException ConversionRequired()
{
return ADP.InvalidCast();
}
internal static InvalidCastException CantConvertValue()
{
return ADP.InvalidCast(SR.Format(SR.OleDb_CantConvertValue));
return ADP.InvalidCast(SR.OleDb_CantConvertValue);
}
internal static InvalidOperationException SignMismatch(Type type)
{
Expand Down Expand Up @@ -299,21 +299,21 @@ internal static InvalidOperationException BadStatusRowAccessor(int i, DBBindStat
}
internal static InvalidOperationException ThreadApartmentState(Exception innerException)
{
return ADP.InvalidOperation(SR.Format(SR.OleDb_ThreadApartmentState), innerException);
return ADP.InvalidOperation(SR.OleDb_ThreadApartmentState, innerException);
}

// OleDbDataAdapter
internal static ArgumentException Fill_NotADODB(string parameter)
{
return ADP.Argument(SR.Format(SR.OleDb_Fill_NotADODB), parameter);
return ADP.Argument(SR.OleDb_Fill_NotADODB, parameter);
}
internal static ArgumentException Fill_EmptyRecordSet(string parameter, Exception innerException)
{
return ADP.Argument(SR.Format(SR.OleDb_Fill_EmptyRecordSet, "IRowset"), parameter, innerException);
}
internal static ArgumentException Fill_EmptyRecord(string parameter, Exception innerException)
{
return ADP.Argument(SR.Format(SR.OleDb_Fill_EmptyRecord), parameter, innerException);
return ADP.Argument(SR.OleDb_Fill_EmptyRecord, parameter, innerException);
}

internal static string NoErrorMessage(OleDbHResult errorcode)
Expand All @@ -331,7 +331,7 @@ internal static string FailedGetSource(OleDbHResult errorcode)

internal static InvalidOperationException DBBindingGetVector()
{
return ADP.InvalidOperation(SR.Format(SR.OleDb_DBBindingGetVector));
return ADP.InvalidOperation(SR.OleDb_DBBindingGetVector);
}

internal static OleDbHResult GetErrorDescription(UnsafeNativeMethods.IErrorInfo errorInfo, OleDbHResult hresult, out string message)
Expand All @@ -357,7 +357,7 @@ internal static ArgumentException ISourcesRowsetNotSupported()
// OleDbMetaDataFactory
internal static InvalidOperationException IDBInfoNotSupported()
{
return ADP.InvalidOperation(SR.Format(SR.OleDb_IDBInfoNotSupported));
return ADP.InvalidOperation(SR.OleDb_IDBInfoNotSupported);
}

// explicitly used error codes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private async Task ProcessDataBlockAsync(Stream archiveStream, bool copyData, Ca
long size = TarHelpers.ParseNumeric<long>(buffer.Slice(FieldLocations.Size, FieldLengths.Size));
if (size < 0)
{
throw new InvalidDataException(SR.Format(SR.TarSizeFieldNegative));
throw new InvalidDataException(SR.TarSizeFieldNegative);
}

// Continue with the rest of the fields that require no special checks
Expand Down Expand Up @@ -680,7 +680,7 @@ private void ReadExtendedAttributesFromBuffer(ReadOnlySpan<byte> buffer, string

if (buffer.Length > 0)
{
throw new InvalidDataException(SR.Format(SR.ExtHeaderInvalidRecords));
throw new InvalidDataException(SR.ExtHeaderInvalidRecords);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ internal static T ParseOctal<T>(ReadOnlySpan<byte> buffer) where T : struct, INu

[DoesNotReturn]
private static void ThrowInvalidNumber() =>
throw new InvalidDataException(SR.Format(SR.TarInvalidNumber));
throw new InvalidDataException(SR.TarInvalidNumber);

// Returns the null-terminated UTF8 string contained in the specified buffer.
internal static string ParseUtf8String(ReadOnlySpan<byte> buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ private static T ParseOctal<T>(ReadOnlySpan<byte> buffer) where T : struct, INum
uint digit = (uint)(b - '0');
if (digit >= 8)
{
throw new InvalidDataException(SR.Format(SR.TarInvalidNumber));
throw new InvalidDataException(SR.TarInvalidNumber);
}

value = checked((value * octalFactor) + T.CreateTruncating(digit));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@
<value>Cannot import null XmlSchema contained in XmlSchemaSet specified via parameter.</value>
</data>
<data name="ComplexTypeRestrictionNotSupported" xml:space="preserve">
<value>An internal error has occurred. Could not load serialization schema. Consider providing schema with namespace '{0}'.</value>
<value>Complex type restriction is not supported.</value>
</data>
<data name="DefaultOnElementNotSupported" xml:space="preserve">
<value>Default value on element '{0}' is not supported.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private Dictionary<XmlQualifiedName, object> GetReferencedTypes()
foreach (Type type in _referencedTypes)
{
if (type == null)
throw new InvalidOperationException(SR.Format(SR.ReferencedTypesCannotContainNull));
throw new InvalidOperationException(SR.ReferencedTypesCannotContainNull);

AddReferencedType(_referencedTypesDictionary, type);
}
Expand All @@ -344,7 +344,7 @@ private Dictionary<XmlQualifiedName, object> GetReferencedCollectionTypes()
foreach (Type type in _referencedCollectionTypes)
{
if (type == null)
throw new InvalidOperationException(SR.Format(SR.ReferencedCollectionTypesCannotContainNull));
throw new InvalidOperationException(SR.ReferencedCollectionTypesCannotContainNull);
AddReferencedType(_referencedCollectionTypesDictionary, type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ private void MoveNext(IDataNode? dataNode)
else
{
Debug.Fail("Encountered invalid data node when deserializing unknown data");
throw new SerializationException(SR.Format(SR.InvalidStateInExtensionDataReader));
throw new SerializationException(SR.InvalidStateInExtensionDataReader);
}
break;
}
Expand Down
Loading
Loading