Skip to content

Commit 1e2e114

Browse files
committed
Polish contribution
See gh-26871
1 parent 0e73213 commit 1e2e114

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

spring-context/src/main/java/org/springframework/context/ApplicationEvent.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,20 +38,26 @@ public abstract class ApplicationEvent extends EventObject {
3838

3939

4040
/**
41-
* Create a new {@code ApplicationEvent}.
41+
* Create a new {@code ApplicationEvent} with its {@link #getTimestamp() timestamp}
42+
* set to {@link System#currentTimeMillis()}.
4243
* @param source the object on which the event initially occurred or with
4344
* which the event is associated (never {@code null})
45+
* @see #ApplicationEvent(Object, Clock)
4446
*/
4547
public ApplicationEvent(Object source) {
4648
super(source);
4749
this.timestamp = System.currentTimeMillis();
4850
}
4951

5052
/**
51-
* Create a new {@code ApplicationEvent} with a fixed timestamp.
53+
* Create a new {@code ApplicationEvent} with its {@link #getTimestamp() timestamp}
54+
* set to the value returned by {@link Clock#millis()} in the provided {@link Clock}.
55+
* <p>This constructor is typically used in testing scenarios.
5256
* @param source the object on which the event initially occurred or with
5357
* which the event is associated (never {@code null})
5458
* @param clock a clock which will provide the timestamp
59+
* @since 5.3.8
60+
* @see #ApplicationEvent(Object)
5561
*/
5662
public ApplicationEvent(Object source, Clock clock) {
5763
super(source);
@@ -60,7 +66,9 @@ public ApplicationEvent(Object source, Clock clock) {
6066

6167

6268
/**
63-
* Return the system time in milliseconds when the event occurred.
69+
* Return the time in milliseconds when the event occurred.
70+
* @see #ApplicationEvent(Object)
71+
* @see #ApplicationEvent(Object, Clock)
6472
*/
6573
public final long getTimestamp() {
6674
return this.timestamp;

0 commit comments

Comments
 (0)