From 363994515b27da3a49880ff0a5c98dc880c111f4 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 16 Apr 2019 17:45:37 +0900 Subject: [PATCH] Polish See gh-16575 --- .../src/site/apt/examples/repackage-name.apt.vm | 2 +- .../bind/handler/NoUnboundElementsBindHandler.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/repackage-name.apt.vm b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/repackage-name.apt.vm index 3dbd580c23..9a21dd9ff8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/repackage-name.apt.vm +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/repackage-name.apt.vm @@ -6,7 +6,7 @@ 2019-03-29 ----- - If you need the repackage jar to have a different local name than the one defined by + If you need the repackaged jar to have a different local name than the one defined by the <<>> attribute of the project, simply use the standard <<>> as shown in the following example: diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandler.java index f32971266d..7fd638063b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/NoUnboundElementsBindHandler.java @@ -116,10 +116,9 @@ public class NoUnboundElementsBindHandler extends AbstractBindHandler { } private boolean isOverriddenCollectionElement(ConfigurationPropertyName candidate) { - int length = candidate.getNumberOfElements(); - if (candidate.isNumericIndex(length - 1)) { - ConfigurationPropertyName propertyName = candidate - .chop(candidate.getNumberOfElements() - 1); + int lastIndex = candidate.getNumberOfElements() - 1; + if (candidate.isNumericIndex(lastIndex)) { + ConfigurationPropertyName propertyName = candidate.chop(lastIndex); return this.boundNames.contains(propertyName); } return false;