Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
vananiev committed Nov 6, 2024
1 parent 8f68914 commit 4bde784
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spacious_team.broker.pojo.Portfolio;
import org.spacious_team.broker.pojo.SecurityEventCashFlow;
Expand Down Expand Up @@ -87,7 +88,7 @@ private Table getTable(List<SecurityEventCashFlow> cashFlows) {
table.add(new Table.Record());
Table.Record monthTotalRecord = new Table.Record();
table.add(monthTotalRecord);
@Nullable Month month = null;
@MonotonicNonNull Month month = null;

Check warning on line 91 in src/main/java/ru/investbook/report/excel/PortfolioPaymentExcelTableFactory.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ru/investbook/report/excel/PortfolioPaymentExcelTableFactory.java#L91

Added line #L91 was not covered by tests
int sumRowCount = 0;
for (SecurityEventCashFlow cash : cashFlows) {
Instant timestamp = cash.getTimestamp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.Objects;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;
import static ru.investbook.repository.specs.SpecificationHelper.*;


Expand All @@ -44,7 +43,6 @@ public class EventCashFlowEntitySearchSpecification implements Specification<Eve

@Override
public Predicate toPredicate(Root<EventCashFlowEntity> root, @Nullable CriteriaQuery<?> query, CriteriaBuilder builder) {
requireNonNull(query);
return Stream.of(
filterByPortfolio(root, builder, EventCashFlowEntity_.portfolio, portfolio),
filterByDateFrom(root, builder, EventCashFlowEntity_.timestamp, dateFrom),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.Objects;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;
import static org.springframework.util.StringUtils.hasText;


Expand All @@ -45,7 +44,6 @@ public class ForeignExchangeRateSearchSpecification implements Specification<For

@Override
public Predicate toPredicate(Root<ForeignExchangeRateEntity> root, @Nullable CriteriaQuery<?> query, CriteriaBuilder builder) {
requireNonNull(query);
return Stream.of(
filterByCurrency(root, builder),
filterByDate(root, builder))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.Objects;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;
import static ru.investbook.repository.specs.SpecificationHelper.*;


Expand All @@ -45,7 +44,6 @@ public class PortfolioPropertySearchSpecification implements Specification<Portf

@Override
public Predicate toPredicate(Root<PortfolioPropertyEntity> root, @Nullable CriteriaQuery<?> query, CriteriaBuilder builder) {
requireNonNull(query);
@Nullable String propertyName = (property == null) ? null : property.name();
return Stream.of(
filterByPortfolio(root, builder, PortfolioPropertyEntity_.portfolio, portfolio),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.Objects;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;
import static ru.investbook.repository.specs.SpecificationHelper.*;


Expand All @@ -50,7 +49,6 @@ public class SecurityEventCashFlowEntitySearchSpecification implements Specifica
public Predicate toPredicate(Root<SecurityEventCashFlowEntity> root,
@Nullable CriteriaQuery<?> query,
CriteriaBuilder builder) {
requireNonNull(query);
return Stream.of(
filterByPortfolio(root, builder, SecurityEventCashFlowEntity_.portfolio, portfolio),
filterByDateFrom(root, builder, SecurityEventCashFlowEntity_.timestamp, dateFrom),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ static <T> Predicate filterByPortfolioName(Root<T> root,
}

static <X, T> @Nullable Predicate filterByEquals(Root<X> root,
CriteriaBuilder builder,
SingularAttribute<X, T> attribute,
@Nullable String value) {
CriteriaBuilder builder,
SingularAttribute<X, T> attribute,
@Nullable String value) {
if (hasText(value)) {
Path<T> path = root.get(attribute);
return builder.equal(path, value);
Expand All @@ -178,9 +178,9 @@ static <T> Predicate filterByPortfolioName(Root<T> root,
}

static <X> @Nullable Predicate filterByLike(Root<X> root,
CriteriaBuilder builder,
SingularAttribute<X, String> attribute,
@Nullable String value) {
CriteriaBuilder builder,
SingularAttribute<X, String> attribute,
@Nullable String value) {
if (hasText(value)) {
Path<String> path = root.get(attribute);
return filterByLike(builder, path, value);
Expand Down

0 comments on commit 4bde784

Please sign in to comment.