Skip to content

Commit 951f051

Browse files
committed
Polish
1 parent 08fbe87 commit 951f051

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
140140

141141
/**
142142
* Flag to indicate if the run processes should be forked. {@code fork } is
143-
* automatically enabled if an agent or jvmArguments are specified, or if
144-
* devtools is present.
143+
* automatically enabled if an agent or jvmArguments are specified, or if devtools is
144+
* present.
145145
* @since 1.2
146146
*/
147147
@Parameter(property = "fork")
@@ -167,8 +167,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
167167
getLog().debug("skipping run as per configuration.");
168168
return;
169169
}
170-
final String startClassName = getStartClass();
171-
run(startClassName);
170+
run(getStartClass());
172171
}
173172

174173
/**
@@ -237,8 +236,8 @@ private void run(String startClassName)
237236
}
238237

239238
/**
240-
* Log a warning indicating that fork mode has been explicitly disabled
241-
* while some conditions are present that require to enable it.
239+
* Log a warning indicating that fork mode has been explicitly disabled while some
240+
* conditions are present that require to enable it.
242241
* @see #enableForkByDefault()
243242
*/
244243
protected void logDisabledFork() {

spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ private boolean checkForDevtools() {
124124
try {
125125
URL[] urls = getClassPathUrls();
126126
URLClassLoader classLoader = new URLClassLoader(urls);
127-
return (classLoader.findResource(RESTARTER_CLASS_LOCATION) != null);
127+
try {
128+
return (classLoader.findResource(RESTARTER_CLASS_LOCATION) != null);
129+
}
130+
finally {
131+
classLoader.close();
132+
}
128133
}
129134
catch (Exception ex) {
130135
return false;

spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityManagerFactoryBuilder.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525

2626
import javax.sql.DataSource;
2727

28-
import org.apache.commons.logging.Log;
29-
import org.apache.commons.logging.LogFactory;
30-
3128
import org.springframework.orm.jpa.JpaVendorAdapter;
3229
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
3330
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager;
@@ -48,9 +45,6 @@
4845
*/
4946
public class EntityManagerFactoryBuilder {
5047

51-
private static final Log logger = LogFactory
52-
.getLog(EntityManagerFactoryBuilder.class);
53-
5448
private final JpaVendorAdapter jpaVendorAdapter;
5549

5650
private final PersistenceUnitManager persistenceUnitManager;
@@ -211,7 +205,8 @@ public LocalContainerEntityManagerFactoryBean build() {
211205
entityManagerFactoryBean.getJpaPropertyMap().putAll(this.properties);
212206
URL rootLocation = EntityManagerFactoryBuilder.this.persistenceUnitRootLocation;
213207
if (rootLocation != null) {
214-
entityManagerFactoryBean.setPersistenceUnitRootLocation(rootLocation.toString());
208+
entityManagerFactoryBean
209+
.setPersistenceUnitRootLocation(rootLocation.toString());
215210
}
216211
if (EntityManagerFactoryBuilder.this.callback != null) {
217212
EntityManagerFactoryBuilder.this.callback

0 commit comments

Comments
 (0)