From 1406f9cd143078e8a47bc3fe87a879bffa9aa6d6 Mon Sep 17 00:00:00 2001 From: vananiev Date: Wed, 23 Oct 2024 01:51:50 +0300 Subject: [PATCH] remove unnecessary annos (idea 2024.2 bug) https://youtrack.jetbrains.com/issue/IDEA-358087 --- .../ru/investbook/parser/TransactionValueAndFeeParser.java | 4 ---- .../java/ru/investbook/parser/psb/SecurityQuoteTable.java | 7 ++++--- .../ru/investbook/parser/uralsib/UralsibBrokerReport.java | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/ru/investbook/parser/TransactionValueAndFeeParser.java b/src/main/java/ru/investbook/parser/TransactionValueAndFeeParser.java index b023d274..96bc0069 100644 --- a/src/main/java/ru/investbook/parser/TransactionValueAndFeeParser.java +++ b/src/main/java/ru/investbook/parser/TransactionValueAndFeeParser.java @@ -59,13 +59,9 @@ public Arguments.ArgumentsBuilder argumentsBuilder() { */ public Result parse(Arguments arg) { - @SuppressWarnings("DataFlowIssue") @Nullable BigDecimal brokerFee = getFee(arg.row, arg.brokerFeeColumn).orElse(null); - @SuppressWarnings("DataFlowIssue") @Nullable BigDecimal marketFee = getFee(arg.row, arg.marketFeeColumn).orElse(null); - @SuppressWarnings("DataFlowIssue") @Nullable BigDecimal clearingFee = getFee(arg.row, arg.clearingFeeColumn).orElse(null); - @SuppressWarnings("DataFlowIssue") @Nullable BigDecimal stampDuty = getFee(arg.row, arg.stampDutyColumn).orElse(null); diff --git a/src/main/java/ru/investbook/parser/psb/SecurityQuoteTable.java b/src/main/java/ru/investbook/parser/psb/SecurityQuoteTable.java index ec5f5136..8c2acbbc 100644 --- a/src/main/java/ru/investbook/parser/psb/SecurityQuoteTable.java +++ b/src/main/java/ru/investbook/parser/psb/SecurityQuoteTable.java @@ -18,6 +18,7 @@ package ru.investbook.parser.psb; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spacious_team.broker.pojo.Security; import org.spacious_team.broker.pojo.SecurityQuote; import org.spacious_team.table_wrapper.api.TableRow; @@ -38,7 +39,7 @@ public SecurityQuoteTable(PsbBrokerReport report) { } @Override - protected SecurityQuote parseRow(TableRow row) { + protected @Nullable SecurityQuote parseRow(TableRow row) { if (row.rowContains(SecuritiesTable.INVALID_TEXT)) { return null; } @@ -48,9 +49,9 @@ protected SecurityQuote parseRow(TableRow row) { } String isin = row.getStringCellValue(ISIN); BigDecimal amount = row.getBigDecimalCellValue(AMOUNT); - BigDecimal price = amount.divide(BigDecimal.valueOf(count), 4, RoundingMode.HALF_UP); + @Nullable BigDecimal price = amount.divide(BigDecimal.valueOf(count), 4, RoundingMode.HALF_UP); BigDecimal quote = row.getBigDecimalCellValue(QUOTE); - BigDecimal accruedInterest = row.getBigDecimalCellValue(ACCRUED_INTEREST) + @Nullable BigDecimal accruedInterest = row.getBigDecimalCellValue(ACCRUED_INTEREST) .divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP); String currency = row.getStringCellValue(CURRENCY); if (accruedInterest.compareTo(minValue) < 0 && price.subtract(quote).abs().compareTo(minValue) < 0) { diff --git a/src/main/java/ru/investbook/parser/uralsib/UralsibBrokerReport.java b/src/main/java/ru/investbook/parser/uralsib/UralsibBrokerReport.java index 99c8e545..104a7a65 100644 --- a/src/main/java/ru/investbook/parser/uralsib/UralsibBrokerReport.java +++ b/src/main/java/ru/investbook/parser/uralsib/UralsibBrokerReport.java @@ -87,7 +87,6 @@ private static String getPortfolio(ReportPage reportPage) { //noinspection DataFlowIssue for (@Nullable TableCell cell : reportPage.getRow(address.getRow())) { if (cell != null && cell.getColumnIndex() > address.getColumn()) { - @SuppressWarnings("DataFlowIssue") @Nullable Object value = cell.getValue(); if (value instanceof String) { return value.toString()