Only run InitCommand if there is code to process

This appears to be a significant improvement in performance
(checking for the existence of init.grooy is cheap, but compiling
it is expensive).

I'm going to say this fixes gh-212.
This commit is contained in:
Dave Syer 2014-01-11 07:23:39 +00:00
parent 322af41d72
commit 420fc69983

View File

@ -79,7 +79,7 @@ public class InitCommand extends OptionParsingCommand {
"init.groovy", "spring.groovy");
String[] sources = sourceOptions.getSourcesArray();
if (!(loader instanceof GroovyClassLoader)) {
if (!(loader instanceof GroovyClassLoader) && sources.length > 0) {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();