Skip to content

Commit b70de71

Browse files
committed
GROOVY-11658: groovyc: log command-line arguments at verbose level
1 parent 9f19bbe commit b70de71

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant

subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import java.io.FileWriter;
4949
import java.io.IOException;
5050
import java.io.PrintWriter;
51-
import java.io.Writer;
5251
import java.net.URI;
5352
import java.net.URISyntaxException;
5453
import java.nio.charset.Charset;
@@ -1255,7 +1254,7 @@ private PrintWriter printWriter(File tempFile) throws IOException {
12551254

12561255
private String[] makeCommandLine(List<String> commandLineList) {
12571256
String[] commandLine = commandLineList.toArray(String[]::new);
1258-
log.info("Compilation arguments:\n" + String.join("\n", commandLine));
1257+
log.verbose("Compilation arguments:\n" + String.join("\n", commandLine)); // GROOVY-11658
12591258
return commandLine;
12601259
}
12611260

@@ -1313,20 +1312,17 @@ private void runCompiler(String[] commandLine) {
13131312
// unwrap to the real exception
13141313
t = e.getCause();
13151314
}
1316-
Writer writer = new StringBuilderWriter();
1315+
var writer = new StringBuilderWriter();
13171316
new ErrorReporter(t, false).write(new PrintWriter(writer));
1318-
String message = writer.toString();
1317+
log.error(writer.toString());
13191318

13201319
taskSuccess = false;
13211320
if (errorProperty != null) {
13221321
getProject().setNewProperty(errorProperty, "true");
13231322
}
13241323

13251324
if (failOnError) {
1326-
log.error(message);
13271325
throw new BuildException("Compilation Failed", t, getLocation());
1328-
} else {
1329-
log.error(message);
13301326
}
13311327
}
13321328
}
@@ -1409,7 +1405,7 @@ protected GroovyClassLoader buildClassLoaderFor() {
14091405

14101406
ClassLoader loader = getClass().getClassLoader();
14111407
if (loader instanceof AntClassLoader) {
1412-
AntClassLoader antLoader = (AntClassLoader) loader;
1408+
@SuppressWarnings("resource") AntClassLoader antLoader = (AntClassLoader) loader;
14131409
String[] pathElm = antLoader.getClasspath().split(File.pathSeparator, -1);
14141410
List<String> classpath = configuration.getClasspath();
14151411
/*

0 commit comments

Comments
 (0)