When converting a primitive array into a List of its wrapper type, boxing has to be done explicitly. Therefore the conversion with Arrays.asList(T...) cannot be used in this case but it wrongfully suggested in order to use Collection#addAll instead of single add by looping through the array.
Lint Name
COMMON_REIMPLEMENTATION_ADD_ALL
Reproducer
String origin;
List<Character> target = new ArrayList<>();
for (char single : origin.toCharArray()) {
target.add(single);
}
Summary
When converting a primitive array into a List of its wrapper type, boxing has to be done explicitly. Therefore the conversion with
Arrays.asList(T...)
cannot be used in this case but it wrongfully suggested in order to useCollection#addAll
instead of single add by looping through the array.Lint Name
COMMON_REIMPLEMENTATION_ADD_ALL
Reproducer