Commit 36ed0f5c authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Polish

Closes gh-4537
parent 6146817b
...@@ -74,27 +74,27 @@ class AutoConfigurationSorter { ...@@ -74,27 +74,27 @@ class AutoConfigurationSorter {
private List<String> sortByAnnotation(AutoConfigurationClasses classes, private List<String> sortByAnnotation(AutoConfigurationClasses classes,
List<String> classNames) { List<String> classNames) {
List<String> tosort = new ArrayList<String>(classNames); List<String> toSort = new ArrayList<String>(classNames);
Set<String> sorted = new LinkedHashSet<String>(); Set<String> sorted = new LinkedHashSet<String>();
Set<String> processing = new LinkedHashSet<String>(); Set<String> processing = new LinkedHashSet<String>();
while (!tosort.isEmpty()) { while (!toSort.isEmpty()) {
doSortByAfterAnnotation(classes, tosort, sorted, processing, null); doSortByAfterAnnotation(classes, toSort, sorted, processing, null);
} }
return new ArrayList<String>(sorted); return new ArrayList<String>(sorted);
} }
private void doSortByAfterAnnotation(AutoConfigurationClasses classes, private void doSortByAfterAnnotation(AutoConfigurationClasses classes,
List<String> tosort, Set<String> sorted, Set<String> processing, List<String> toSort, Set<String> sorted, Set<String> processing,
String current) { String current) {
if (current == null) { if (current == null) {
current = tosort.remove(0); current = toSort.remove(0);
} }
processing.add(current); processing.add(current);
for (String after : classes.getClassesRequestedAfter(current)) { for (String after : classes.getClassesRequestedAfter(current)) {
Assert.state(!processing.contains(after), Assert.state(!processing.contains(after),
"AutoConfigure cycle detected between " + current + " and " + after); "AutoConfigure cycle detected between " + current + " and " + after);
if (!sorted.contains(after) && tosort.contains(after)) { if (!sorted.contains(after) && toSort.contains(after)) {
doSortByAfterAnnotation(classes, tosort, sorted, processing, after); doSortByAfterAnnotation(classes, toSort, sorted, processing, after);
} }
} }
processing.remove(current); processing.remove(current);
......
...@@ -198,7 +198,7 @@ public class JobLauncherCommandLineRunner ...@@ -198,7 +198,7 @@ public class JobLauncherCommandLineRunner
} }
execute(job, jobParameters); execute(job, jobParameters);
} }
catch (NoSuchJobException nsje) { catch (NoSuchJobException ex) {
logger.debug("No job found in registry for job name: " + jobName); logger.debug("No job found in registry for job name: " + jobName);
continue; continue;
} }
......
...@@ -48,7 +48,7 @@ public class FlywayMigrationInitializer implements InitializingBean, Ordered { ...@@ -48,7 +48,7 @@ public class FlywayMigrationInitializer implements InitializingBean, Ordered {
/** /**
* Create a new {@link FlywayMigrationInitializer} instance. * Create a new {@link FlywayMigrationInitializer} instance.
* @param flyway the flyway instance * @param flyway the flyway instance
* @param migrationStrategy the migration stragety or {@code null} * @param migrationStrategy the migration strategy or {@code null}
*/ */
public FlywayMigrationInitializer(Flyway flyway, public FlywayMigrationInitializer(Flyway flyway,
FlywayMigrationStrategy migrationStrategy) { FlywayMigrationStrategy migrationStrategy) {
......
...@@ -46,7 +46,7 @@ import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer; ...@@ -46,7 +46,7 @@ import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer;
import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver; import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver;
/** /**
* Autoconfiguration support for Groovy templates in MVC. By default creates a * Auto-configuration support for Groovy templates in MVC. By default creates a
* {@link MarkupTemplateEngine} configured from {@link GroovyTemplateProperties}, but you * {@link MarkupTemplateEngine} configured from {@link GroovyTemplateProperties}, but you
* can override that by providing your own {@link GroovyMarkupConfig} or even a * can override that by providing your own {@link GroovyMarkupConfig} or even a
* {@link MarkupTemplateEngine} of a different type. * {@link MarkupTemplateEngine} of a different type.
......
...@@ -75,12 +75,12 @@ enum DatabaseDriver { ...@@ -75,12 +75,12 @@ enum DatabaseDriver {
ORACLE("oracle.jdbc.OracleDriver", "oracle.jdbc.xa.client.OracleXADataSource"), ORACLE("oracle.jdbc.OracleDriver", "oracle.jdbc.xa.client.OracleXADataSource"),
/** /**
* Postres. * Postgres.
*/ */
POSTGRESQL("org.postgresql.Driver", "org.postgresql.xa.PGXADataSource"), POSTGRESQL("org.postgresql.Driver", "org.postgresql.xa.PGXADataSource"),
/** /**
* JTDS. * jTDS.
*/ */
JTDS("net.sourceforge.jtds.jdbc.Driver"), JTDS("net.sourceforge.jtds.jdbc.Driver"),
......
...@@ -118,7 +118,7 @@ public enum EmbeddedDatabaseConnection { ...@@ -118,7 +118,7 @@ public enum EmbeddedDatabaseConnection {
* database type. * database type.
* *
* @param dataSource the data source to interrogate * @param dataSource the data source to interrogate
* @return true if the data sourceis one of the embedded types * @return true if the data source is one of the embedded types
*/ */
public static boolean isEmbedded(DataSource dataSource) { public static boolean isEmbedded(DataSource dataSource) {
try { try {
......
...@@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.jdbc.metadata; ...@@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.jdbc.metadata;
import javax.sql.DataSource; import javax.sql.DataSource;
/** /**
* Provides access meta-data that is commonly available from most polled * Provides access meta-data that is commonly available from most pooled
* {@link DataSource} implementations. * {@link DataSource} implementations.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
......
...@@ -37,7 +37,7 @@ public class DataSourcePoolMetadataProviders implements DataSourcePoolMetadataPr ...@@ -37,7 +37,7 @@ public class DataSourcePoolMetadataProviders implements DataSourcePoolMetadataPr
/** /**
* Create a {@link DataSourcePoolMetadataProviders} instance with an initial * Create a {@link DataSourcePoolMetadataProviders} instance with an initial
* collection of delegates to use. * collection of delegates to use.
* @param providers the data source pool metdata providers * @param providers the data source pool metadata providers
*/ */
public DataSourcePoolMetadataProviders( public DataSourcePoolMetadataProviders(
Collection<? extends DataSourcePoolMetadataProvider> providers) { Collection<? extends DataSourcePoolMetadataProvider> providers) {
......
...@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; ...@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory;
* Configuration used to create the embedded Artemis server. * Configuration used to create the embedded Artemis server.
* *
* @author Eddú Meléndez * @author Eddú Meléndez
* @author Stephane Nicol * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
*/ */
class ArtemisEmbeddedConfigurationFactory { class ArtemisEmbeddedConfigurationFactory {
......
...@@ -31,7 +31,7 @@ import org.springframework.boot.autoconfigure.jms.hornetq.HornetQProperties.Embe ...@@ -31,7 +31,7 @@ import org.springframework.boot.autoconfigure.jms.hornetq.HornetQProperties.Embe
/** /**
* Factory class to create a HornetQ {@link Configuration} from {@link HornetQProperties}. * Factory class to create a HornetQ {@link Configuration} from {@link HornetQProperties}.
* *
* @author Stephane Nicol * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
* @since 1.1.0 * @since 1.1.0
*/ */
......
...@@ -114,7 +114,7 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration { ...@@ -114,7 +114,7 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
if (jtaTransactionManager != null) { if (jtaTransactionManager != null) {
if (runningOnWebSphere()) { if (runningOnWebSphere()) {
// We can never use SpringJtaPlatform on WebSphere as // We can never use SpringJtaPlatform on WebSphere as
// WebSphereUowTransactionManger has a null TransactionManager // WebSphereUowTransactionManager has a null TransactionManager
// which will cause Hibernate to NPE // which will cause Hibernate to NPE
configureWebSphereTransactionPlatform(vendorProperties); configureWebSphereTransactionPlatform(vendorProperties);
} }
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
*/ */
/** /**
* Auto-configuration for transaction suport. * Auto-configuration for transaction support.
*/ */
package org.springframework.boot.autoconfigure.transaction; package org.springframework.boot.autoconfigure.transaction;
...@@ -30,7 +30,7 @@ import org.springframework.core.ResolvableType; ...@@ -30,7 +30,7 @@ import org.springframework.core.ResolvableType;
* {@link EmbeddedServletContainerCustomizer} to configure websockets for a given * {@link EmbeddedServletContainerCustomizer} to configure websockets for a given
* {@link EmbeddedServletContainerFactory}. * {@link EmbeddedServletContainerFactory}.
* *
* @param <T> the embded servlet container factory * @param <T> the embedded servlet container factory
* @author Dave Syer * @author Dave Syer
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
......
...@@ -107,14 +107,14 @@ public class PersistenceExceptionTranslationAutoConfigurationTests { ...@@ -107,14 +107,14 @@ public class PersistenceExceptionTranslationAutoConfigurationTests {
@Repository @Repository
private static class TestRepository { private static class TestRepository {
private final EntityManager entityManger; private final EntityManager entityManager;
TestRepository(EntityManager entityManager) { TestRepository(EntityManager entityManager) {
this.entityManger = entityManager; this.entityManager = entityManager;
} }
public void doSomething() { public void doSomething() {
this.entityManger.persist(null); this.entityManager.persist(null);
} }
} }
......
...@@ -142,7 +142,7 @@ public class ArtemisAutoConfigurationTests { ...@@ -142,7 +142,7 @@ public class ArtemisAutoConfigurationTests {
} }
@Test @Test
public void embeddedConnectionFactorEvenIfEmbeddedServiceDisabled() { public void embeddedConnectionFactoryEvenIfEmbeddedServiceDisabled() {
// No mode is specified // No mode is specified
load(EmptyConfiguration.class, "spring.artemis.mode:embedded", load(EmptyConfiguration.class, "spring.artemis.mode:embedded",
"spring.artemis.embedded.enabled:false"); "spring.artemis.embedded.enabled:false");
......
...@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat; ...@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat;
* Tests for {@link ArtemisEmbeddedConfigurationFactory} * Tests for {@link ArtemisEmbeddedConfigurationFactory}
* *
* @author Eddú Meléndez * @author Eddú Meléndez
* @author Stephane Nicol * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
*/ */
public class ArtemisEmbeddedConfigurationFactoryTests { public class ArtemisEmbeddedConfigurationFactoryTests {
......
...@@ -146,7 +146,7 @@ public class HornetQAutoConfigurationTests { ...@@ -146,7 +146,7 @@ public class HornetQAutoConfigurationTests {
} }
@Test @Test
public void embeddedConnectionFactorEvenIfEmbeddedServiceDisabled() { public void embeddedConnectionFactoryEvenIfEmbeddedServiceDisabled() {
// No mode is specified // No mode is specified
load(EmptyConfiguration.class, "spring.hornetq.mode:embedded", load(EmptyConfiguration.class, "spring.hornetq.mode:embedded",
"spring.hornetq.embedded.enabled:false"); "spring.hornetq.embedded.enabled:false");
......
...@@ -28,7 +28,7 @@ import static org.junit.Assert.assertThat; ...@@ -28,7 +28,7 @@ import static org.junit.Assert.assertThat;
/** /**
* Tests for {@link HornetQEmbeddedConfigurationFactory}. * Tests for {@link HornetQEmbeddedConfigurationFactory}.
* *
* @author Stephane Nicol * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
*/ */
public class HornetQEmbeddedConfigurationFactoryTests { public class HornetQEmbeddedConfigurationFactoryTests {
...@@ -55,7 +55,7 @@ public class HornetQEmbeddedConfigurationFactoryTests { ...@@ -55,7 +55,7 @@ public class HornetQEmbeddedConfigurationFactoryTests {
} }
@Test @Test
public void generatedClusterPassoword() throws Exception { public void generatedClusterPassword() throws Exception {
HornetQProperties properties = new HornetQProperties(); HornetQProperties properties = new HornetQProperties();
Configuration configuration = new HornetQEmbeddedConfigurationFactory(properties) Configuration configuration = new HornetQEmbeddedConfigurationFactory(properties)
.createConfiguration(); .createConfiguration();
...@@ -63,7 +63,7 @@ public class HornetQEmbeddedConfigurationFactoryTests { ...@@ -63,7 +63,7 @@ public class HornetQEmbeddedConfigurationFactoryTests {
} }
@Test @Test
public void specificClusterPassoword() throws Exception { public void specificClusterPassword() throws Exception {
HornetQProperties properties = new HornetQProperties(); HornetQProperties properties = new HornetQProperties();
properties.getEmbedded().setClusterPassword("password"); properties.getEmbedded().setClusterPassword("password");
Configuration configuration = new HornetQEmbeddedConfigurationFactory(properties) Configuration configuration = new HornetQEmbeddedConfigurationFactory(properties)
......
...@@ -181,9 +181,9 @@ public class MultipartAutoConfigurationTests { ...@@ -181,9 +181,9 @@ public class MultipartAutoConfigurationTests {
private void testContainerWithCustomMultipartConfigEnabledSetting( private void testContainerWithCustomMultipartConfigEnabledSetting(
final String propertyValue, int expectedNumberOfMultipartConfigElementBeans) { final String propertyValue, int expectedNumberOfMultipartConfigElementBeans) {
this.context = new AnnotationConfigEmbeddedWebApplicationContext(); this.context = new AnnotationConfigEmbeddedWebApplicationContext();
Map<String, Object> poperties = new LinkedHashMap<String, Object>(); Map<String, Object> properties = new LinkedHashMap<String, Object>();
poperties.put("multipart.enabled", propertyValue); properties.put("multipart.enabled", propertyValue);
MapPropertySource propertySource = new MapPropertySource("test", poperties); MapPropertySource propertySource = new MapPropertySource("test", properties);
this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(ContainerWithNoMultipartTomcat.class, this.context.register(ContainerWithNoMultipartTomcat.class,
BaseConfiguration.class); BaseConfiguration.class);
......
...@@ -28,7 +28,7 @@ import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter; ...@@ -28,7 +28,7 @@ import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
/** /**
* Base class for {@link ArtifactsFilter} based on a {@link FilterableDependency} list. * Base class for {@link ArtifactsFilter} based on a {@link FilterableDependency} list.
* *
* @author Stephane Nicol * @author Stephane Nicoll
* @author David Turanski * @author David Turanski
* @since 1.2 * @since 1.2
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment