From 6aeba702eb8ccc99cb58020a9da6d38ceb80a493 Mon Sep 17 00:00:00 2001
From: JustAnotherChristoph
 <47302982+JustAnotherChristoph@users.noreply.github.com>
Date: Tue, 19 Apr 2022 17:50:21 +0200
Subject: [PATCH] Now performing null check on fields appropriately

---
 .../theodolite/benchmark/ResourceSets.kt       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt
index 0626a6e24..2ee8d8cf5 100644
--- a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt
+++ b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt
@@ -11,7 +11,7 @@ import theodolite.util.DeploymentFailedException
 
 @JsonDeserialize
 @RegisterForReflection
-class ResourceSets: KubernetesResource {
+class ResourceSets : KubernetesResource {
     @JsonProperty("configMap")
     @JsonInclude(JsonInclude.Include.NON_NULL)
     var configMap: ConfigMapResourceSet? = null
@@ -21,13 +21,13 @@ class ResourceSets: KubernetesResource {
     var fileSystem: FileSystemResourceSet? = null
 
     fun loadResourceSet(client: NamespacedKubernetesClient): Collection<Pair<String, HasMetadata>> {
-        // TODO Find out whether field access (::configMap) is really what we want to do here (see #362)
-        return if (::configMap != null) {
-                configMap?.getResourceSet(client= client) !!
-            } else if (::fileSystem != null) {
-                fileSystem?.getResourceSet(client= client ) !!
-            } else {
-                throw DeploymentFailedException("Could not load resourceSet.")
-            }
+
+        return if (this.configMap != null) {
+            configMap?.getResourceSet(client = client)!!
+        } else if (this.fileSystem != null) {
+            fileSystem?.getResourceSet(client = client)!!
+        } else {
+            throw DeploymentFailedException("Could not load resourceSet.")
+        }
     }
 }
\ No newline at end of file
-- 
GitLab