@Configuration class AppConfig { @Bean Main mainRunner() { new Main() } }
public static void main(String... args) { Main main = new Main(); main.testMethod(1); } public void testMethod(int i) { testMethod(i); System.out.println(i); }
@Override public ICompilerRequestor getBatchRequestor() { final ICompilerRequestor r = super.getBatchRequestor(); return new ICompilerRequestor() { @Override public void acceptResult(CompilationResult compilationResult) { if (compilationResult.hasErrors()) { for (CategorizedProblem problem:compilationResult.problems) { if (JDTBatchCompiler.this.jdtCompiler != null) { JDTBatchCompiler.this.jdtCompiler.reportProblem(problem); } else { throw new SpoonException(problem.toString()); } } } r.acceptResult(compilationResult); // this is required to complete the compilation and produce the class files } }; }
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
@Override public void initializeCompiler(JDTBatchCompiler compiler) { JDTBasedSpoonCompiler jdtCompiler = compiler.getJdtCompiler(); List<CompilationUnit> cuList = new ArrayList<>(); for (SpoonFile f : getFiles(compiler)) { if (compiler.filesToBeIgnored.contains(f.getPath())) { continue; } String fName = f.isActualFile() ? f.getPath() : f.getName(); Environment env = jdtCompiler.getEnvironment(); cuList.add(new CompilationUnit(f.getContentChars(env), fName, env.getEncoding().displayName())); } compiler.setCompilationUnits(cuList.toArray(new CompilationUnit[0])); }
/** * Used to stop logging problems. * Only use in xml mode. */ private void endLoggingProblems() { endTag(Logger.PROBLEMS); } public void endLoggingSource() {
/** * */ public void logProgress() { printOut('.'); }
public void startLoggingSources() { if ((this.tagBits & Logger.XML) != 0) { printTag(Logger.SOURCES, null, true, false); } }
/** * Print the usage of the compiler * @param usage */ public void logUsage(String usage) { printlnOut(usage); }
char[] charName = compilationUnit.getFileName(); boolean isModuleInfo = CharOperation.endsWith(charName, TypeConstants.MODULE_INFO_FILE_NAME); if (isModuleInfo == (round == 0)) { // 1st round: modules, 2nd round others (to ensure populating pathToModCU well in time)
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {
/** * */ public void compiling() { printlnOut(this.main.bind("progress.compiling")); //$NON-NLS-1$ } private void endLoggingExtraProblems() {