1 | package edu.ucsb.cs156.happiercows.entities; | |
2 | ||
3 | import lombok.Data; | |
4 | ||
5 | import com.fasterxml.jackson.annotation.JsonGetter; | |
6 | ||
7 | ||
8 | import lombok.AllArgsConstructor; | |
9 | import lombok.NoArgsConstructor; | |
10 | import lombok.Builder; | |
11 | ||
12 | ||
13 | @Data | |
14 | @AllArgsConstructor | |
15 | @NoArgsConstructor | |
16 | @Builder | |
17 | public class CommonsPlus { | |
18 | private Commons commons; | |
19 | private Integer totalCows; | |
20 | private Integer totalUsers; | |
21 | ||
22 | ||
23 | @JsonGetter("effectiveCapacity") | |
24 | public int getEffectiveCapacity() { | |
25 |
2
1. getEffectiveCapacity : replaced int return with 0 for edu/ucsb/cs156/happiercows/entities/CommonsPlus::getEffectiveCapacity → KILLED 2. getEffectiveCapacity : Replaced integer multiplication with division → KILLED |
return Math.max(commons.getCapacityPerUser() * totalUsers, commons.getCarryingCapacity()); |
26 | } | |
27 | ||
28 | ||
29 | } | |
Mutations | ||
25 |
1.1 2.2 |