Problems when loading (what is supposed to be) a jGnash data file (file name suffix ".jgnash.xml") can cause problems displaying the "account list" in the main window ... even though jGnash "thinks" that it has successfully loaded the file. Error messages will also be found in the log file.
It is generally not possible to provide a perfect workaround for bad input data. But we should be able to do better than jGnash [1.x] currently does, in two ways:
1) currently a NullPointerException is being caught by vendor code which is part of Swing, meaning that the stack trace is huge, and consists mostly of entries which are also from classes in vendor code. It would be better to (a) generate our own NullPointerException, containing more information about the cause; and (b) catch it in our own code, making the stack trace smaller and easier to understand.
2) the "account list" is left in a strange state, in which parts of the display pane appear to be blank ... until you click on them. It would be better, if possible, to have an "account list" which was structurally and visually as normal as possible, but which contained strings like "*ERR*" in place of information which the program was unable to provide.
Details on the symptoms: multiple stack traces may be printed, because an exception is caught, its stack trace is printed, and then the program is allowed to continue ... only to encounter more exceptions.
Some of these stack traces have, near the beginning, a line like this:
Others have, near the beginning, a line like this:
Details on how the problem is triggered: the root cause is (almost certainly) a problem in the input file; but I don't yet know exactly what that problem is.
I do think I know, however, that a more proximate cause, at least for the first type of error message, is that displaying the "account list" requires a CommodityNode object representing the "commodity" (usually a currency) associated with the account whose balance is to be displayed. But the method "Engine.getCommodity", expected to return this CommodityNode, is returning null instead.
Log in to post a comment.