Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
i was facing the same problem,"UnsupportedOperationException while removing or adding elements from List."
what i did was took the arrays.aslist result in new Arraylist and used addAll method to add in it..then we can perform the add/remove from newly created and populated list.
//Customer_Orders was converted to list by using Arrays.aslist
//was giving exception on remove
(Arrays.asList(customer_Orders)
//what i did was
List list1= new ArrayList();
list1.addAll(Arrays.asList(customer_Orders)) ;
//perform operation on list1
list1.remove(j);
Thanks, this surly helped me.
What do you mean by "By the time you get to the remove(i) statement, list is no longer a java.util.ArrayList."?
A. It crashes before that line
B. list was never a java.util.ArrayList
More easy solution is to replace :
List myNewList = Array.asList(someArrayOfLong);
by :
List myNewList = new ArrayList(Array.asList(someArrayOfLong));
I think it resoled the problem
Thank you so muck your post is resolved my problem
i'm getting some exception when doing add operation on Collections.unmodifiableList like unsupported operation.can you pls provide a solution for this?
Collections.unmodifiableList(new ArrayList(map.values()))
getting unsupportedException
pls help
Thank You So much for the solution