Formatting and cleanup

This commit is contained in:
Phillip Webb
2014-06-26 09:41:15 -07:00
parent cd77bae3b2
commit 9632abf825
49 changed files with 124 additions and 121 deletions

View File

@@ -106,7 +106,7 @@ public class RunCommand extends OptionParsingCommand {
this.runner = new SpringApplicationRunner(configuration,
sourceOptions.getSourcesArray(), sourceOptions.getArgsArray());
this.runner.compileAndRun();
return ExitStatus.OK;
}

View File

@@ -70,7 +70,8 @@ public abstract class AstUtils {
String... annotations) {
for (AnnotationNode annotationNode : node.getAnnotations()) {
for (String annotation : annotations) {
if (PatternMatchUtils.simpleMatch(annotation, annotationNode.getClassNode().getName())) {
if (PatternMatchUtils.simpleMatch(annotation, annotationNode
.getClassNode().getName())) {
return true;
}
}

View File

@@ -33,7 +33,7 @@ import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext;
* <p>
* This class provides a fluent API for conditionally adding dependencies. For example:
* {@code dependencies.ifMissing("com.corp.SomeClass").add(module)}.
*
*
* @author Phillip Webb
* @author Andy Wilkinson
*/

View File

@@ -265,7 +265,8 @@ public class GroovyCompiler {
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)
throws CompilationFailedException {
ImportCustomizer importCustomizer = new SmartImportCustomizer(source, context, classNode);
ImportCustomizer importCustomizer = new SmartImportCustomizer(source,
context, classNode);
ClassNode mainClassNode = getMainClass(source.getAST().getClasses());
// Additional auto configuration

View File

@@ -42,10 +42,8 @@ public class JUnitCompilerAutoConfiguration extends CompilerAutoConfiguration {
}
@Override
public void applyImports(ImportCustomizer imports)
throws CompilationFailedException {
imports.addStarImports("org.junit")
.addStaticStars("org.junit.Assert")
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addStarImports("org.junit").addStaticStars("org.junit.Assert")
.addStaticStars("org.hamcrest.MatcherAssert")
.addStaticStars("org.hamcrest.Matchers");
}

View File

@@ -46,7 +46,7 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
public void applyImports(ImportCustomizer imports) {
imports.addImports("reactor.core.Reactor", "reactor.core.spec.Reactors",
"reactor.core.Observable", "reactor.event.Event",
"reactor.function.Functions", "reactor.function.Predicates",
"reactor.function.Functions", "reactor.function.Predicates",
"reactor.function.Suppliers",
"reactor.spring.context.annotation.Consumer",
"reactor.spring.context.annotation.Selector",

View File

@@ -45,8 +45,10 @@ public class SpringBootCompilerAutoConfiguration extends CompilerAutoConfigurati
@Override
public void applyImports(ImportCustomizer imports) {
imports.addImports("javax.annotation.PostConstruct",
"javax.annotation.PreDestroy", "groovy.util.logging.Log",
imports.addImports(
"javax.annotation.PostConstruct",
"javax.annotation.PreDestroy",
"groovy.util.logging.Log",
"org.springframework.stereotype.Controller",
"org.springframework.stereotype.Service",
"org.springframework.stereotype.Component",

View File

@@ -50,8 +50,7 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
public void applyImports(ImportCustomizer imports) {
imports.addStarImports("org.springframework.web.bind.annotation",
"org.springframework.web.servlet.config.annotation",
"org.springframework.web.servlet",
"org.springframework.http",
"org.springframework.web.servlet", "org.springframework.http",
"org.springframework.web.servlet.handler", "org.springframework.http",
"org.springframework.ui", "groovy.text");
imports.addStaticImport(GroovyTemplate.class.getName(), "template");

View File

@@ -23,7 +23,7 @@ package org.springframework.boot.cli.compiler.dependencies;
* the relevant piece from the identifier. Alternatively the identifier may be in the form
* {@code artifactId}, in which case coordinate resolution uses implementation-specific
* metadata to resolve the groupId and version.
*
*
* @author Andy Wilkinson
*/
public interface ArtifactCoordinatesResolver {

View File

@@ -48,7 +48,7 @@ import org.eclipse.aether.util.filter.DependencyFilterUtils;
* A {@link GrapeEngine} implementation that uses <a
* href="http://eclipse.org/aether">Aether</a>, the dependency resolution system used by
* Maven.
*
*
* @author Andy Wilkinson
* @author Phillip Webb
*/

View File

@@ -27,8 +27,7 @@ import org.springframework.boot.dependency.tools.ManagedDependencies;
import org.springframework.boot.dependency.tools.PomDependencies;
/**
* Factory to create Maven {@link Dependency} objects from Boot
* {@link PomDependencies}.
* Factory to create Maven {@link Dependency} objects from Boot {@link PomDependencies}.
*
* @author Phillip Webb
*/

View File

@@ -55,8 +55,8 @@ public abstract class GroovyTemplate {
return result.toString();
}
private static Template getTemplate(TemplateEngine engine, String name) throws CompilationFailedException,
ClassNotFoundException, IOException {
private static Template getTemplate(TemplateEngine engine, String name)
throws CompilationFailedException, ClassNotFoundException, IOException {
File file = new File("templates", name);
if (file.exists()) {