jenkins-infra/plugin-modernizer-tool

java.lang.NullPointerException: Cannot invoke "java.util.Collection.toArray()" because "c" is null

Closed this issue · 0 comments

Jenkins and plugins versions report

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --dry-run --plugin-file plugins.txt  --recipes AddPluginsBom,AddCodeOwner
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Error reading plugins from file: plugins.txt 
java.lang.NullPointerException: Cannot invoke "java.util.Collection.toArray()" because "c" is null
        at java.base/java.util.ArrayList.addAll(ArrayList.java:670)
        at io.jenkins.tools.pluginmodernizer.cli.Main.loadPlugins(Main.java:117)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:129)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:35)

What Operating System are you using (both controller, and any agents involved in the problem)?

GitPod

Reproduction steps

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --dry-run --plugin-file plugins.txt --recipes AddPluginsBom,AddCodeOwner with a missing plugins.txt file.

Expected Results

Error reading plugins from file: plugins.txt

Actual Results

Stack trace after Error reading plugins from file: plugins.txt.

Anything else?

No response

Are you interested in contributing a fix?

No response