If tsourcepos is an empty list, attempting to add a transaction will
be rejected by the server, which is expecting a pair of values. This
sets it to a well-formed default value which the server will accept.
private List<List<String>> ttags = new ArrayList<>();
private List<ParsedSourcePos> tsourcepos = new ArrayList<>();
public ParsedLedgerTransaction() {
+ ParsedSourcePos startPos = new ParsedSourcePos();
+ ParsedSourcePos endPos = new ParsedSourcePos();
+ endPos.setSourceLine(2);
+
+ tsourcepos.add(startPos);
+ tsourcepos.add(endPos);
}
public static ParsedLedgerTransaction fromLedgerTransaction(LedgerTransaction tr) {
ParsedLedgerTransaction result = new ParsedLedgerTransaction();
package net.ktnx.mobileledger.json.v1_23;
class ParsedSourcePos {
- private String sourceName;
- private int sourceLine;
- private int sourceColumn;
+ private String sourceName = "";
+ private int sourceLine = 1;
+ private int sourceColumn = 1;
public ParsedSourcePos() {
}
public String getSourceName() {