Skip to content

Commit 11a12a6

Browse files
committed
Remove BCL35 references and code.
1 parent eade5e9 commit 11a12a6

File tree

7 files changed

+0
-77
lines changed

7 files changed

+0
-77
lines changed

sdk/src/Core/Amazon.Runtime/CredentialManagement/SharedCredentialsFile.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -827,76 +827,37 @@ private bool TryGetProfile(string profileName, bool doRefresh, bool isSsoSession
827827
AccountIdEndpointMode? accountIdEndpointMode = null;
828828
if (reservedProperties.TryGetValue(AccountIdEndpointModeField, out var accountIdEndpointModeString))
829829
{
830-
#if BCL35
831-
try
832-
{
833-
accountIdEndpointMode = (AccountIdEndpointMode)Enum.Parse(typeof(AccountIdEndpointMode), accountIdEndpointModeString, true);
834-
}
835-
catch (Exception)
836-
{
837-
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string preferred/disabled/required is expected.", accountIdEndpointModeString, AccountIdEndpointModeField, profileName);
838-
profile = null;
839-
return false;
840-
}
841-
#else
842830
if (!Enum.TryParse<AccountIdEndpointMode>(accountIdEndpointModeString, true, out var accountIdEndpointModeTemp))
843831
{
844832
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string preferred/disabled/required is expected.", accountIdEndpointModeString, AccountIdEndpointModeField, profileName);
845833
profile = null;
846834
return false;
847835
}
848836
accountIdEndpointMode = accountIdEndpointModeTemp;
849-
#endif
850837
}
851838

852839
RequestChecksumCalculation? requestChecksumCalculation = null;
853840
if (reservedProperties.TryGetValue(RequestChecksumCalculationField, out var requestChecksumCalculationString))
854841
{
855-
#if BCL35
856-
try
857-
{
858-
requestChecksumCalculation = (RequestChecksumCalculation)Enum.Parse(typeof(RequestChecksumCalculation), requestChecksumCalculationString, true);
859-
}
860-
catch (Exception)
861-
{
862-
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string WHEN_SUPPORTED or WHEN_REQUIRED is expected.", requestChecksumCalculationString, RequestChecksumCalculationField, profileName);
863-
profile = null;
864-
return false;
865-
}
866-
#else
867842
if (!Enum.TryParse<RequestChecksumCalculation>(requestChecksumCalculationString, true, out var requestChecksumCalculationTemp))
868843
{
869844
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string WHEN_SUPPORTED or WHEN_REQUIRED is expected.", requestChecksumCalculationString, RequestChecksumCalculationField, profileName);
870845
profile = null;
871846
return false;
872847
}
873848
requestChecksumCalculation = requestChecksumCalculationTemp;
874-
#endif
875849
}
876850

877851
ResponseChecksumValidation? responseChecksumValidation = null;
878852
if (reservedProperties.TryGetValue(ResponseChecksumValidationField, out var responseChecksumValidationString))
879853
{
880-
#if BCL35
881-
try
882-
{
883-
responseChecksumValidation = (ResponseChecksumValidation)Enum.Parse(typeof(ResponseChecksumValidation), responseChecksumValidationString, true);
884-
}
885-
catch (Exception)
886-
{
887-
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string WHEN_SUPPORTED or WHEN_REQUIRED is expected.", responseChecksumValidationString, ResponseChecksumValidationField, profileName);
888-
profile = null;
889-
return false;
890-
}
891-
#else
892854
if (!Enum.TryParse<ResponseChecksumValidation>(responseChecksumValidationString, true, out var responseChecksumValidationTemp))
893855
{
894856
_logger.InfoFormat("Invalid value {0} for {1} in profile {2}. A string WHEN_SUPPORTED or WHEN_REQUIRED is expected.", responseChecksumValidationString, ResponseChecksumValidationField, profileName);
895857
profile = null;
896858
return false;
897859
}
898860
responseChecksumValidation = responseChecksumValidationTemp;
899-
#endif
900861
}
901862
profile = new CredentialProfile(profileName, profileOptions)
902863
{

sdk/src/Core/Amazon.Runtime/Internal/Util/MultiValueHeaderParser.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,5 @@ private static int AdvanceIndexIfComma(byte[] input, int index)
249249
throw new ArgumentException($"Expected delimiter `{Delimiter}` in input data at index {index}.");
250250
}
251251
}
252-
253-
#if BCL35
254-
private class Tuple<T1, T2>
255-
{
256-
internal T1 Item1 { get; private set; }
257-
internal T2 Item2 { get; private set; }
258-
internal Tuple(T1 item1, T2 item2)
259-
{
260-
Item1 = item1;
261-
Item2 = item2;
262-
}
263-
}
264-
#endif
265252
}
266253
}

sdk/src/Services/S3/Custom/Model/EncryptionTypeMismatchException.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ protected EncryptionTypeMismatchException(System.Runtime.Serialization.Serializa
115115
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
116116
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
117117
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
118-
#if BCL35
119-
[System.Security.Permissions.SecurityPermission(
120-
System.Security.Permissions.SecurityAction.LinkDemand,
121-
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
122-
#endif
123118
[System.Security.SecurityCritical]
124119
// These FxCop rules are giving false-positives for this method
125120
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]

sdk/src/Services/S3/Custom/Model/IdempotencyParameterMismatchException.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ protected IdempotencyParameterMismatchException(System.Runtime.Serialization.Ser
119119
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
120120
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
121121
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
122-
#if BCL35
123-
[System.Security.Permissions.SecurityPermission(
124-
System.Security.Permissions.SecurityAction.LinkDemand,
125-
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
126-
#endif
127122
[System.Security.SecurityCritical]
128123
// These FxCop rules are giving false-positives for this method
129124
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]

sdk/src/Services/S3/Custom/Model/InvalidRequestException.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ protected InvalidRequestException(System.Runtime.Serialization.SerializationInfo
114114
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
115115
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
116116
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
117-
#if BCL35
118-
[System.Security.Permissions.SecurityPermission(
119-
System.Security.Permissions.SecurityAction.LinkDemand,
120-
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
121-
#endif
122117
[System.Security.SecurityCritical]
123118
// These FxCop rules are giving false-positives for this method
124119
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]

sdk/src/Services/S3/Custom/Model/InvalidWriteOffsetException.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ protected InvalidWriteOffsetException(System.Runtime.Serialization.Serialization
114114
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
115115
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
116116
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
117-
#if BCL35
118-
[System.Security.Permissions.SecurityPermission(
119-
System.Security.Permissions.SecurityAction.LinkDemand,
120-
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
121-
#endif
122117
[System.Security.SecurityCritical]
123118
// These FxCop rules are giving false-positives for this method
124119
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]

sdk/src/Services/S3/Custom/Model/TooManyPartsException.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ protected TooManyPartsException(System.Runtime.Serialization.SerializationInfo i
114114
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
115115
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
116116
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
117-
#if BCL35
118-
[System.Security.Permissions.SecurityPermission(
119-
System.Security.Permissions.SecurityAction.LinkDemand,
120-
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
121-
#endif
122117
[System.Security.SecurityCritical]
123118
// These FxCop rules are giving false-positives for this method
124119
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]

0 commit comments

Comments
 (0)