diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java index d589302e9d..7b2b192477 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java @@ -160,7 +160,7 @@ public abstract class AbstractFactoryBean } /** - * Determine an 'eager singleton' instance, exposed in case of a + * Determine an 'early singleton' instance, exposed in case of a * circular reference. Not called in a non-circular scenario. */ @SuppressWarnings("unchecked") diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java index 1e902821a1..9f00be68ee 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java @@ -90,8 +90,14 @@ import org.springframework.util.CollectionUtils; public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBean, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, SmartLifecycle { + /** + * The thread count property. + */ public static final String PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount"; + /** + * The default thread count. + */ public static final int DEFAULT_THREAD_COUNT = 10; @@ -184,7 +190,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe private DataSource nonTransactionalDataSource; @Nullable - private Map schedulerContextMap; + private Map schedulerContextMap; @Nullable private ApplicationContext applicationContext; @@ -340,7 +346,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe *

Note: When using persistent Jobs whose JobDetail will be kept in the * database, do not put Spring-managed beans or an ApplicationContext * reference into the JobDataMap but rather into the SchedulerContext. - * @param schedulerContextAsMap Map with String keys and any objects as + * @param schedulerContextAsMap a Map with String keys and any objects as * values (for example Spring-managed beans) * @see JobDetailFactoryBean#setJobDataAsMap */ @@ -711,7 +717,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe @Override public void run() { try { - Thread.sleep(TimeUnit.SECONDS.toMillis(startupDelay)); + TimeUnit.SECONDS.sleep(startupDelay); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseStartupValidator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseStartupValidator.java index 84818ffcc6..0b4dcadedc 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseStartupValidator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseStartupValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,8 +42,14 @@ import org.springframework.lang.Nullable; */ public class DatabaseStartupValidator implements InitializingBean { + /** + * The default interval. + */ public static final int DEFAULT_INTERVAL = 1; + /** + * The default timeout. + */ public static final int DEFAULT_TIMEOUT = 60; @@ -98,8 +104,7 @@ public class DatabaseStartupValidator implements InitializingBean { */ @Override public void afterPropertiesSet() { - DataSource dataSource = this.dataSource; - if (dataSource == null) { + if (this.dataSource == null) { throw new IllegalArgumentException("Property 'dataSource' is required"); } if (this.validationQuery == null) { @@ -116,10 +121,10 @@ public class DatabaseStartupValidator implements InitializingBean { Connection con = null; Statement stmt = null; try { - con = dataSource.getConnection(); + con = this.dataSource.getConnection(); if (con == null) { throw new CannotGetJdbcConnectionException("Failed to execute validation query: " + - "DataSource returned null from getConnection(): " + dataSource); + "DataSource returned null from getConnection(): " + this.dataSource); } stmt = con.createStatement(); stmt.execute(this.validationQuery); @@ -144,7 +149,7 @@ public class DatabaseStartupValidator implements InitializingBean { } if (!validated) { - Thread.sleep(TimeUnit.SECONDS.toMillis(this.interval)); + TimeUnit.SECONDS.sleep(this.interval); } } diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index c267701545..307b7e7bd1 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -8396,12 +8396,12 @@ simple class that extends Spring's `ApplicationEvent` base class: public class BlackListEvent extends ApplicationEvent { private final String address; - private final String test; + private final String content; - public BlackListEvent(Object source, String address, String test) { + public BlackListEvent(Object source, String address, String content) { super(source); this.address = address; - this.test = test; + this.content = content; } // accessor and other methods... @@ -8429,10 +8429,9 @@ example demonstrates such a class: this.publisher = publisher; } - public void sendEmail(String address, String text) { + public void sendEmail(String address, String content) { if (blackList.contains(address)) { - BlackListEvent event = new BlackListEvent(this, address, text); - publisher.publishEvent(event); + publisher.publishEvent(new BlackListEvent(this, address, content)); return; } // send email...