Skip to content

Fix issue with modifying a split transaction.#96

Open
t-pa wants to merge 12 commits intoccavanaugh:masterfrom
t-pa:master
Open

Fix issue with modifying a split transaction.#96
t-pa wants to merge 12 commits intoccavanaugh:masterfrom
t-pa:master

Conversation

@t-pa
Copy link
Contributor

@t-pa t-pa commented Feb 25, 2021

If a split transaction was edited on the split end (i.e., in the register view of the account that is not the common account), the account of the transaction entry was not preserved. This made the transaction entry "jump" erratically to another account. The underlying reason is that the account was not put into the account combo box; although the combo box is disabled, its value is still used to build a modified transaction entry.

t-pa and others added 12 commits January 24, 2020 21:07
# Conflicts:
#	jgnash-fx/src/main/java/jgnash/uifx/wizard/file/NewFileTwoController.java
If the local currency is unknown, it defaults to the pseudo-currency
"XXX" with scale -1. This scale is not allowed for CurrencyNodes, so
set it to 0 instead.
Even if the account combo box is locked in this case, the account is
still shown to the user and later reused if a modified transaction entry
is built.
Also, only include those child accounts that themselves are investment
accounts. This solves two problems: Due to a race condition, the
constructor is sometimes called with a non-investment account, which led
to an IllegalArgumentException and later to NullPointerExceptions. And
this now works recursively even if not all child accounts are investment
accounts.
In some circumstances, the filteredList was empty when runLater()
finally called setValue().
@t-pa
Copy link
Contributor Author

t-pa commented Feb 26, 2021

I have added two additional commits related to the Portfolio Report. They fix a condition in which the filter predicate of the account combo box is applied later than some of the other initializations. This caused exceptions like these:

[2021-02-26 22:50:37] [SCHWERWIEGEND] {jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel } null
java.lang.IllegalArgumentException: The account is not a valid type
at jgnash.engine.InvestmentPerformanceSummary.(InvestmentPerformanceSummary.java:65)
at jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel.(PortfolioReport.java:133)
at jgnash.uifx.report.PortfolioReport.createReportModel(PortfolioReport.java:98)
at jgnash.uifx.report.PortfolioReportController.createReportModel(PortfolioReportController.java:242)
at jgnash.uifx.report.PortfolioReportController.addTable(PortfolioReportController.java:226)
[...]
[2021-02-26 22:50:37] [SCHWERWIEGEND] {jgnash.uifx.StaticUIMethods$ExceptionHandler uncaughtException} null
java.lang.NullPointerException
at jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel.getRowCount(PortfolioReport.java:168)
at jgnash.report.table.AbstractReportTableModel.getColumnPrototypeValueAt(AbstractReportTableModel.java:366)
at jgnash.report.pdf.Report.getColumnWidths(Report.java:858)
at jgnash.report.pdf.Report.addTable(Report.java:273)

and

[2021-02-26 22:26:08] [SCHWERWIEGEND] {jgnash.uifx.StaticUIMethods$ExceptionHandler uncaughtException} null
java.lang.IndexOutOfBoundsException
at javafx.base/javafx.collections.transformation.FilteredList.get(FilteredList.java:170)
at jgnash.uifx.control.AccountComboBox.lambda$selectDefaultAccount$5(AccountComboBox.java:169)
at jgnash.uifx.util.JavaFXUtils.lambda$_runLater$0(JavaFXUtils.java:127)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant