Possible Duplicate:
Why I get UnsupportedOperationException when trying to remove from the List?
When I call List.remove(index) or list.remove(element) it raises a java.lang.UnsupportedOperationException. The only relevent error code is this:
17:08:10 [SEVERE] at java.util.AbstractList.remove(Unknown Source)
Here is an example:
String line = "cmd /say This is a test";
String[] segments = line.split(" ");
String cmd = segments[0];
List rest = Arrays.asList(segments);
rest.remove(0); // This line raises the exception
Does anyone have any idea why this is happening? In my actuall code, I checked and there is a element at index 0 to be removed.