From a41ca05a2fa45084ed3a4ea9b31c22246d93136e Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 16 Jan 2023 14:52:29 +0100 Subject: [PATCH] Default to empty string if description in plugin.xml is not set Closes gh-20890 --- .../boot/build/mavenplugin/PluginXmlParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java index 061cd01039..19f66707e7 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 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. @@ -99,9 +99,10 @@ class PluginXmlParser { private Parameter parseParameter(Node parameterNode, Map defaultValues, Map userProperties) throws XPathExpressionException { + String description = textAt("description", parameterNode); return new Parameter(textAt("name", parameterNode), textAt("type", parameterNode), booleanAt("required", parameterNode), booleanAt("editable", parameterNode), - format(textAt("description", parameterNode)), defaultValues.get(textAt("name", parameterNode)), + (description != null) ? format(description) : "", defaultValues.get(textAt("name", parameterNode)), userProperties.get(textAt("name", parameterNode)), textAt("since", parameterNode)); }