From 8813547ab441382025c1e97286cc3e43f35f0d4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Feb 2020 11:00:53 +0100 Subject: [PATCH] Please cherry-pick: - renamed local variable - added comments --- .../jjobs/model/jobskill/JobPositionSkill.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java b/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java index 872a383..e154a7a 100644 --- a/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java +++ b/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java @@ -142,18 +142,21 @@ public class JobPositionSkill implements SkillableJobPosition { return false; } - final SkillableJobPosition jobPosition = (SkillableJobPosition) object; + // Cast to wanted type + final SkillableJobPosition position = (SkillableJobPosition) object; - if (!Objects.equals(this.getSkillImportance(), jobPosition.getSkillImportance())) { + // Check all false conditions + if (!Objects.equals(this.getSkillImportance(), position.getSkillImportance())) { return false; - } else if (!Objects.equals(this.getJobPosition(), jobPosition.getJobPosition())) { + } else if (!Objects.equals(this.getJobPosition(), position.getJobPosition())) { return false; - } else if (!Objects.equals(this.getJobSkill(), jobPosition.getJobSkill())) { + } else if (!Objects.equals(this.getJobSkill(), position.getJobSkill())) { return false; - } else if (!Objects.equals(this.getJobPositionSkillId(), jobPosition.getJobPositionSkillId())) { + } else if (!Objects.equals(this.getJobPositionSkillId(), position.getJobPositionSkillId())) { return false; } + // Okay, entities are matching (not objects) return true; } -- 2.39.5