Skip to content

Commit

Permalink
Using safe Integer comparison
Browse files Browse the repository at this point in the history
(cherry picked from commit 1ad48ce)
  • Loading branch information
gastaldi authored and gsmet committed Aug 14, 2024
1 parent 9478de3 commit cd531ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit cd531ec

Please sign in to comment.