Back to Intellij Community

RedundantArrayCreation

java/java-impl/resources/inspectionDescriptions/RedundantArrayCreation.html

2025.3-rc-2248 B
Original Source

Reports arrays that are created specifically to be passed as a varargs parameter.

Example:

Arrays.asList(new String[]{"Hello", "world"})

The quick-fix replaces the array initializer with individual arguments:

Arrays.asList("Hello", "world")