Merge pull request #9391 from pegeroad/BAEL-3856-aba-related-improvements
using accessors for balance and stamp
This commit is contained in:
commit
01b5d087f6
@ -9,13 +9,11 @@ public class StampedAccount {
|
|||||||
private AtomicStampedReference<Integer> account = new AtomicStampedReference<>(0, 0);
|
private AtomicStampedReference<Integer> account = new AtomicStampedReference<>(0, 0);
|
||||||
|
|
||||||
public int getBalance() {
|
public int getBalance() {
|
||||||
return this.account.get(new int[1]);
|
return account.getReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStamp() {
|
public int getStamp() {
|
||||||
int[] stamps = new int[1];
|
return account.getStamp();
|
||||||
this.account.get(stamps);
|
|
||||||
return stamps[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean deposit(int funds) {
|
public boolean deposit(int funds) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user