Use for loop rather than iterator

See gh-33987
pull/34001/head
Krzysztof Krason 2 years ago committed by Phillip Webb
parent 55a50d565c
commit f4af93fb03

@ -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.
@ -26,7 +26,6 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
@ -229,9 +228,8 @@ public class ConfigTreePropertySource extends EnumerablePropertySource<Path> imp
}
private static boolean hasHiddenPathElement(Path path) {
Iterator<Path> iterator = path.iterator();
while (iterator.hasNext()) {
if (iterator.next().toString().startsWith("..")) {
for (Path element : path) {
if (element.toString().startsWith("..")) {
return true;
}
}

Loading…
Cancel
Save