1 | package org.cardanofoundation.explorer.api.mapper; | |
2 | ||
3 | import java.util.Date; | |
4 | ||
5 | import org.mapstruct.Mapper; | |
6 | import org.mapstruct.Mapping; | |
7 | ||
8 | import org.cardanofoundation.explorer.api.model.response.drep.DRepCertificateHistoryResponse; | |
9 | import org.cardanofoundation.explorer.api.model.response.drep.projection.DRepCertificateProjection; | |
10 | ||
11 | @Mapper(componentModel = "spring") | |
12 | public interface DRepCertificateMapper { | |
13 | ||
14 | @Mapping(source = "blockTime", target = "createdAt") | |
15 | DRepCertificateHistoryResponse fromDRepCertProjection( | |
16 | DRepCertificateProjection dRepCertificateProjection); | |
17 | ||
18 | default Date fromLong(Long value) { | |
19 |
3
1. fromLong : Replaced long multiplication with division → SURVIVED 2. fromLong : negated conditional → KILLED 3. fromLong : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepCertificateMapper::fromLong → KILLED |
return value == null ? null : new Date(value * 1000); |
20 | } | |
21 | } | |
Mutations | ||
19 |
1.1 2.2 3.3 |