void (File argsFile, CompilerConfiguration compilerConfiguration, List<? super CompilationUnitPatcher> patchers, List<? super GroovyCompilerMessage> compilerMessages, List<? super File> srcFiles, Map<String, File> class2File, String[] finalOutputs, PrintStream err) { BufferedReader reader = null; FileInputStream stream; try { //noinspection IOResourceOpenedButNotSafelyClosed stream = new FileInputStream(argsFile); //noinspection IOResourceOpenedButNotSafelyClosed reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); reader.readLine(); // skip classpath String line; while ((line = reader.readLine()) != null) { if (!GroovyRtConstants.SRC_FILE.equals(line)) { break; } final File file = new File(reader.readLine()); srcFiles.add(file); } while (line != null) { if (line.equals("class2src")) { while (!GroovyRtConstants.END.equals(line = reader.readLine())) { class2File.put(line, new File(reader.readLine())); } } else if (line.startsWith(GroovyRtConstants.PATCHERS)) { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); String s; while (!GroovyRtConstants.END.equals(s = reader.readLine())) { try { final Class<?> patcherClass = classLoader.loadClass(s); final CompilationUnitPatcher patcher = (CompilationUnitPatcher)patcherClass.getConstructor().newInstance(); patchers.add(patcher); } catch (InstantiationException | ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { addExceptionInfo(compilerMessages, e, "Couldn't instantiate " + s); } } } else if (line.startsWith(GroovyRtConstants.ENCODING)) { compilerConfiguration.setSourceEncoding(reader.readLine()); } else if (line.startsWith(GroovyRtConstants.OUTPUTPATH)) { compilerConfiguration.setTargetDirectory(reader.readLine()); } else if (line.startsWith(GroovyRtConstants.FINAL_OUTPUTPATH)) { finalOutputs[0] = reader.readLine(); } line = reader.readLine(); } } catch (IOException e) { e.printStackTrace(err); } finally { try { reader.close(); } catch (IOException e) { e.printStackTrace(err); } finally { //noinspection ResultOfMethodCallIgnored argsFile.delete(); } } }