From cd531ec34c6222236cbbc0e07a564df5de3e909c Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 8 Jul 2024 21:18:56 -0300 Subject: [PATCH] Using safe Integer comparison (cherry picked from commit 1ad48ceeae3f273d1533b68a1b5c3b9c2dcdb805) --- .../quarkus/kubernetes/deployment/AddPortToKnativeConfig.java | 2 +- .../kubernetes/deployment/AddPortToKubernetesConfig.java | 2 +- .../quarkus/kubernetes/deployment/AddPortToOpenshiftConfig.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKnativeConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKnativeConfig.java index bb89510d27d3a..6a5cd38ce4d8e 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKnativeConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKnativeConfig.java @@ -29,7 +29,7 @@ public void visit(KnativeConfigFluent config) { */ private boolean hasPort(KnativeConfigFluent config) { for (Port p : config.buildPorts()) { - if (p.getContainerPort() == port.getContainerPort()) { + if (Objects.equals(p.getContainerPort(), port.getContainerPort())) { return true; } } diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKubernetesConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKubernetesConfig.java index c2305c8227fc6..13ac4c240335c 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKubernetesConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToKubernetesConfig.java @@ -29,7 +29,7 @@ public void visit(KubernetesConfigFluent config) { */ private boolean hasPort(KubernetesConfigFluent config) { for (Port p : config.buildPorts()) { - if (p.getContainerPort() == port.getContainerPort()) { + if (Objects.equals(p.getContainerPort(), port.getContainerPort())) { return true; } } diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToOpenshiftConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToOpenshiftConfig.java index 6235424c3a43c..e8077aed4ebd4 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToOpenshiftConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/AddPortToOpenshiftConfig.java @@ -29,7 +29,7 @@ public void visit(OpenshiftConfigFluent config) { */ private boolean hasPort(OpenshiftConfigFluent config) { for (Port p : config.buildPorts()) { - if (p.getContainerPort() == port.getContainerPort()) { + if (Objects.equals(p.getContainerPort(), port.getContainerPort())) { return true; } }