Skip to content

Commit c618252

Browse files
authored
Remove dead .NET Framework 3.5 code (#3752)
1 parent c4772c1 commit c618252

File tree

9 files changed

+9
-293
lines changed

9 files changed

+9
-293
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"core": {
3+
"changeLogMessages": [
4+
"Remove unused internal legacy .NET Framework 3.5 code."
5+
],
6+
"type": "Patch",
7+
"updateMinimum": true
8+
}
9+
}

sdk/src/Core/Amazon.Runtime/Pipeline/Contexts.cs

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,11 @@ public interface IResponseContext
6363
IWebResponseData HttpResponse { get; set; }
6464
}
6565

66-
public interface IAsyncRequestContext : IRequestContext
67-
{
68-
AsyncCallback Callback { get; }
69-
object State { get; }
70-
}
71-
72-
public interface IAsyncResponseContext : IResponseContext
73-
{
74-
}
75-
7666
public interface IExecutionContext
7767
{
7868
IResponseContext ResponseContext { get; }
7969
IRequestContext RequestContext { get; }
8070
}
81-
82-
public interface IAsyncExecutionContext
83-
{
84-
IAsyncResponseContext ResponseContext { get; }
85-
IAsyncRequestContext RequestContext { get; }
86-
87-
object RuntimeState { get; set; }
88-
}
8971
}
9072

9173
namespace Amazon.Runtime.Internal
@@ -124,9 +106,7 @@ public RequestContext(bool enableMetrics, ISigner clientSigner)
124106
public BaseIdentity Identity { get; set; }
125107
public UserAgentDetails UserAgentDetails { get => ((IAmazonWebServiceRequest)OriginalRequest).UserAgentDetails; }
126108

127-
#if AWS_ASYNC_API
128109
public System.Threading.CancellationToken CancellationToken { get; set; }
129-
#endif
130110

131111
public string RequestName
132112
{
@@ -177,27 +157,12 @@ public IDictionary<string, object> ContextAttributes
177157
public IHttpRequestStreamHandle RequestStreamHandle { get; set; }
178158
}
179159

180-
public class AsyncRequestContext : RequestContext, IAsyncRequestContext
181-
{
182-
public AsyncRequestContext(bool enableMetrics, ISigner clientSigner) :
183-
base(enableMetrics, clientSigner)
184-
{
185-
}
186-
187-
public AsyncCallback Callback { get; set; }
188-
public object State { get; set; }
189-
}
190-
191160
public class ResponseContext : IResponseContext
192161
{
193162
public AmazonWebServiceResponse Response { get; set; }
194163
public IWebResponseData HttpResponse { get; set; }
195164
}
196165

197-
public class AsyncResponseContext : ResponseContext, IAsyncResponseContext
198-
{
199-
}
200-
201166
public class ExecutionContext : IExecutionContext
202167
{
203168
public IRequestContext RequestContext { get; private set; }
@@ -214,29 +179,5 @@ public ExecutionContext(IRequestContext requestContext, IResponseContext respons
214179
this.RequestContext = requestContext;
215180
this.ResponseContext = responseContext;
216181
}
217-
public static IExecutionContext CreateFromAsyncContext(IAsyncExecutionContext asyncContext)
218-
{
219-
return new ExecutionContext(asyncContext.RequestContext,
220-
asyncContext.ResponseContext);
221-
}
222-
}
223-
224-
public class AsyncExecutionContext : IAsyncExecutionContext
225-
{
226-
public IAsyncResponseContext ResponseContext { get; private set; }
227-
public IAsyncRequestContext RequestContext { get; private set; }
228-
public object RuntimeState { get; set; }
229-
230-
public AsyncExecutionContext(bool enableMetrics, ISigner clientSigner)
231-
{
232-
this.RequestContext = new AsyncRequestContext(enableMetrics, clientSigner);
233-
this.ResponseContext = new AsyncResponseContext();
234-
}
235-
236-
public AsyncExecutionContext(IAsyncRequestContext requestContext, IAsyncResponseContext responseContext)
237-
{
238-
this.RequestContext = requestContext;
239-
this.ResponseContext = responseContext;
240-
}
241182
}
242183
}

sdk/src/Core/Amazon.Runtime/Pipeline/_bcl/RuntimeAsyncResult.cs

Lines changed: 0 additions & 142 deletions
This file was deleted.

sdk/src/Core/GlobalSuppressions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@
457457
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.Internal.HttpHandler`1.GetRequestStreamCallbackHelper(System.Object)")]
458458
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.Internal.HttpHandler`1.GetResponseCallbackHelper(System.Object)")]
459459
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.AmazonServiceClient.UpdateSecurityProtocol")]
460-
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.Internal.RuntimeAsyncResult.InvokeCallback")]
461460
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.Internal.Util.GuidUtils.TryParseGuid(System.String,System.Guid@)~System.Boolean")]
462461
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.MonitoringListener.BeginPostMessagesOverUDPInvoke(System.String)")]
463462
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Scope = "member", Target = "~M:Amazon.Runtime.MonitoringListener.EndSendMessagesOverUDPInvoke(System.IAsyncResult)")]

sdk/test/ProtocolTests/Custom/ProtocolTestUtils.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,6 @@ public class NoopPipelineHandler : IPipelineHandler
131131
public IPipelineHandler InnerHandler { get; set; }
132132
public IPipelineHandler OuterHandler { get; set; }
133133

