Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank.getAccounts() returns wrong value when Bank.size=0 #3

Open
javaLobster opened this issue Jan 5, 2024 · 0 comments
Open

Bank.getAccounts() returns wrong value when Bank.size=0 #3

javaLobster opened this issue Jan 5, 2024 · 0 comments

Comments

@javaLobster
Copy link

The current implementation :
public Account[] getAccounts() {
Account[] availableAccounts = new Account[size];
System.arraycopy(accounts, 0, availableAccounts, 0, size);
return availableAccounts;
}
will return an empty array when size equals 0 as the Bank will be instantiated. However this does not reflect the expected return value of the current documentation: @return the available accounts of the bank

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

No branches or pull requests

1 participant