|
48 | 48 | import java.io.FileWriter; |
49 | 49 | import java.io.IOException; |
50 | 50 | import java.io.PrintWriter; |
51 | | -import java.io.Writer; |
52 | 51 | import java.net.URI; |
53 | 52 | import java.net.URISyntaxException; |
54 | 53 | import java.nio.charset.Charset; |
@@ -1255,7 +1254,7 @@ private PrintWriter printWriter(File tempFile) throws IOException { |
1255 | 1254 |
|
1256 | 1255 | private String[] makeCommandLine(List<String> commandLineList) { |
1257 | 1256 | 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 |
1259 | 1258 | return commandLine; |
1260 | 1259 | } |
1261 | 1260 |
|
@@ -1313,20 +1312,17 @@ private void runCompiler(String[] commandLine) { |
1313 | 1312 | // unwrap to the real exception |
1314 | 1313 | t = e.getCause(); |
1315 | 1314 | } |
1316 | | - Writer writer = new StringBuilderWriter(); |
| 1315 | + var writer = new StringBuilderWriter(); |
1317 | 1316 | new ErrorReporter(t, false).write(new PrintWriter(writer)); |
1318 | | - String message = writer.toString(); |
| 1317 | + log.error(writer.toString()); |
1319 | 1318 |
|
1320 | 1319 | taskSuccess = false; |
1321 | 1320 | if (errorProperty != null) { |
1322 | 1321 | getProject().setNewProperty(errorProperty, "true"); |
1323 | 1322 | } |
1324 | 1323 |
|
1325 | 1324 | if (failOnError) { |
1326 | | - log.error(message); |
1327 | 1325 | throw new BuildException("Compilation Failed", t, getLocation()); |
1328 | | - } else { |
1329 | | - log.error(message); |
1330 | 1326 | } |
1331 | 1327 | } |
1332 | 1328 | } |
@@ -1409,7 +1405,7 @@ protected GroovyClassLoader buildClassLoaderFor() { |
1409 | 1405 |
|
1410 | 1406 | ClassLoader loader = getClass().getClassLoader(); |
1411 | 1407 | if (loader instanceof AntClassLoader) { |
1412 | | - AntClassLoader antLoader = (AntClassLoader) loader; |
| 1408 | + @SuppressWarnings("resource") AntClassLoader antLoader = (AntClassLoader) loader; |
1413 | 1409 | String[] pathElm = antLoader.getClasspath().split(File.pathSeparator, -1); |
1414 | 1410 | List<String> classpath = configuration.getClasspath(); |
1415 | 1411 | /* |
|
0 commit comments