From 18b3de8bd2dc0bebfe54f8b93c52944d3b0f2495 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 27 Jan 2019 15:20:15 +0100 Subject: [PATCH] sbt-dotty: fix "sbt doc" after the Java rewrite If args0 is bigger than retained, `retained.toArray(args0)` will fill args0 with the elements of retained and fill the rest with `null`, leading to an NPE later on. This was caught by the sbt scripted tests and can be reproduced by running: sbt-dotty/scripted sbt-dotty/example-project --- sbt-bridge/src/xsbt/DottydocRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt-bridge/src/xsbt/DottydocRunner.java b/sbt-bridge/src/xsbt/DottydocRunner.java index 48883ab13e3c..31a9cc97a43b 100644 --- a/sbt-bridge/src/xsbt/DottydocRunner.java +++ b/sbt-bridge/src/xsbt/DottydocRunner.java @@ -67,7 +67,7 @@ public void run() { } return msg.toString(); }); - args = retained.toArray(args0); + args = retained.toArray(new String[retained.size()]); } else { args = args0; }