Reading the source code comments of List shows that if one or more elements in the collection of addAll are empty or the collection is empty, a null pointer exception will be thrown.
Take a look at the method of the concrete implementation class.
ArrayList.addAll, if the collection is empty, a null pointer exception will be thrown.
It can be seen that when using the addAll method, it should be judged that the input parameter set is null
Can the input parameter of the List.addAll method be null?
Guess you like
Origin blog.csdn.net/qq_44624722/article/details/118539849
Ranking