Skip to content

Commit 358cabb

Browse files
committed
cleanup code smells
1 parent f0d57a0 commit 358cabb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

opengrok-web/src/main/java/org/opengrok/web/WebappListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
105105
}
106106

107107
// Check index(es).
108-
check_index(env);
108+
checkIndex(env);
109109

110110
env.startExpirationTimer();
111111
startupTimer.record(Duration.between(start, Instant.now()));
@@ -116,21 +116,21 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
116116
* is marked as not being indexed.
117117
* @param env runtime environment
118118
*/
119-
private void check_index(RuntimeEnvironment env) {
119+
private void checkIndex(RuntimeEnvironment env) {
120120
if (env.isProjectsEnabled()) {
121121
LOGGER.log(Level.FINE, "Checking indexes for all projects");
122122
Map<String, Project> projects = env.getProjects();
123123
File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR);
124124
if (indexRoot.exists()) {
125-
for (String projectName : projects.keySet()) {
125+
projects.keySet().forEach(projectName -> {
126126
try {
127127
IndexCheck.checkDir(new File(indexRoot, projectName));
128128
} catch (Exception e) {
129129
LOGGER.log(Level.WARNING,
130130
String.format("Project %s index check failed, marking as not indexed", projectName), e);
131131
projects.get(projectName).setIndexed(false);
132132
}
133-
}
133+
});
134134
}
135135
LOGGER.log(Level.FINE, "Index check for all projects done");
136136
} else {

0 commit comments

Comments
 (0)