Commit dfb3cd51 authored by igor-suhorukov's avatar igor-suhorukov Committed by Stephane Nicoll

Simplify code by using for-each loop

See gh-15563
parent cc5624ef
......@@ -164,9 +164,9 @@ public class SessionAutoConfiguration {
protected final String[] selectImports(WebApplicationType webApplicationType) {
List<String> imports = new ArrayList<>();
StoreType[] types = StoreType.values();
for (int i = 0; i < types.length; i++) {
for (StoreType type : types) {
imports.add(SessionStoreMappings.getConfigurationClass(webApplicationType,
types[i]));
type));
}
return StringUtils.toStringArray(imports);
}
......
......@@ -65,8 +65,8 @@ public class JSONArray {
public JSONArray(Collection copyFrom) {
this();
if (copyFrom != null) {
for (Iterator it = copyFrom.iterator(); it.hasNext();) {
put(JSONObject.wrap(it.next()));
for (Object value : copyFrom) {
put(JSONObject.wrap(value));
}
}
}
......
......@@ -270,8 +270,8 @@ public class Repackager {
}
private boolean isZip(InputStream inputStream) throws IOException {
for (int i = 0; i < ZIP_FILE_HEADER.length; i++) {
if (inputStream.read() != ZIP_FILE_HEADER[i]) {
for (byte magicByte : ZIP_FILE_HEADER) {
if (inputStream.read() != magicByte) {
return false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment