Inspectopedia
 
2024.3

Redundant array creation

Warning
New
Last modified: 03 December 2024

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")