UnsupportedOperationException at java.util.AbstractList.add

前端 未结 6 1995
误落风尘
误落风尘 2020-12-07 23:51

I\'m having issues getting a block of code to run properly. I\'m not entirely sure WHAT this code does (I\'m trying to get a plugin that\'s out of date to work properly with

6条回答
  •  一向
    一向 (楼主)
    2020-12-08 00:20

    The problem is you are creating your lists with Arrays.asList. Per the javadoc provided, the returned list is a Fixed Size, therefore add would be unsupported. Wrap the returned list in a copy constructor for arrayList and you should be set.

提交回复
热议问题