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

listObjects() returns immutable list #6

Closed
ErrorxCode opened this issue Apr 17, 2023 · 6 comments · Fixed by #7
Closed

listObjects() returns immutable list #6

ErrorxCode opened this issue Apr 17, 2023 · 6 comments · Fixed by #7
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ErrorxCode
Copy link
Collaborator

Problem

the listObjects() method returns an immutable list which can't be modified.

Solution

Just wrap it in the constructure of a new list.
For example,
new ArrayList<>(db.listObject())

@ErrorxCode ErrorxCode added bug Something isn't working good first issue Good for newcomers labels Apr 17, 2023
@ErrorxCode ErrorxCode self-assigned this Apr 17, 2023
@Daniel-olaO
Copy link
Contributor

Hi, I'm new to Os, can I try to solve it

@ErrorxCode
Copy link
Collaborator Author

sure, I would be very happy.

Do you know how to fix that ?

@ErrorxCode ErrorxCode pinned this issue Apr 18, 2023
@Daniel-olaO
Copy link
Contributor

Sure, I can give it a try.

@Daniel-olaO
Copy link
Contributor

Hi, I could run the code but I made this change:
return new ArrayList<>(Arrays.asList(objects));
but not sure if it works

@ErrorxCode
Copy link
Collaborator Author

Brilliant !
It will definately work. Continue making a pull request :-)

@Daniel-olaO
Copy link
Contributor

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants