Skip to content

Commit

Permalink
[FIX] immutable list returned
Browse files Browse the repository at this point in the history
immutable list returned -> changed returned value to mutable list
  • Loading branch information
c0smosaur authored Jun 9, 2024
1 parent e71e530 commit b3f3307
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ public class MembershipReservationService {
public List<MembershipResponse> getAllMyMemberships(Member member) {
List<MembershipResponse> individualMembershipResponses =
individualMembershipReservationService.getAllIndividualMemberships(member);
List<MembershipResponse> mutableMembershipResponses = new ArrayList<>(individualMembershipResponses);
MembershipResponse companyMembershipResponse =
companyMembershipReservationService.getCompanyMembership(member);
if (companyMembershipResponse!=null) {
individualMembershipResponses.add(companyMembershipResponse);
return individualMembershipResponses;
mutableMembershipResponses.add(companyMembershipResponse);
return mutableMembershipResponses;
} else {
return individualMembershipResponses;
return mutableMembershipResponses;
}
}

Expand Down

0 comments on commit b3f3307

Please sign in to comment.