Skip to content

Commit 8973d1a

Browse files
committed
Polishing
1 parent 2aae0a4 commit 8973d1a

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ public ReactiveAdapterRegistry() {
101101
}
102102

103103

104-
/**
105-
* Whether the registry has any adapters.
106-
*/
107-
public boolean hasAdapters() {
108-
return !this.adapters.isEmpty();
109-
}
110-
111104
/**
112105
* Register a reactive type along with functions to adapt to and from a
113106
* Reactive Streams {@link Publisher}. The function arguments assume that
@@ -124,6 +117,13 @@ public void registerReactiveType(ReactiveTypeDescriptor descriptor,
124117
}
125118
}
126119

120+
/**
121+
* Return whether the registry has any adapters.
122+
*/
123+
public boolean hasAdapters() {
124+
return !this.adapters.isEmpty();
125+
}
126+
127127
/**
128128
* Get the adapter for the given reactive type.
129129
* @return the corresponding adapter, or {@code null} if none available

spring-core/src/main/java/org/springframework/util/StopWatch.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -82,8 +82,8 @@ public StopWatch() {
8282
}
8383

8484
/**
85-
* Construct a new {@code StopWatch} with the given ID.
86-
* <p>The ID is handy when we have output from multiple stop watches and need
85+
* Construct a new {@code StopWatch} with the given id.
86+
* <p>The id is handy when we have output from multiple stop watches and need
8787
* to distinguish between them.
8888
* <p>Does not start any task.
8989
* @param id identifier for this stop watch
@@ -94,8 +94,8 @@ public StopWatch(String id) {
9494

9595

9696
/**
97-
* Get the ID of this {@code StopWatch}, as specified on construction.
98-
* @return the ID (empty String by default)
97+
* Get the id of this {@code StopWatch}, as specified on construction.
98+
* @return the id (empty String by default)
9999
* @since 4.2.2
100100
* @see #StopWatch(String)
101101
*/
@@ -105,9 +105,8 @@ public String getId() {
105105

106106
/**
107107
* Configure whether the {@link TaskInfo} array is built over time.
108-
* <p>Set this to {@code false} when using a {@code StopWatch} for millions
109-
* of intervals; otherwise, the {@code TaskInfo} structure will consume
110-
* excessive memory.
108+
* <p>Set this to {@code false} when using a {@code StopWatch} for millions of
109+
* tasks; otherwise, the {@code TaskInfo} structure will consume excessive memory.
111110
* <p>Default is {@code true}.
112111
*/
113112
public void setKeepTaskList(boolean keepTaskList) {
@@ -226,7 +225,7 @@ public TaskInfo getLastTaskInfo() throws IllegalStateException {
226225

227226

228227
/**
229-
* Get the total time in nanoseconds for all tasks.
228+
* Get the total time for all tasks in nanoseconds.
230229
* @since 5.2
231230
* @see #getTotalTimeMillis()
232231
* @see #getTotalTimeSeconds()
@@ -236,7 +235,7 @@ public long getTotalTimeNanos() {
236235
}
237236

238237
/**
239-
* Get the total time in milliseconds for all tasks.
238+
* Get the total time for all tasks in milliseconds.
240239
* @see #getTotalTimeNanos()
241240
* @see #getTotalTimeSeconds()
242241
*/
@@ -245,7 +244,7 @@ public long getTotalTimeMillis() {
245244
}
246245

247246
/**
248-
* Get the total time in seconds for all tasks.
247+
* Get the total time for all tasks in seconds.
249248
* @see #getTotalTimeNanos()
250249
* @see #getTotalTimeMillis()
251250
*/
@@ -361,7 +360,7 @@ public String getTaskName() {
361360
}
362361

363362
/**
364-
* Get the time in nanoseconds this task took.
363+
* Get the time this task took in nanoseconds.
365364
* @since 5.2
366365
* @see #getTimeMillis()
367366
* @see #getTimeSeconds()
@@ -371,7 +370,7 @@ public long getTimeNanos() {
371370
}
372371

373372
/**
374-
* Get the time in milliseconds this task took.
373+
* Get the time this task took in milliseconds.
375374
* @see #getTimeNanos()
376375
* @see #getTimeSeconds()
377376
*/
@@ -380,14 +379,13 @@ public long getTimeMillis() {
380379
}
381380

382381
/**
383-
* Get the time in seconds this task took.
382+
* Get the time this task took in seconds.
384383
* @see #getTimeMillis()
385384
* @see #getTimeNanos()
386385
*/
387386
public double getTimeSeconds() {
388387
return nanosToSeconds(this.timeNanos);
389388
}
390-
391389
}
392390

393391
}

0 commit comments

Comments
 (0)