Skip to content

Commit e8cf4b1

Browse files
committed
fix SA1211
1 parent b416444 commit e8cf4b1

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private void SetUserDetails(K8SConfiguration k8SConfig, Context activeContext)
333333
var config = userDetails.UserCredentials.AuthProvider.Config;
334334
if (config.ContainsKey("expires-on"))
335335
{
336-
var expiresOn = Int32.Parse(config["expires-on"]);
336+
var expiresOn = int.Parse(config["expires-on"]);
337337
DateTimeOffset expires;
338338
#if NET452
339339
var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);

src/KubernetesClient/KubernetesClientConfiguration.InCluster.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public partial class KubernetesClientConfiguration
1616
private const string ServiceAccountTokenKeyFileName = "token";
1717
private const string ServiceAccountRootCAKeyFileName = "ca.crt";
1818

19-
public static Boolean IsInCluster()
19+
public static bool IsInCluster()
2020
{
2121
var host = Environment.GetEnvironmentVariable("KUBERNETES_SERVICE_HOST");
2222
var port = Environment.GetEnvironmentVariable("KUBERNETES_SERVICE_PORT");

src/KubernetesClient/Yaml.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ByteArrayStringYamlConverter : IYamlTypeConverter
2222
{
2323
public bool Accepts(Type type)
2424
{
25-
return type == typeof(System.Byte[]);
25+
return type == typeof(byte[]);
2626
}
2727

2828
public object ReadYaml(IParser parser, Type type)
@@ -49,7 +49,7 @@ public object ReadYaml(IParser parser, Type type)
4949

5050
public void WriteYaml(IEmitter emitter, object value, Type type)
5151
{
52-
var obj = (System.Byte[])value;
52+
var obj = (byte[])value;
5353
emitter.Emit(new YamlDotNet.Core.Events.Scalar(Encoding.UTF8.GetString(obj)));
5454
}
5555
}
@@ -63,7 +63,7 @@ public void WriteYaml(IEmitter emitter, object value, Type type)
6363
/// <param name="typeMap">
6464
/// A map from <apiVersion>/<kind> to Type. For example "v1/Pod" -> typeof(V1Pod)
6565
/// </param>
66-
public static async Task<List<object>> LoadAllFromStreamAsync(Stream stream, Dictionary<String, Type> typeMap)
66+
public static async Task<List<object>> LoadAllFromStreamAsync(Stream stream, Dictionary<string, Type> typeMap)
6767
{
6868
var reader = new StreamReader(stream);
6969
var content = await reader.ReadToEndAsync().ConfigureAwait(false);
@@ -79,7 +79,7 @@ public static async Task<List<object>> LoadAllFromStreamAsync(Stream stream, Dic
7979
/// <param name="typeMap">
8080
/// A map from <apiVersion>/<kind> to Type. For example "v1/Pod" -> typeof(V1Pod)
8181
/// </param>
82-
public static Task<List<object>> LoadAllFromFileAsync(String fileName, Dictionary<String, Type> typeMap)
82+
public static Task<List<object>> LoadAllFromFileAsync(string fileName, Dictionary<string, Type> typeMap)
8383
{
8484
var reader = File.OpenRead(fileName);
8585
return LoadAllFromStreamAsync(reader, typeMap);
@@ -94,7 +94,7 @@ public static Task<List<object>> LoadAllFromFileAsync(String fileName, Dictionar
9494
/// <param name="typeMap">
9595
/// A map from <apiVersion>/<kind> to Type. For example "v1/Pod" -> typeof(V1Pod)
9696
/// </param>
97-
public static List<object> LoadAllFromString(String content, Dictionary<String, Type> typeMap)
97+
public static List<object> LoadAllFromString(string content, Dictionary<string, Type> typeMap)
9898
{
9999
var deserializer =
100100
new DeserializerBuilder()
@@ -221,7 +221,7 @@ private IPropertyDescriptor TrimPropertySuffix(IPropertyDescriptor pd, Type type
221221
// This might have been renamed by AutoRest. See if there is a
222222
// JsonPropertyAttribute.PropertyName and use that instead if there is.
223223
var jpa = pd.GetCustomAttribute<JsonPropertyAttribute>();
224-
if (jpa == null || String.IsNullOrEmpty(jpa.PropertyName))
224+
if (jpa == null || string.IsNullOrEmpty(jpa.PropertyName))
225225
{
226226
return pd;
227227
}

tests/KubernetesClient.Tests/Logging/TestOutputLogger.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public TestOutputLogger(ITestOutputHelper testOutput, string loggerCategory, Log
3030
throw new ArgumentNullException(nameof(testOutput));
3131
}
3232

33-
if (String.IsNullOrWhiteSpace(loggerCategory))
33+
if (string.IsNullOrWhiteSpace(loggerCategory))
3434
{
3535
throw new ArgumentException(
3636
"Argument cannot be null, empty, or entirely composed of whitespace: 'loggerCategory'.",
@@ -83,7 +83,7 @@ public void Log<TState>(LogLevel level, EventId eventId, TState state, Exception
8383
throw new ArgumentNullException(nameof(formatter));
8484
}
8585

86-
TestOutput.WriteLine(String.Format("[{0}] {1}: {2}",
86+
TestOutput.WriteLine(string.Format("[{0}] {1}: {2}",
8787
level,
8888
LoggerCategory,
8989
formatter(state, exception)));

tests/KubernetesClient.Tests/YamlTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void LoadAllFromString()
2323
metadata:
2424
name: ns";
2525

26-
var types = new Dictionary<String, Type>();
26+
var types = new Dictionary<string, Type>();
2727
types.Add("v1/Pod", typeof(V1Pod));
2828
types.Add("v1/Namespace", typeof(V1Namespace));
2929

0 commit comments

Comments
 (0)