Skip to content

Commit

Permalink
Fixed ReadOnlyAccount reverting to EUR as default currency
Browse files Browse the repository at this point in the history
  • Loading branch information
buchen committed Oct 17, 2016
1 parent 520598f commit 887129d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -14,7 +14,7 @@ public class Account implements TransactionOwner<AccountTransaction>, Investment
private String note;
private boolean isRetired = false;

private List<AccountTransaction> transactions = new ArrayList<AccountTransaction>();
private List<AccountTransaction> transactions = new ArrayList<>();

public Account()
{
Expand Down
Expand Up @@ -50,8 +50,7 @@ public Client filter(Client client)

for (Portfolio portfolio : portfolios)
{
ReadOnlyAccount pseudoAccount = new ReadOnlyAccount(portfolio.getReferenceAccount(),
portfolio.getReferenceAccount().getName());
ReadOnlyAccount pseudoAccount = new ReadOnlyAccount(portfolio.getReferenceAccount());
pseudoClient.internalAddAccount(pseudoAccount);
account2pseudo.put(portfolio.getReferenceAccount(), pseudoAccount);

Expand All @@ -68,7 +67,7 @@ public Client filter(Client client)
for (Account account : accounts)
{
ReadOnlyAccount pseudoAccount = account2pseudo.computeIfAbsent(account, a -> {
ReadOnlyAccount pa = new ReadOnlyAccount(a, a.getName());
ReadOnlyAccount pa = new ReadOnlyAccount(a);
pseudoClient.internalAddAccount(pa);
return pa;
});
Expand Down
Expand Up @@ -10,9 +10,10 @@ public class ReadOnlyAccount extends Account
{
private final Account source;

ReadOnlyAccount(Account source, String name)
ReadOnlyAccount(Account source)
{
super(name);
super(source.getName());
this.setCurrencyCode(source.getCurrencyCode());
this.source = Objects.requireNonNull(source);
}

Expand Down

0 comments on commit 887129d

Please sign in to comment.