From 67a51441123ed16667475d012526fcc967030bc1 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 4 Jan 2018 00:27:37 +0900 Subject: [PATCH 1/2] Remove unnecessary condition in ConfigurationPropertyName Closes gh-11486 --- .../properties/source/ConfigurationPropertyName.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index c7a1cada67..0fd4fa1027 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -409,12 +409,7 @@ public final class ConfigurationPropertyName } private static boolean isIndexed(CharSequence element) { - int length = element.length(); - return charAt(element, 0) == '[' && charAt(element, length - 1) == ']'; - } - - private static char charAt(CharSequence element, int index) { - return (index < element.length() ? element.charAt(index) : 0); + return element.charAt(0) == '[' && element.charAt(element.length() - 1) == ']'; } /** From 71aad04ea9ada7f14fb1ab5f00b0ef59451eae32 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 6 Jan 2018 17:42:21 +0100 Subject: [PATCH 2/2] Update copyright header --- .../context/properties/source/ConfigurationPropertyName.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index 0fd4fa1027..b0334a1059 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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.