From 88249b2d9a9a33f1124899df2b9f68555a1c92ef Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Wed, 2 Sep 2020 17:57:38 +0200 Subject: [PATCH] Polish StartupStep "tags" method Renaming the `tags` method to `getTags` for overall consistency, and fixing the Javadoc to mention that this returns an immutable collection. Closes gh-25678 --- .../core/metrics/DefaultApplicationStartup.java | 2 +- .../java/org/springframework/core/metrics/StartupStep.java | 4 ++-- .../core/metrics/jfr/FlightRecorderStartupStep.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/metrics/DefaultApplicationStartup.java b/spring-core/src/main/java/org/springframework/core/metrics/DefaultApplicationStartup.java index 09f7c4cfb89a..9b464ade8977 100644 --- a/spring-core/src/main/java/org/springframework/core/metrics/DefaultApplicationStartup.java +++ b/spring-core/src/main/java/org/springframework/core/metrics/DefaultApplicationStartup.java @@ -57,7 +57,7 @@ public Long getParentId() { } @Override - public Tags tags() { + public Tags getTags() { return this.TAGS; } diff --git a/spring-core/src/main/java/org/springframework/core/metrics/StartupStep.java b/spring-core/src/main/java/org/springframework/core/metrics/StartupStep.java index 89def84f9566..e9061cb4235d 100644 --- a/spring-core/src/main/java/org/springframework/core/metrics/StartupStep.java +++ b/spring-core/src/main/java/org/springframework/core/metrics/StartupStep.java @@ -76,7 +76,7 @@ public interface StartupStep { /** * Return the {@link Tag} collection for this step. */ - Tags tags(); + Tags getTags(); /** * Record the state of the step and possibly other metrics like execution time. @@ -86,7 +86,7 @@ public interface StartupStep { /** - * Mutable collection of {@link Tag}. + * Immutable collection of {@link Tag}. */ interface Tags extends Iterable { } diff --git a/spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderStartupStep.java b/spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderStartupStep.java index 2e67a7a9f90b..f9bfdb71eb50 100644 --- a/spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderStartupStep.java +++ b/spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderStartupStep.java @@ -77,7 +77,7 @@ public StartupStep tag(String key, Supplier value) { } @Override - public Tags tags() { + public Tags getTags() { return this.tags; }