Skip to content

Commit 11e2e0a

Browse files
authored
avoid this-escape by making some methods final (#4755)
1 parent a4ed3a3 commit 11e2e0a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/Project.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.indexer.configuration;
@@ -238,7 +238,7 @@ public void setIndexed(boolean flag) {
238238
*
239239
* @param tabSize the size of tabs in this project
240240
*/
241-
public void setTabSize(int tabSize) {
241+
public final void setTabSize(int tabSize) {
242242
this.tabSize = tabSize;
243243
}
244244

@@ -267,7 +267,7 @@ public boolean isNavigateWindowEnabled() {
267267
*
268268
* @param navigateWindowEnabled new value of navigateWindowEnabled
269269
*/
270-
public void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
270+
public final void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
271271
this.navigateWindowEnabled = navigateWindowEnabled;
272272
}
273273

@@ -288,7 +288,7 @@ public boolean isMergeCommitsEnabled() {
288288
/**
289289
* @param flag true if project should handle renamed files, false otherwise.
290290
*/
291-
public void setHandleRenamedFiles(boolean flag) {
291+
public final void setHandleRenamedFiles(boolean flag) {
292292
this.handleRenamedFiles = flag;
293293
}
294294

@@ -302,7 +302,7 @@ public boolean isHistoryEnabled() {
302302
/**
303303
* @param flag true if project should have history cache, false otherwise.
304304
*/
305-
public void setHistoryEnabled(boolean flag) {
305+
public final void setHistoryEnabled(boolean flag) {
306306
this.historyEnabled = flag;
307307
}
308308

@@ -316,7 +316,7 @@ public boolean isHistoryCacheEnabled() {
316316
/**
317317
* @param flag true if project should have history cache, false otherwise.
318318
*/
319-
public void setHistoryCacheEnabled(boolean flag) {
319+
public final void setHistoryCacheEnabled(boolean flag) {
320320
this.historyCacheEnabled = flag;
321321
}
322322

@@ -330,14 +330,14 @@ public boolean isAnnotationCacheEnabled() {
330330
/**
331331
* @param flag true if project should have annotation cache, false otherwise.
332332
*/
333-
public void setAnnotationCacheEnabled(boolean flag) {
333+
public final void setAnnotationCacheEnabled(boolean flag) {
334334
this.annotationCacheEnabled = flag;
335335
}
336336

337337
/**
338338
* @param flag true if project's repositories should deal with merge commits.
339339
*/
340-
public void setMergeCommitsEnabled(boolean flag) {
340+
public final void setMergeCommitsEnabled(boolean flag) {
341341
this.mergeCommitsEnabled = flag;
342342
}
343343

@@ -351,7 +351,7 @@ public boolean isHistoryBasedReindex() {
351351
/**
352352
* @param flag true if project should handle renamed files, false otherwise.
353353
*/
354-
public void setHistoryBasedReindex(boolean flag) {
354+
public final void setHistoryBasedReindex(boolean flag) {
355355
this.historyBasedReindex = flag;
356356
}
357357

@@ -419,7 +419,7 @@ public void addGroup(Group group) {
419419
}
420420
}
421421

422-
public void setBugPage(String bugPage) {
422+
public final void setBugPage(String bugPage) {
423423
this.bugPage = bugPage;
424424
}
425425

@@ -439,7 +439,7 @@ public String getBugPage() {
439439
* does not contain at least one capture group and the group does not
440440
* contain a single character
441441
*/
442-
public void setBugPattern(String bugPattern) throws PatternSyntaxException {
442+
public final void setBugPattern(String bugPattern) throws PatternSyntaxException {
443443
this.bugPattern = compilePattern(bugPattern);
444444
}
445445

@@ -459,7 +459,7 @@ public String getReviewPage() {
459459
}
460460
}
461461

462-
public void setReviewPage(String reviewPage) {
462+
public final void setReviewPage(String reviewPage) {
463463
this.reviewPage = reviewPage;
464464
}
465465

@@ -479,7 +479,7 @@ public String getReviewPattern() {
479479
* does not contain at least one capture group and the group does not
480480
* contain a single character
481481
*/
482-
public void setReviewPattern(String reviewPattern) throws PatternSyntaxException {
482+
public final void setReviewPattern(String reviewPattern) throws PatternSyntaxException {
483483
this.reviewPattern = compilePattern(reviewPattern);
484484
}
485485

@@ -504,7 +504,7 @@ public final void completeWithDefaults() {
504504
* 1) if the project has some non-default value; use that
505505
* 2) if the project has a default value; use the provided configuration
506506
*/
507-
if (getTabSize() == defaultCfg.getTabSize()) {
507+
if (tabSize == defaultCfg.getTabSize()) {
508508
setTabSize(env.getTabSize());
509509
}
510510

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ private CountingWriter newXrefWriter(String path, File transientXref, boolean co
22092209
new FileOutputStream(transientXref))));
22102210
}
22112211

2212-
LockFactory pickLockFactory(RuntimeEnvironment env) {
2212+
final LockFactory pickLockFactory(RuntimeEnvironment env) {
22132213
switch (env.getLuceneLocking()) {
22142214
case ON:
22152215
case SIMPLE:

0 commit comments

Comments
 (0)