keep arrayList immutable
@@ -66,9 +66,11 @@ public class NpmCliExtractor {
final File npmLsErrorFile = detectFileManager.getOutputFile(outputDirectory, NpmCliExtractor.ERROR_FILE);
final boolean includeDevDeps = detectConfigWrapper.getBooleanProperty(DetectProperty.DETECT_NPM_INCLUDE_DEV_DEPENDENCIES);
- final List<String> exeArgs = new ArrayList<>(Arrays.asList("ls", "-json"));
+ List<String> exeArgs;
if (!includeDevDeps) {
- exeArgs.add("-prod");
+ exeArgs = Arrays.asList("ls", "-json", "-prod");
+ } else {
+ exeArgs = Arrays.asList("ls", "-json");
}
final Executable npmLsExe = new Executable(directory, npmExe, exeArgs);
