Skip to content

Commit 160984e

Browse files
committed
lucene 10.0.0 draft!
(supress-es should be reviewed, scorer returns bad objects, so it should break scorer tests)
1 parent 6200b56 commit 160984e

File tree

61 files changed

+134
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+134
-90
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build:
14-
name: ${{ matrix.os }} with Java 17
14+
name: ${{ matrix.os }} with Java 21
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
@@ -22,11 +22,11 @@ jobs:
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0
25-
- name: Set up JDK 17
25+
- name: Set up JDK 21
2626
uses: actions/setup-java@v4
2727
with:
2828
distribution: 'oracle'
29-
java-version: '17'
29+
java-version: '21'
3030
- name: Cache Maven packages
3131
uses: actions/cache@v4
3232
with:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25-
- name: Set up JDK 17
25+
- name: Set up JDK 21
2626
uses: actions/setup-java@v4
2727
with:
2828
distribution: 'oracle'
29-
java-version: '17'
29+
java-version: '21'
3030
- name: Initialize CodeQL
3131
uses: github/codeql-action/init@v3
3232
with:

.github/workflows/javadoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
steps:
1919
- name: Checkout master branch
2020
uses: actions/checkout@v4
21-
- name: Set up JDK 17
21+
- name: Set up JDK 21
2222
uses: actions/setup-java@v4
2323
with:
2424
distribution: 'oracle'
25-
java-version: '17'
25+
java-version: '21'
2626
- name: Cache Maven packages
2727
uses: actions/cache@v4
2828
with:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
steps:
2727
- name: Checkout master branch
2828
uses: actions/checkout@v4
29-
- name: Set up JDK 17
29+
- name: Set up JDK 21
3030
uses: actions/setup-java@v4
3131
with:
3232
distribution: 'oracle'
33-
java-version: '17'
33+
java-version: '21'
3434
- name: Cache Maven packages
3535
uses: actions/cache@v4
3636
with:

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Definitions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,26 @@ public class Definitions implements Serializable {
6565
public static class LineTagMap implements Serializable {
6666

6767
private static final long serialVersionUID = 1191703801007779481L;
68-
@SuppressWarnings("java:S116")
68+
@SuppressWarnings({"java:S116", "serial"})
6969
private final Map<String, Set<Tag>> sym_tags; //NOPMD
7070

7171
protected LineTagMap() {
7272
this.sym_tags = new HashMap<>();
7373
}
7474
}
7575
// line number -> tag map
76-
@SuppressWarnings("java:S116")
76+
@SuppressWarnings({"java:S116", "serial"})
7777
private final Map<Integer, LineTagMap> line_maps;
7878

7979
/**
8080
* Map from symbol to the line numbers on which the symbol is defined.
8181
*/
82+
@SuppressWarnings("serial")
8283
private final Map<String, Set<Integer>> symbols;
8384
/**
8485
* List of all the tags.
8586
*/
87+
@SuppressWarnings("serial")
8688
private final List<Tag> tags;
8789

8890
public Definitions() {

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/JFlexTokenizer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class JFlexTokenizer extends Tokenizer
4949
* will be owned by the {@link JFlexTokenizer}.
5050
* @param matcher a defined instance
5151
*/
52+
@SuppressWarnings("this-escape")
5253
public JFlexTokenizer(ScanningSymbolMatcher matcher) {
5354
if (matcher == null) {
5455
throw new IllegalArgumentException("`matcher' is null");
@@ -83,10 +84,13 @@ public final void close() throws IOException {
8384
matcher.yyclose();
8485
}
8586

87+
@SuppressWarnings("this-escape")
8688
private final CharTermAttribute termAtt = addAttribute(
8789
CharTermAttribute.class);
90+
@SuppressWarnings("this-escape")
8891
private final OffsetAttribute offsetAtt = addAttribute(
8992
OffsetAttribute.class);
93+
@SuppressWarnings("this-escape")
9094
private final PositionIncrementAttribute posIncrAtt = addAttribute(
9195
PositionIncrementAttribute.class);
9296

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/JFlexXref.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public class JFlexXref implements Xrefer, SymbolMatchedListener,
9999
* will be owned by the {@link JFlexXref}.
100100
* @param matcher a defined instance
101101
*/
102+
@SuppressWarnings("this-escape")
102103
public JFlexXref(ScanningSymbolMatcher matcher) {
103104
if (matcher == null) {
104105
throw new IllegalArgumentException("`matcher' is null");

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/PathTokenizer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public class PathTokenizer extends Tokenizer {
5252
// below should be '/' since we try to convert even windows file separators
5353
// to unix ones
5454
public static final char DEFAULT_DELIMITER = '/';
55+
@SuppressWarnings("this-escape")
5556
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
57+
@SuppressWarnings("this-escape")
5658
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
5759
private int startPosition = 0;
5860
private final char delimiter;

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/plain/DefinitionsTokenStream.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ public class DefinitionsTokenStream extends TokenStream {
4848
*/
4949
private final List<PendingToken> events = new ArrayList<>();
5050

51+
@SuppressWarnings("this-escape")
5152
private final CharTermAttribute termAtt = addAttribute(
5253
CharTermAttribute.class);
54+
@SuppressWarnings("this-escape")
5355
private final OffsetAttribute offsetAtt = addAttribute(
5456
OffsetAttribute.class);
57+
@SuppressWarnings("this-escape")
5558
private final PositionIncrementAttribute posIncrAtt = addAttribute(
5659
PositionIncrementAttribute.class);
5760

opengrok-indexer/src/main/java/org/opengrok/indexer/authorization/AuthorizationEntity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,16 @@ public boolean test(AuthorizationEntity t) {
119119
*/
120120
protected AuthControlFlag flag;
121121
protected String name;
122+
@SuppressWarnings("serial")
122123
protected Map<String, Object> setup = new TreeMap<>();
123124
/**
124125
* Hold current setup - merged with all ancestor's stacks.
125126
*/
126127
protected transient Map<String, Object> currentSetup = new TreeMap<>();
127128

129+
@SuppressWarnings("serial")
128130
private Set<String> forProjects = new TreeSet<>();
131+
@SuppressWarnings("serial")
129132
private Set<String> forGroups = new TreeSet<>();
130133

131134
protected transient boolean working = true;

opengrok-indexer/src/main/java/org/opengrok/indexer/authorization/AuthorizationStack.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class AuthorizationStack extends AuthorizationEntity {
5151

5252
private static final Logger LOGGER = LoggerFactory.getLogger(AuthorizationStack.class);
5353

54+
@SuppressWarnings("serial")
5455
private List<AuthorizationEntity> stack = new ArrayList<>();
5556

5657
public AuthorizationStack() {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ public class Filter implements Serializable {
3737
private static final long serialVersionUID = 3L;
3838

3939
/** The list of exact filenames. */
40+
@SuppressWarnings("serial")
4041
private final Set<String> filenames;
4142
/** The list of filenames with wildcards. */
43+
@SuppressWarnings("serial")
4244
private final List<Pattern> patterns;
4345
/** The list of paths. */
46+
@SuppressWarnings("serial")
4447
private final List<String> paths;
4548
/**
4649
* The full list of all patterns. This list will be saved in the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public OpenGrokThreadFactory(String name) {
4747
@Override
4848
public Thread newThread(@NotNull Runnable runnable) {
4949
Thread thread = Executors.defaultThreadFactory().newThread(Objects.requireNonNull(runnable, "runnable"));
50-
thread.setName(PREFIX + threadPrefix + thread.getId());
50+
thread.setName(PREFIX + threadPrefix + thread.threadId());
5151
return thread;
5252
}
5353
}

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public String getId() {
195195
* @return tab size if set, 0 otherwise
196196
* @see #hasTabSizeSetting()
197197
*/
198-
public int getTabSize() {
198+
public final int getTabSize() {
199199
return tabSize;
200200
}
201201

@@ -233,7 +233,7 @@ public void setIndexed(boolean flag) {
233233
*
234234
* @param tabSize the size of tabs in this project
235235
*/
236-
public void setTabSize(int tabSize) {
236+
public final void setTabSize(int tabSize) {
237237
this.tabSize = tabSize;
238238
}
239239

@@ -262,7 +262,7 @@ public boolean isNavigateWindowEnabled() {
262262
*
263263
* @param navigateWindowEnabled new value of navigateWindowEnabled
264264
*/
265-
public void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
265+
public final void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
266266
this.navigateWindowEnabled = navigateWindowEnabled;
267267
}
268268

@@ -283,7 +283,7 @@ public boolean isMergeCommitsEnabled() {
283283
/**
284284
* @param flag true if project should handle renamed files, false otherwise.
285285
*/
286-
public void setHandleRenamedFiles(boolean flag) {
286+
public final void setHandleRenamedFiles(boolean flag) {
287287
this.handleRenamedFiles = flag;
288288
}
289289

@@ -297,7 +297,7 @@ public boolean isHistoryEnabled() {
297297
/**
298298
* @param flag true if project should have history cache, false otherwise.
299299
*/
300-
public void setHistoryEnabled(boolean flag) {
300+
public final void setHistoryEnabled(boolean flag) {
301301
this.historyEnabled = flag;
302302
}
303303

@@ -311,14 +311,14 @@ public boolean isAnnotationCacheEnabled() {
311311
/**
312312
* @param flag true if project should have annotation cache, false otherwise.
313313
*/
314-
public void setAnnotationCacheEnabled(boolean flag) {
314+
public final void setAnnotationCacheEnabled(boolean flag) {
315315
this.annotationCacheEnabled = flag;
316316
}
317317

318318
/**
319319
* @param flag true if project's repositories should deal with merge commits.
320320
*/
321-
public void setMergeCommitsEnabled(boolean flag) {
321+
public final void setMergeCommitsEnabled(boolean flag) {
322322
this.mergeCommitsEnabled = flag;
323323
}
324324

@@ -332,7 +332,7 @@ public boolean isHistoryBasedReindex() {
332332
/**
333333
* @param flag true if project should handle renamed files, false otherwise.
334334
*/
335-
public void setHistoryBasedReindex(boolean flag) {
335+
public final void setHistoryBasedReindex(boolean flag) {
336336
this.historyBasedReindex = flag;
337337
}
338338

@@ -400,7 +400,7 @@ public void addGroup(Group group) {
400400
}
401401
}
402402

403-
public void setBugPage(String bugPage) {
403+
public final void setBugPage(String bugPage) {
404404
this.bugPage = bugPage;
405405
}
406406

@@ -420,7 +420,7 @@ public String getBugPage() {
420420
* does not contain at least one capture group and the group does not
421421
* contain a single character
422422
*/
423-
public void setBugPattern(String bugPattern) throws PatternSyntaxException {
423+
public final void setBugPattern(String bugPattern) throws PatternSyntaxException {
424424
this.bugPattern = compilePattern(bugPattern);
425425
}
426426

@@ -440,7 +440,7 @@ public String getReviewPage() {
440440
}
441441
}
442442

443-
public void setReviewPage(String reviewPage) {
443+
public final void setReviewPage(String reviewPage) {
444444
this.reviewPage = reviewPage;
445445
}
446446

@@ -460,7 +460,7 @@ public String getReviewPattern() {
460460
* does not contain at least one capture group and the group does not
461461
* contain a single character
462462
*/
463-
public void setReviewPattern(String reviewPattern) throws PatternSyntaxException {
463+
public final void setReviewPattern(String reviewPattern) throws PatternSyntaxException {
464464
this.reviewPattern = compilePattern(reviewPattern);
465465
}
466466

@@ -469,7 +469,7 @@ public void setReviewPattern(String reviewPattern) throws PatternSyntaxException
469469
* project property has a default value.
470470
*/
471471
public final void completeWithDefaults() {
472-
Configuration defaultCfg = new Configuration();
472+
final Configuration defaultCfg = new Configuration();
473473
final RuntimeEnvironment env = RuntimeEnvironment.getInstance();
474474

475475
/*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* The suggester specific configuration.
3838
*/
39-
public class SuggesterConfig {
39+
public final class SuggesterConfig {
4040

4141
public static final boolean ENABLED_DEFAULT = true;
4242
public static final int MAX_RESULTS_DEFAULT = 10;

opengrok-indexer/src/main/java/org/opengrok/indexer/framework/PluginFramework.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public synchronized File getPluginDirectory() {
9797
*
9898
* @param pluginDirectory the directory
9999
*/
100-
public synchronized void setPluginDirectory(File pluginDirectory) {
100+
public final synchronized void setPluginDirectory(File pluginDirectory) {
101101
this.pluginDirectory = pluginDirectory;
102102
}
103103

@@ -106,7 +106,7 @@ public synchronized void setPluginDirectory(File pluginDirectory) {
106106
*
107107
* @param directory the directory path
108108
*/
109-
public synchronized void setPluginDirectory(String directory) {
109+
public final synchronized void setPluginDirectory(String directory) {
110110
setPluginDirectory(directory != null ? new File(directory) : null);
111111
}
112112

opengrok-indexer/src/main/java/org/opengrok/indexer/history/AccuRevRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public class AccuRevRepository extends Repository {
9696
*/
9797
private static final String DEPOT_ROOT = String.format("%s.%s", File.separator, File.separator);
9898

99+
@SuppressWarnings("this-escape")
99100
public AccuRevRepository() {
100101
type = "AccuRev";
101102
datePatterns = new String[]{

opengrok-indexer/src/main/java/org/opengrok/indexer/history/Annotation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* Class representing file annotation, i.e., revision and author for the last
4848
* modification of each line in the file.
4949
*/
50-
public class Annotation {
50+
public final class Annotation {
5151

5252
private static final Logger LOGGER = LoggerFactory.getLogger(Annotation.class);
5353

opengrok-indexer/src/main/java/org/opengrok/indexer/history/AnnotationData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public AnnotationData(String filename) {
5252
this.filename = filename;
5353
}
5454

55+
@SuppressWarnings("serial")
5556
private List<AnnotationLine> annotationLines = new ArrayList<>();
5657
private int widestRevision;
5758
private int widestAuthor;

opengrok-indexer/src/main/java/org/opengrok/indexer/history/BitKeeperRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public class BitKeeperRepository extends Repository {
8888
/**
8989
* The version of the BitKeeper executable. This affects the correct dspec to use for tags.
9090
*/
91+
@SuppressWarnings("serial")
9192
private Version version = null;
9293

9394
/**

opengrok-indexer/src/main/java/org/opengrok/indexer/history/CVSRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class CVSRepository extends RCSRepository {
5858
*/
5959
public static final String CMD_FALLBACK = "cvs";
6060

61+
@SuppressWarnings("this-escape")
6162
public CVSRepository() {
6263
/*
6364
* This variable is set in the ancestor to TRUE which has a side effect

0 commit comments

Comments
 (0)