From e5aeca074a3329cbb20c5e1c2635786c886a72af Mon Sep 17 00:00:00 2001 From: arefbehboudi Date: Sat, 18 Jan 2025 17:07:21 +0330 Subject: [PATCH 1/4] Polish Signed-off-by: arefbehboudi --- .../springframework/boot/build/DeployedPlugin.java | 3 +-- .../springframework/boot/build/antora/Extensions.java | 4 ++-- .../springframework/boot/build/bom/BomExtension.java | 4 ++-- .../org/springframework/boot/build/bom/Library.java | 4 ++-- .../boot/build/context/properties/Asciidoc.java | 11 +++++------ 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java index e2aae45f806c..0c334686759f 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class DeployedPlugin implements Plugin { public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication"; @Override - @SuppressWarnings("deprecation") public void apply(Project project) { project.getPlugins().apply(MavenPublishPlugin.class); project.getPlugins().apply(MavenRepositoryPlugin.class); diff --git a/buildSrc/src/main/java/org/springframework/boot/build/antora/Extensions.java b/buildSrc/src/main/java/org/springframework/boot/build/antora/Extensions.java index 44c6f91fb0e4..608cb2f7010e 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/antora/Extensions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/antora/Extensions.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ Stream names() { static final class AntoraExtensionsConfiguration { - private Map> extensions = new TreeMap<>(); + private final Map> extensions = new TreeMap<>(); private AntoraExtensionsConfiguration(List names) { names.forEach((name) -> this.extensions.put(name, null)); diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java index e14aa306012d..5f4eb3eb415c 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java @@ -616,9 +616,9 @@ public void setIssueLabels(List issueLabels) { public static final class GitHub { - private String organization; + private final String organization; - private String repository; + private final String repository; private final List issueLabels; diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java index 6a99a434038f..0b4aab9368a3 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -541,7 +541,7 @@ public String toString() { public record Link(String rootName, Function factory, List packages) { - private static final Pattern PACKAGE_EXPAND = Pattern.compile("^(.*)\\[(.*)\\]$"); + private static final Pattern PACKAGE_EXPAND = Pattern.compile("^(.*)\\[(.*)]$"); public Link { packages = (packages != null) ? List.copyOf(expandPackages(packages)) : Collections.emptyList(); diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java index fdf81f92fc95..c75ce82c09b0 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java @@ -29,15 +29,14 @@ class Asciidoc { this.content = new StringBuilder(); } - Asciidoc appendWithHardLineBreaks(Object... items) { + void appendWithHardLineBreaks(Object... items) { for (Object item : items) { appendln("`+", item, "+` +"); } - return this; } - Asciidoc appendln(Object... items) { - return append(items).newLine(); + void appendln(Object... items) { + append(items).newLine(); } Asciidoc append(Object... items) { @@ -47,8 +46,8 @@ Asciidoc append(Object... items) { return this; } - Asciidoc newLine() { - return append(System.lineSeparator()); + void newLine() { + append(System.lineSeparator()); } @Override From 2cc57bc8853100edf6e3b654ef30f96db97bbb12 Mon Sep 17 00:00:00 2001 From: arefbehboudi Date: Mon, 20 Jan 2025 13:33:24 +0330 Subject: [PATCH 2/4] Resolve comments Signed-off-by: arefbehboudi --- .../boot/build/context/properties/Asciidoc.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java index c75ce82c09b0..fdf81f92fc95 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/Asciidoc.java @@ -29,14 +29,15 @@ class Asciidoc { this.content = new StringBuilder(); } - void appendWithHardLineBreaks(Object... items) { + Asciidoc appendWithHardLineBreaks(Object... items) { for (Object item : items) { appendln("`+", item, "+` +"); } + return this; } - void appendln(Object... items) { - append(items).newLine(); + Asciidoc appendln(Object... items) { + return append(items).newLine(); } Asciidoc append(Object... items) { @@ -46,8 +47,8 @@ Asciidoc append(Object... items) { return this; } - void newLine() { - append(System.lineSeparator()); + Asciidoc newLine() { + return append(System.lineSeparator()); } @Override From 6b19b48e08397ac5e22d6e8cd9f04bddfb969e7d Mon Sep 17 00:00:00 2001 From: arefbehboudi Date: Tue, 21 Jan 2025 17:56:18 +0330 Subject: [PATCH 3/4] Resolve comments Signed-off-by: arefbehboudi --- .../java/org/springframework/boot/build/DeployedPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java index 0c334686759f..e2aae45f806c 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2025 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ public class DeployedPlugin implements Plugin { public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication"; @Override + @SuppressWarnings("deprecation") public void apply(Project project) { project.getPlugins().apply(MavenPublishPlugin.class); project.getPlugins().apply(MavenRepositoryPlugin.class); From ba5704e94c5407234e190cd421d86424e13b6628 Mon Sep 17 00:00:00 2001 From: arefbehboudi Date: Tue, 21 Jan 2025 18:54:39 +0330 Subject: [PATCH 4/4] Resolve comments Signed-off-by: arefbehboudi --- .../main/java/org/springframework/boot/build/bom/Library.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java index 0b4aab9368a3..6a99a434038f 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2025 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -541,7 +541,7 @@ public String toString() { public record Link(String rootName, Function factory, List packages) { - private static final Pattern PACKAGE_EXPAND = Pattern.compile("^(.*)\\[(.*)]$"); + private static final Pattern PACKAGE_EXPAND = Pattern.compile("^(.*)\\[(.*)\\]$"); public Link { packages = (packages != null) ? List.copyOf(expandPackages(packages)) : Collections.emptyList();