Skip to content

Commit c6cd071

Browse files
committed
remove unused parameter
1 parent e63457e commit c6cd071

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexCheck.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static boolean check(@NotNull Configuration configuration, IndexCheckMode
173173
private static int checkDirNoExceptions(Path indexPath, IndexCheckMode mode, String projectName) {
174174
try {
175175
LOGGER.log(Level.INFO, "Checking index in ''{0}''", indexPath);
176-
checkDir(indexPath, mode, projectName);
176+
checkDir(indexPath, mode);
177177
} catch (Exception e) {
178178
LOGGER.log(Level.WARNING, String.format("Index check for directory '%s' failed", indexPath), e);
179179
return 1;
@@ -188,12 +188,11 @@ private static int checkDirNoExceptions(Path indexPath, IndexCheckMode mode, Str
188188
* in the Lucene segment file were done with the same version.
189189
*
190190
* @param indexPath directory with index to check
191-
* @param mode index check mode
192-
* @param projectName name of the project, can be empty
193-
* @throws IOException if the directory cannot be opened
191+
* @param mode index check mode
192+
* @throws IOException if the directory cannot be opened
194193
* @throws IndexVersionException if the version of the index does not match Lucene index version
195194
*/
196-
public static void checkDir(Path indexPath, IndexCheckMode mode, String projectName)
195+
public static void checkDir(Path indexPath, IndexCheckMode mode)
197196
throws IndexVersionException, IndexDocumentException, IOException {
198197

199198
LockFactory lockFactory = NativeFSLockFactory.INSTANCE;
@@ -293,8 +292,7 @@ public static List<String> getLiveDocumentPaths(Path indexPath) throws IOExcepti
293292
}
294293
}
295294

296-
private static void checkDuplicateDocuments(Path indexPath)
297-
throws IOException, IndexDocumentException {
295+
private static void checkDuplicateDocuments(Path indexPath) throws IOException, IndexDocumentException {
298296

299297
LOGGER.log(Level.FINE, "Checking duplicate documents in ''{0}''", indexPath);
300298
Statistics stat = new Statistics();

opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ void testIndexVersionOldIndex() throws Exception {
141141
assertFalse(IndexCheck.check(configuration, IndexCheck.IndexCheckMode.VERSION, new ArrayList<>()));
142142

143143
assertThrows(IndexCheck.IndexVersionException.class, () ->
144-
IndexCheck.checkDir(indexPath, IndexCheck.IndexCheckMode.VERSION, ""));
144+
IndexCheck.checkDir(indexPath, IndexCheck.IndexCheckMode.VERSION));
145145
}
146146

147147
@Test
148148
void testEmptyDir(@TempDir Path tempDir) throws Exception {
149149
assertEquals(0, tempDir.toFile().list().length);
150-
IndexCheck.checkDir(tempDir, IndexCheck.IndexCheckMode.VERSION, "");
150+
IndexCheck.checkDir(tempDir, IndexCheck.IndexCheckMode.VERSION);
151151
}
152152
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private void checkIndex(RuntimeEnvironment env) {
158158
executor.submit(() -> {
159159
try {
160160
IndexCheck.checkDir(Path.of(indexRoot.toString(), projectEntry.getKey()),
161-
IndexCheck.IndexCheckMode.VERSION, projectEntry.getKey());
161+
IndexCheck.IndexCheckMode.VERSION);
162162
} catch (Exception e) {
163163
LOGGER.log(Level.WARNING,
164164
String.format("Project %s index check failed, marking as not indexed",
@@ -184,7 +184,7 @@ private void checkIndex(RuntimeEnvironment env) {
184184
LOGGER.log(Level.FINE, "Checking index");
185185
try {
186186
IndexCheck.checkDir(Path.of(env.getDataRootPath(), IndexDatabase.INDEX_DIR),
187-
IndexCheck.IndexCheckMode.VERSION, "");
187+
IndexCheck.IndexCheckMode.VERSION);
188188
} catch (Exception e) {
189189
LOGGER.log(Level.SEVERE, "index check failed", e);
190190
}

0 commit comments

Comments
 (0)