Merge pull request #15563 from igor-suhorukov

* pr/15563:
  Polish "Simplify code by using for-each loop"
  Simplify code by using for-each loop
pull/15569/head
Stephane Nicoll 6 years ago
commit c9f0860563

@ -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);
}

@ -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;
}
}

Loading…
Cancel
Save