From e81c64aa19b554b54e9fb4735eab510c5942f508 Mon Sep 17 00:00:00 2001 From: Jacek Date: Tue, 11 Oct 2022 09:52:22 +0200 Subject: [PATCH] SONAR-17440 Drop seconds from QP name when it is no longer built-in --- .../sonar/server/qualityprofile/RegisterQualityProfiles.java | 2 +- .../server/qualityprofile/RegisterQualityProfilesTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java index e4a1ba8e2ba..b9f0dd2b554 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java @@ -239,7 +239,7 @@ public class RegisterQualityProfiles implements Startable { */ private String generateNewProfileName(RulesProfileDto qProfileDto) { var shortName = StringUtils.abbreviate(qProfileDto.getName(), 40); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM dd yyyy 'at' hh:mm:ss a") + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM dd yyyy 'at' hh:mm a") .withLocale(Locale.getDefault()) .withZone(ZoneId.systemDefault()); var now = formatter.format(Instant.ofEpochMilli(system2.now())); diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesTest.java index 57401460905..b51ffcf7704 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesTest.java @@ -222,7 +222,7 @@ public class RegisterQualityProfilesTest { underTest.start(); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM dd yyyy 'at' hh:mm:ss a") + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM dd yyyy 'at' hh:mm a") .withLocale(Locale.getDefault()) .withZone(ZoneId.systemDefault()); -- 2.39.5