Skip to content

Commit 6a6de1f

Browse files
Make HttpClient static in JdkInstaller (#291)
Context: https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines#recommended-use * Make HttpClient static in JdkInstaller per Microsoft guidelines Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
1 parent 5f98fec commit 6a6de1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Xamarin.Android.Tools.AndroidSdk/JdkInstaller.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public class JdkInstaller : IDisposable
3030

3131
static readonly IProgress<JdkInstallProgress> NullProgress = new Progress<JdkInstallProgress> ();
3232

33-
readonly HttpClient httpClient = new();
33+
static readonly HttpClient httpClient = new();
3434
readonly Action<TraceLevel, string> logger;
3535

3636
public JdkInstaller (Action<TraceLevel, string>? logger = null)
3737
{
3838
this.logger = logger ?? AndroidSdkInfo.DefaultConsoleLogger;
3939
}
4040

41-
public void Dispose () => httpClient.Dispose ();
41+
public void Dispose () { }
4242

4343
/// <summary>Discovers available Microsoft OpenJDK versions for the current platform.</summary>
4444
public async Task<IReadOnlyList<JdkVersionInfo>> DiscoverAsync (CancellationToken cancellationToken = default)

0 commit comments

Comments
 (0)