134-
public void AsyncCallback(IAsyncExecutionContext executionContext)
135-
{
136-
}
137-
138-
public IAsyncResult InvokeAsync(IAsyncExecutionContext executionContext)
139-
{
140-
return null;
141-
}
142-
143-
144134
public virtual System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionContext executionContext)
145135
where T : AmazonWebServiceResponse, new()
146136
{

sdk/test/Services/S3/UnitTests/Custom/S3ArnTestUtils.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,6 @@ public class NoopPipelineHandler : IPipelineHandler
8484
public IPipelineHandler InnerHandler { get; set; }
8585
public IPipelineHandler OuterHandler { get; set; }
8686

87-
public void AsyncCallback(IAsyncExecutionContext executionContext)
88-
{
89-
}
90-
91-
public IAsyncResult InvokeAsync(IAsyncExecutionContext executionContext)
92-
{
93-
return null;
94-
}
95-
96-
9787
public virtual System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionContext executionContext)
9888
where T : AmazonWebServiceResponse, new()
9989
{

sdk/test/UnitTests/Custom/Mocking/TestUtils.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ public class NoopPipelineHandler : IPipelineHandler
126126
public IPipelineHandler InnerHandler { get; set; }
127127
public IPipelineHandler OuterHandler { get; set; }
128128

129-
public void AsyncCallback(IAsyncExecutionContext executionContext)
130-
{
131-
}
132-
133-
public IAsyncResult InvokeAsync(IAsyncExecutionContext executionContext)
134-
{
135-
return null;
136-
}
137129
public virtual System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionContext executionContext)
138130
where T : AmazonWebServiceResponse, new()
139131
{

sdk/test/UnitTests/Custom/Runtime/HttpHandlerTests.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,6 @@ private ExecutionContext CreateExecutionContextForListBuckets()
161161
return executionContext;
162162
}
163163

164-
private AsyncExecutionContext CreateAsyncExecutionContextForListBuckets()
165-
{
166-
var listBucketsRequest = new ListBucketsRequest();
167-
var executionContext = new AsyncExecutionContext(
168-
new AsyncRequestContext(true, new NullSigner())
169-
{
170-
ClientConfig = new AmazonS3Config(),
171-
Marshaller = new ListBucketsRequestMarshaller(),
172-
OriginalRequest = listBucketsRequest,
173-
Request = new ListBucketsRequestMarshaller().Marshall(listBucketsRequest),
174-
Unmarshaller = new ListBucketsResponseUnmarshaller()
175-
},
176-
new AsyncResponseContext()
177-
);
178-
179-
// Create and set the internal ServiceMetadata via reflection
180-
var serviceMetaData = Assembly.GetAssembly(executionContext.GetType()).CreateInstance("Amazon.Runtime.Internal.ServiceMetadata");
181-
executionContext.RequestContext.GetType().GetProperty("ServiceMetaData").SetValue(executionContext.RequestContext, serviceMetaData);
182-
183-
executionContext.RequestContext.Request.Endpoint = new Uri(@"http://ListBuckets");
184-
return executionContext;
185-
}
186-
187164
/// <summary>
188165
/// Not thread safe, initialize once for each test.
189166
/// </summary>

sdk/test/UnitTests/Custom/Runtime/RuntimePipelineTestBase.cs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -84,46 +84,6 @@ protected virtual IExecutionContext CreateTestContext(AbstractAWSSigner signer,
8484
HttpResponse = new HttpWebRequestResponseData(putObjectResponse)
8585
});
8686
}
87-
88-
protected IAsyncExecutionContext CreateAsyncTestContext()
89-
{
90-
return CreateAsyncTestContext(null);
91-
}
92-
93-
protected IAsyncExecutionContext CreateAsyncTestContext(AbstractAWSSigner signer)
94-
{
95-
var putObjectRequest = new PutObjectRequest
96-
{
97-
Key = "Test",
98-
BucketName = "Test",
99-
ContentBody = "Test Content"
100-
};
101-
var requestContext = new AsyncRequestContext(true, signer == null ? new NullSigner() : signer)
102-
{
103-
OriginalRequest = putObjectRequest,
104-
Request = new PutObjectRequestMarshaller().Marshall(putObjectRequest),
105-
Unmarshaller = PutObjectResponseUnmarshaller.Instance,
106-
ClientConfig = new AmazonS3Config{
107-
RegionEndpoint = RegionEndpoint.USEast1
108-
}
109-
};
110-
111-
// Create and set the internal ServiceMetadata via reflection
112-
var serviceMetaData = Assembly.GetAssembly(requestContext.GetType()).CreateInstance("Amazon.Runtime.Internal.ServiceMetadata");
113-
requestContext.GetType().GetProperty("ServiceMetaData").SetValue(requestContext, serviceMetaData);
114-
115-
requestContext.Request.Endpoint = new Uri("https://s3.amazonaws.com");
116-
117-
var putObjectResponse = MockWebResponse.CreateFromResource("PutObjectResponse.txt")
118-
as HttpWebResponse;
119-
return new Amazon.Runtime.Internal.AsyncExecutionContext(
120-
requestContext,
121-
new AsyncResponseContext
122-
{
123-
HttpResponse = new HttpWebRequestResponseData(putObjectResponse)
124-
}
125-
);
126-
}
12787
}
12888

12989
public abstract class RuntimePipelineTestBase<T> : RuntimePipelineTestBase where T : IPipelineHandler

0 commit comments

Comments
 (0)