Source:
private static int runCheckstyle(CliOptions cliOptions) throws CheckstyleException, IOException { final Properties props; if (cliOptions.propertiesLocation == null) { props = System.getProperties(); } else { props = loadProperties(new File(cliOptions.propertiesLocation)); } final ThreadModeSettings multiThreadModeSettings = new ThreadModeSettings( cliOptions.checkerThreadsNumber, cliOptions.treeWalkerThreadsNumber); final ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions; if (cliOptions.executeIgnoredModules) { ignoredModulesOptions = ConfigurationLoader.IgnoredModulesOptions.EXECUTE; } else { ignoredModulesOptions = ConfigurationLoader.IgnoredModulesOptions.OMIT; } final Configuration config = ConfigurationLoader.loadConfiguration( cliOptions.configLocation, new PropertiesExpander(props), ignoredModulesOptions, multiThreadModeSettings); final AuditListener listener; if (cliOptions.generateXpathSuppressionsFile) { listener = createSuppressionFileGenerator(cliOptions.tabWidth); } else { listener = createListener(cliOptions.format, cliOptions.outputLocation); } final int errorCounter; final ClassLoader moduleClassLoader = Checker.class.getClassLoader(); final RootModule rootModule = getRootModule(config.getName(), moduleClassLoader); try { rootModule.setModuleClassLoader(moduleClassLoader); rootModule.configure(config); rootModule.addListener(listener); errorCounter = rootModule.process(cliOptions.files); } finally { rootModule.destroy(); } return errorCounter; }

Target:
private static int runCheckstyle(CliOptions cliOptions) throws CheckstyleException, IOException { final Properties props; if (cliOptions.propertiesLocation == null) { props = System.getProperties(); } else { props = loadProperties(new File(cliOptions.propertiesLocation)); } final ThreadModeSettings multiThreadModeSettings = new ThreadModeSettings( cliOptions.checkerThreadsNumber, cliOptions.treeWalkerThreadsNumber); final ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions; if (cliOptions.executeIgnoredModules) { ignoredModulesOptions = ConfigurationLoader.IgnoredModulesOptions.EXECUTE; } else { ignoredModulesOptions = ConfigurationLoader.IgnoredModulesOptions.OMIT; } final Configuration config = ConfigurationLoader.loadConfiguration( cliOptions.configLocation, new PropertiesExpander(props), ignoredModulesOptions, multiThreadModeSettings); final int errorCounter; final ClassLoader moduleClassLoader = Checker.class.getClassLoader(); final RootModule rootModule = getRootModule(config.getName(), moduleClassLoader); try { final AuditListener listener; if (cliOptions.generateXpathSuppressionsFile) { final Configuration treeWalkerConfig = getTreeWalkerConfig(config); if (treeWalkerConfig != null) { final DefaultConfiguration moduleConfig = new DefaultConfiguration( XpathFileGeneratorAstFilter.class.getName()); moduleConfig.addAttribute(OPTION_TAB_WIDTH_NAME, Integer.toString(cliOptions.tabWidth)); ((DefaultConfiguration) treeWalkerConfig).addChild(moduleConfig); } listener = new XpathFileGeneratorAuditListener(System.out, AutomaticBean.OutputStreamOptions.NONE); } else { listener = createListener(cliOptions.format, cliOptions.outputLocation); } rootModule.setModuleClassLoader(moduleClassLoader); rootModule.configure(config); rootModule.addListener(listener); errorCounter = rootModule.process(cliOptions.files); } finally { rootModule.destroy(); } return errorCounter; }