Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
name: ${{ matrix.os }} with Java 17
name: ${{ matrix.os }} with Java 21
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -22,11 +22,11 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
java-version: '21'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
steps:
- name: Checkout master branch
uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
steps:
- name: Checkout master branch
uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FROM ubuntu:jammy AS build

# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y openjdk-17-jdk python3 python3-venv && \
RUN apt-get update && apt-get install --no-install-recommends -y openjdk-21-jdk python3 python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -41,7 +41,7 @@ RUN cp `ls -t distribution/target/*.tar.gz | head -1` /opengrok.tar.gz
# Store the version in a file so that the tools can report it.
RUN /mvn/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout > /mvn/VERSION

FROM tomcat:10.1.30-jdk17
FROM tomcat:10.1.31-jdk21
LABEL maintainer="https://github.com/oracle/opengrok"
LABEL org.opencontainers.image.source="https://github.com/oracle/opengrok"
LABEL org.opencontainers.image.description="OpenGrok code search"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,26 @@ public class Definitions implements Serializable {
public static class LineTagMap implements Serializable {

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

protected LineTagMap() {
this.sym_tags = new HashMap<>();
}
}
// line number -> tag map
@SuppressWarnings("java:S116")
@SuppressWarnings({"java:S116", "serial"})
private final Map<Integer, LineTagMap> line_maps;

/**
* Map from symbol to the line numbers on which the symbol is defined.
*/
@SuppressWarnings("serial")
private final Map<String, Set<Integer>> symbols;
/**
* List of all the tags.
*/
@SuppressWarnings("serial")
private final List<Tag> tags;

public Definitions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class JFlexTokenizer extends Tokenizer
* will be owned by the {@link JFlexTokenizer}.
* @param matcher a defined instance
*/
@SuppressWarnings("this-escape")
public JFlexTokenizer(ScanningSymbolMatcher matcher) {
if (matcher == null) {
throw new IllegalArgumentException("`matcher' is null");
Expand Down Expand Up @@ -83,10 +84,13 @@ public final void close() throws IOException {
matcher.yyclose();
}

@SuppressWarnings("this-escape")
private final CharTermAttribute termAtt = addAttribute(
CharTermAttribute.class);
@SuppressWarnings("this-escape")
private final OffsetAttribute offsetAtt = addAttribute(
OffsetAttribute.class);
@SuppressWarnings("this-escape")
private final PositionIncrementAttribute posIncrAtt = addAttribute(
PositionIncrementAttribute.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public class JFlexXref implements Xrefer, SymbolMatchedListener,
* will be owned by the {@link JFlexXref}.
* @param matcher a defined instance
*/
@SuppressWarnings("this-escape")
public JFlexXref(ScanningSymbolMatcher matcher) {
if (matcher == null) {
throw new IllegalArgumentException("`matcher' is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public class PathTokenizer extends Tokenizer {
// below should be '/' since we try to convert even windows file separators
// to unix ones
public static final char DEFAULT_DELIMITER = '/';
@SuppressWarnings("this-escape")
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
@SuppressWarnings("this-escape")
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
private int startPosition = 0;
private final char delimiter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ public class DefinitionsTokenStream extends TokenStream {
*/
private final List<PendingToken> events = new ArrayList<>();

@SuppressWarnings("this-escape")
private final CharTermAttribute termAtt = addAttribute(
CharTermAttribute.class);
@SuppressWarnings("this-escape")
private final OffsetAttribute offsetAtt = addAttribute(
OffsetAttribute.class);
@SuppressWarnings("this-escape")
private final PositionIncrementAttribute posIncrAtt = addAttribute(
PositionIncrementAttribute.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,16 @@ public boolean test(AuthorizationEntity t) {
*/
protected AuthControlFlag flag;
protected String name;
@SuppressWarnings("serial")
protected Map<String, Object> setup = new TreeMap<>();
/**
* Hold current setup - merged with all ancestor's stacks.
*/
protected transient Map<String, Object> currentSetup = new TreeMap<>();

@SuppressWarnings("serial")
private Set<String> forProjects = new TreeSet<>();
@SuppressWarnings("serial")
private Set<String> forGroups = new TreeSet<>();

protected transient boolean working = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class AuthorizationStack extends AuthorizationEntity {

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

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

public AuthorizationStack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ public class Filter implements Serializable {
private static final long serialVersionUID = 3L;

/** The list of exact filenames. */
@SuppressWarnings("serial")
private final Set<String> filenames;
/** The list of filenames with wildcards. */
@SuppressWarnings("serial")
private final List<Pattern> patterns;
/** The list of paths. */
@SuppressWarnings("serial")
private final List<String> paths;
/**
* The full list of all patterns. This list will be saved in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public OpenGrokThreadFactory(String name) {
@Override
public Thread newThread(@NotNull Runnable runnable) {
Thread thread = Executors.defaultThreadFactory().newThread(Objects.requireNonNull(runnable, "runnable"));
thread.setName(PREFIX + threadPrefix + thread.getId());
thread.setName(PREFIX + threadPrefix + thread.threadId());
return thread;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public String getId() {
* @return tab size if set, 0 otherwise
* @see #hasTabSizeSetting()
*/
public int getTabSize() {
public final int getTabSize() {
return tabSize;
}

Expand Down Expand Up @@ -233,7 +233,7 @@ public void setIndexed(boolean flag) {
*
* @param tabSize the size of tabs in this project
*/
public void setTabSize(int tabSize) {
public final void setTabSize(int tabSize) {
this.tabSize = tabSize;
}

Expand Down Expand Up @@ -262,7 +262,7 @@ public boolean isNavigateWindowEnabled() {
*
* @param navigateWindowEnabled new value of navigateWindowEnabled
*/
public void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
public final void setNavigateWindowEnabled(boolean navigateWindowEnabled) {
this.navigateWindowEnabled = navigateWindowEnabled;
}

Expand All @@ -283,7 +283,7 @@ public boolean isMergeCommitsEnabled() {
/**
* @param flag true if project should handle renamed files, false otherwise.
*/
public void setHandleRenamedFiles(boolean flag) {
public final void setHandleRenamedFiles(boolean flag) {
this.handleRenamedFiles = flag;
}

Expand All @@ -297,7 +297,7 @@ public boolean isHistoryEnabled() {
/**
* @param flag true if project should have history cache, false otherwise.
*/
public void setHistoryEnabled(boolean flag) {
public final void setHistoryEnabled(boolean flag) {
this.historyEnabled = flag;
}

Expand All @@ -311,14 +311,14 @@ public boolean isAnnotationCacheEnabled() {
/**
* @param flag true if project should have annotation cache, false otherwise.
*/
public void setAnnotationCacheEnabled(boolean flag) {
public final void setAnnotationCacheEnabled(boolean flag) {
this.annotationCacheEnabled = flag;
}

/**
* @param flag true if project's repositories should deal with merge commits.
*/
public void setMergeCommitsEnabled(boolean flag) {
public final void setMergeCommitsEnabled(boolean flag) {
this.mergeCommitsEnabled = flag;
}

Expand All @@ -332,7 +332,7 @@ public boolean isHistoryBasedReindex() {
/**
* @param flag true if project should handle renamed files, false otherwise.
*/
public void setHistoryBasedReindex(boolean flag) {
public final void setHistoryBasedReindex(boolean flag) {
this.historyBasedReindex = flag;
}

Expand Down Expand Up @@ -400,7 +400,7 @@ public void addGroup(Group group) {
}
}

public void setBugPage(String bugPage) {
public final void setBugPage(String bugPage) {
this.bugPage = bugPage;
}

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

Expand All @@ -440,7 +440,7 @@ public String getReviewPage() {
}
}

public void setReviewPage(String reviewPage) {
public final void setReviewPage(String reviewPage) {
this.reviewPage = reviewPage;
}

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

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

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/**
* The suggester specific configuration.
*/
public class SuggesterConfig {
public final class SuggesterConfig {

public static final boolean ENABLED_DEFAULT = true;
public static final int MAX_RESULTS_DEFAULT = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public synchronized File getPluginDirectory() {
*
* @param pluginDirectory the directory
*/
public synchronized void setPluginDirectory(File pluginDirectory) {
public final synchronized void setPluginDirectory(File pluginDirectory) {
this.pluginDirectory = pluginDirectory;
}

Expand All @@ -106,7 +106,7 @@ public synchronized void setPluginDirectory(File pluginDirectory) {
*
* @param directory the directory path
*/
public synchronized void setPluginDirectory(String directory) {
public final synchronized void setPluginDirectory(String directory) {
setPluginDirectory(directory != null ? new File(directory) : null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class AccuRevRepository extends Repository {
*/
private static final String DEPOT_ROOT = String.format("%s.%s", File.separator, File.separator);

@SuppressWarnings("this-escape")
public AccuRevRepository() {
type = "AccuRev";
datePatterns = new String[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* Class representing file annotation, i.e., revision and author for the last
* modification of each line in the file.
*/
public class Annotation {
public final class Annotation {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public AnnotationData(String filename) {
this.filename = filename;
}

@SuppressWarnings("serial")
private List<AnnotationLine> annotationLines = new ArrayList<>();
private int widestRevision;
private int widestAuthor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class BitKeeperRepository extends Repository {
/**
* The version of the BitKeeper executable. This affects the correct dspec to use for tags.
*/
@SuppressWarnings("serial")
private Version version = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class CVSRepository extends RCSRepository {
*/
public static final String CMD_FALLBACK = "cvs";

@SuppressWarnings("this-escape")
public CVSRepository() {
/*
* This variable is set in the ancestor to TRUE which has a side effect
Expand Down
Loading
Loading