Skip to content

Commit

Permalink
refactor/맞춤 장학공고 nullpointer에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyeoungrok committed May 23, 2024
1 parent 1bd6df4 commit f070aaa
Showing 1 changed file with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,28 @@ private boolean compareBasicInfo(ConditionEntity condition, MemberPrivateInfo me
}

private boolean compareGrades(ConditionEntity condition, MemberPrivateInfo memberInfo) {
boolean useThree = memberInfo.getLastGradeOfThree() != null; //F
boolean useThree = memberInfo.getLastGradeOfThree() != null;

if (useThree) {
return (condition.getTotalGradeOfThree() == null || memberInfo.getTotalGradeOfThree() == null || condition.getTotalGradeOfThree() <= memberInfo.getTotalGradeOfThree()) &&
(condition.getLastGradeOfThree() == null || memberInfo.getLastGradeOfThree() == null || condition.getLastGradeOfThree() <= memberInfo.getLastGradeOfThree());
return (condition.getTotalGradeOfThree() == null ||
(memberInfo.getTotalGradeOfThree() != null && condition.getTotalGradeOfThree() <= memberInfo.getTotalGradeOfThree())) &&
(condition.getLastGradeOfThree() == null ||
(memberInfo.getLastGradeOfThree() != null && condition.getLastGradeOfThree() <= memberInfo.getLastGradeOfThree()));
} else {
return (condition.getTotalGradeOfFive() == null || memberInfo.getTotalGradeOfFive() == null || condition.getTotalGradeOfFive() <= memberInfo.getTotalGradeOfFive()) &&
(condition.getLastGradeOfFive() == null || memberInfo.getLastGradeOfFive() == null || condition.getLastGradeOfFive() <= memberInfo.getLastGradeOfFive());
} //T 반환

return (condition.getTotalGradeOfFive() == null ||
(memberInfo.getTotalGradeOfFive() != null && condition.getTotalGradeOfFive() <= memberInfo.getTotalGradeOfFive())) &&
(condition.getLastGradeOfFive() == null ||
(memberInfo.getLastGradeOfFive() != null && condition.getLastGradeOfFive() <= memberInfo.getLastGradeOfFive()));
}
}

private boolean compareIncome(ConditionEntity condition, MemberPrivateInfo memberInfo) {
return (condition.getIncomeQuality() == null || (condition.getIncomeQuality() >= memberInfo.getIncomeQuality())) &&
(condition.getSupportSection()==null || (condition.getSupportSection() >= memberInfo.getSupportSection())) &&
(condition.getMonthlyIncome() == null || condition.getMonthlyIncome() >= memberInfo.getMonthlyIncome());
} //T
return (condition.getIncomeQuality() == null ||
(memberInfo.getIncomeQuality() != null && condition.getIncomeQuality() >= memberInfo.getIncomeQuality())) &&
(condition.getSupportSection() == null ||
(memberInfo.getSupportSection() != null && condition.getSupportSection() >= memberInfo.getSupportSection())) &&
(condition.getMonthlyIncome() == null ||
(memberInfo.getMonthlyIncome() != null && condition.getMonthlyIncome() >= memberInfo.getMonthlyIncome()));
}

}

0 comments on commit f070aaa

Please sign in to comment.