Polishing

This commit is contained in:
Juergen Hoeller 2018-07-26 15:46:55 +02:00
parent 38525ceff6
commit e366b20037
2 changed files with 6 additions and 7 deletions

View File

@ -717,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();

View File

@ -8441,12 +8441,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...
@ -8474,10 +8474,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...