Skip to content

Commit 179e155

Browse files
author
Phillip Webb
committed
Polish
1 parent 2433f72 commit 179e155

File tree

6 files changed

+32
-31
lines changed

6 files changed

+32
-31
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerPostProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* be registered via the inner {@link Registrar} class.
3434
*
3535
* @author Dave Syer
36-
* @since 1.1.0
36+
* @since 1.1.2
3737
*/
3838
class DataSourceInitializerPostProcessor implements BeanPostProcessor {
3939

@@ -78,6 +78,7 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
7878
registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
7979
}
8080
}
81+
8182
}
8283

8384
}

spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/ClassifierTests.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,49 @@
1616

1717
package org.springframework.boot.gradle;
1818

19-
import static org.junit.Assert.assertNotNull;
20-
2119
import java.util.jar.JarFile;
2220

2321
import org.gradle.tooling.ProjectConnection;
2422
import org.junit.Test;
2523
import org.springframework.boot.dependency.tools.ManagedDependencies;
2624

25+
import static org.junit.Assert.assertNotNull;
26+
2727
/**
2828
* Tests for using the Gradle plugin's support for installing artifacts
29-
*
29+
*
3030
* @author Dave Syer
3131
*/
3232
public class ClassifierTests {
3333

3434
private ProjectConnection project;
3535

36-
private static final String BOOT_VERSION = ManagedDependencies.get().find(
37-
"spring-boot").getVersion();
36+
private static final String BOOT_VERSION = ManagedDependencies.get()
37+
.find("spring-boot").getVersion();
3838

3939
@Test
4040
public void classifierInBootTask() throws Exception {
41-
project = new ProjectCreator().createProject("classifier");
42-
project.newBuild().forTasks("build").withArguments(
43-
"-PbootVersion=" + BOOT_VERSION, "--stacktrace").run();
41+
this.project = new ProjectCreator().createProject("classifier");
42+
this.project.newBuild().forTasks("build")
43+
.withArguments("-PbootVersion=" + BOOT_VERSION, "--stacktrace").run();
4444
checkFilesExist("classifier");
4545
}
4646

4747
@Test
4848
public void classifierInBootExtension() throws Exception {
49-
project = new ProjectCreator().createProject("classifier-extension");
50-
project.newBuild().forTasks("build").withArguments(
51-
"-PbootVersion=" + BOOT_VERSION, "--stacktrace", "--info").run();
49+
this.project = new ProjectCreator().createProject("classifier-extension");
50+
this.project.newBuild().forTasks("build")
51+
.withArguments("-PbootVersion=" + BOOT_VERSION, "--stacktrace", "--info")
52+
.run();
5253
}
5354

5455
private void checkFilesExist(String name) throws Exception {
55-
JarFile jar = new JarFile("target/" + name + "/build/libs/" + name + ".jar");
56+
JarFile jar = new JarFile("target/" + name + "/build/libs/" + name + ".jar");
5657
assertNotNull(jar.getManifest());
5758
jar.close();
58-
jar = new JarFile("target/" + name + "/build/libs/" + name + "-exec.jar");
59+
jar = new JarFile("target/" + name + "/build/libs/" + name + "-exec.jar");
5960
assertNotNull(jar.getManifest());
6061
jar.close();
6162
}
62-
63+
6364
}

spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/ui/secure/SampleWebSecureApplication.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,17 @@ protected void configure(HttpSecurity http) throws Exception {
8989
}
9090

9191
@Order(Ordered.HIGHEST_PRECEDENCE + 10)
92-
protected static class AuthenticationSecurity extends GlobalAuthenticationConfigurerAdapter {
92+
protected static class AuthenticationSecurity extends
93+
GlobalAuthenticationConfigurerAdapter {
9394

9495
@Autowired
9596
private DataSource dataSource;
9697

9798
@Override
9899
public void init(AuthenticationManagerBuilder auth) throws Exception {
99-
// @formatter:off
100-
auth.jdbcAuthentication().dataSource(dataSource).withUser("admin").password("admin")
101-
.roles("ADMIN", "USER").and().withUser("user").password("user")
102-
.roles("USER");
103-
// @formatter:on
100+
auth.jdbcAuthentication().dataSource(this.dataSource).withUser("admin")
101+
.password("admin").roles("ADMIN", "USER").and().withUser("user")
102+
.password("user").roles("USER");
104103
}
105104
}
106105

spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ public class SpringBootPluginExtension {
5858
}
5959

6060
/**
61-
* The main class that should be run. Instead of setting this explicitly you can use the
62-
* 'mainClassName' of the project or the 'main' of the 'run' task. If not specified the
61+
* The main class that should be run. Instead of setting this explicitly you can use the
62+
* 'mainClassName' of the project or the 'main' of the 'run' task. If not specified the
6363
* value from the MANIFEST will be used, or if no manifest entry is the archive will be
6464
* searched for a suitable class.
6565
*/
6666
String mainClass
6767

6868
/**
69-
* The classifier (file name part before the extension). Instead of setting this explicitly
69+
* The classifier (file name part before the extension). Instead of setting this explicitly
7070
* you can use the 'classifier' property of the 'bootRepackage' task. If not specified the archive
7171
* will be replaced instead of renamed.
7272
*/

spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void registerOutput(Project project, final RepackageTask task) {
6161
project.afterEvaluate(new Action<Project>() {
6262
@Override
6363
public void execute(Project project) {
64-
project.getTasks().withType(Jar.class, new OutputAction(task));
64+
project.getTasks().withType(Jar.class, new OutputAction(task));
6565
}
6666
});
6767
}
@@ -89,18 +89,18 @@ public OutputAction(RepackageTask task) {
8989
@Override
9090
public void execute(Jar archive) {
9191
if ("".equals(archive.getClassifier())) {
92-
setClassifier(task, archive);
92+
setClassifier(this.task, archive);
9393
File file = archive.getArchivePath();
94-
String classifier = task.getClassifier();
94+
String classifier = this.task.getClassifier();
9595
if (classifier != null) {
9696
String withClassifer = file.getName();
9797
withClassifer = StringUtils.stripFilenameExtension(withClassifer)
9898
+ "-" + classifier + "."
9999
+ StringUtils.getFilenameExtension(withClassifer);
100100
File out = new File(file.getParentFile(), withClassifer);
101101
file = out;
102-
task.getOutputs().file(file);
103-
task.setOutputFile(file);
102+
this.task.getOutputs().file(file);
103+
this.task.setOutputFile(file);
104104
}
105105
}
106106

spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public void execute(Jar archive) {
120120
try {
121121
FileCopyUtils.copy(file, out);
122122
}
123-
catch (IOException e) {
124-
throw new IllegalStateException(e.getMessage(), e);
123+
catch (IOException ex) {
124+
throw new IllegalStateException(ex.getMessage(), ex);
125125
}
126126
file = out;
127127
}

0 commit comments

Comments
 (0)