diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java index 934c36b6f6..9f4f9321e6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -81,7 +81,8 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper { return null; } StringBuilder builder = new StringBuilder(); - for (char ch : code.toCharArray()) { + for (int i = 0; i < code.length(); i++) { + char ch = code.charAt(i); if (Character.isAlphabetic(ch) || Character.isDigit(ch)) { builder.append(Character.toLowerCase(ch)); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java index 42d200bcb3..4c5b9efe79 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java @@ -89,7 +89,8 @@ public class SimpleStatusAggregator implements StatusAggregator { return null; } StringBuilder builder = new StringBuilder(); - for (char ch : code.toCharArray()) { + for (int i = 0; i < code.length(); i++) { + char ch = code.charAt(i); if (Character.isAlphabetic(ch) || Character.isDigit(ch)) { builder.append(Character.toLowerCase(ch)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java index 7d3c9ce278..1281954f59 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java @@ -189,7 +189,8 @@ public class ConfigurationMetadata { static String toDashedCase(String name) { StringBuilder dashed = new StringBuilder(); Character previous = null; - for (char current : name.toCharArray()) { + for (int i = 0; i < name.length(); i++) { + char current = name.charAt(i); if (SEPARATORS.contains(current)) { dashed.append("-"); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java index fd71316ee3..222a426461 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java @@ -308,7 +308,8 @@ public class ConfigTreePropertySource extends EnumerablePropertySource imp return string; } int numberOfLines = 0; - for (char ch : string.toCharArray()) { + for (int i = 0; i < string.length(); i++) { + char ch = string.charAt(i); if (ch == '\n') { numberOfLines++; }