Skip to content

switch to Java 21 for build/Docker #4759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
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/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
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
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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2018, 2024 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2025 Oracle and/or its affiliates. All rights reserved.
# Portions Copyright (c) 2020, Chris Fraire <[email protected]>.

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.40-jdk17
FROM tomcat:10.1.40-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
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ image based on the official one.
## Additional info about the image

* Tomcat 10
* JRE 17
* JRE 21
* Configurable mirroring/reindexing (default every 10 min)

The mirroring step works by going through all projects and attempting to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.analysis;
Expand Down Expand Up @@ -66,24 +66,24 @@ public static class LineTagMap implements Serializable {

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

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

/**
* Map from symbol to the line numbers on which the symbol is defined.
*/
private final Map<String, Set<Integer>> symbols;
private final HashMap<String, Set<Integer>> symbols;
/**
* List of all the tags.
*/
private final List<Tag> tags;
private final ArrayList<Tag> tags;

public Definitions() {
symbols = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.analysis;
Expand Down 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,12 +84,9 @@ public final void close() throws IOException {
matcher.yyclose();
}

private final CharTermAttribute termAtt = addAttribute(
CharTermAttribute.class);
private final OffsetAttribute offsetAtt = addAttribute(
OffsetAttribute.class);
private final PositionIncrementAttribute posIncrAtt = addAttribute(
PositionIncrementAttribute.class);
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
private final PositionIncrementAttribute posIncrAtt = addAttribute(PositionIncrementAttribute.class);

/**
* Attempts to advance the stream to the next acceptable token, and updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2011, Jens Elkner.
* Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected]>.
*/
Expand All @@ -37,8 +37,7 @@
/**
* @author Lubos Kosco
*/
public class JFlexXref implements Xrefer, SymbolMatchedListener,
NonSymbolMatchedListener {
public class JFlexXref implements Xrefer, SymbolMatchedListener, NonSymbolMatchedListener {

/**
* Used to indicate pre-formatted output with
Expand Down Expand Up @@ -99,6 +98,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 All @@ -109,11 +109,11 @@ public JFlexXref(ScanningSymbolMatcher matcher) {
// The xrefer will own the matcher, so we won't have to unsubscribe.

userPageLink = RuntimeEnvironment.getInstance().getUserPage();
if (userPageLink != null && userPageLink.length() == 0) {
if (userPageLink != null && userPageLink.isEmpty()) {
userPageLink = null;
}
userPageSuffix = RuntimeEnvironment.getInstance().getUserPageSuffix();
if (userPageSuffix != null && userPageSuffix.length() == 0) {
if (userPageSuffix != null && userPageSuffix.isEmpty()) {
userPageSuffix = null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.analysis;
Expand Down 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 @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.analysis.plain;
Expand Down Expand Up @@ -48,12 +48,12 @@ public class DefinitionsTokenStream extends TokenStream {
*/
private final List<PendingToken> events = new ArrayList<>();

private final CharTermAttribute termAtt = addAttribute(
CharTermAttribute.class);
private final OffsetAttribute offsetAtt = addAttribute(
OffsetAttribute.class);
private final PositionIncrementAttribute posIncrAtt = addAttribute(
PositionIncrementAttribute.class);
@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);

private int offset;

Expand All @@ -65,8 +65,7 @@ public class DefinitionsTokenStream extends TokenStream {
* @param wrapper an optional instance
* @throws IOException if I/O error occurs
*/
public void initialize(Definitions defs, StreamSource src,
ReaderWrapper wrapper) throws IOException {
public void initialize(Definitions defs, StreamSource src, ReaderWrapper wrapper) throws IOException {
if (defs == null) {
throw new IllegalArgumentException("`defs' is null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.authorization;
Expand Down Expand Up @@ -119,14 +119,14 @@ public boolean test(AuthorizationEntity t) {
*/
protected AuthControlFlag flag;
protected String name;
protected Map<String, Object> setup = new TreeMap<>();
protected transient Map<String, Object> setup = new TreeMap<>();
/**
* Hold current setup - merged with all ancestor's stacks.
*/
protected transient Map<String, Object> currentSetup = new TreeMap<>();

private Set<String> forProjects = new TreeSet<>();
private Set<String> forGroups = new TreeSet<>();
private transient Set<String> forProjects = new TreeSet<>();
private transient Set<String> forGroups = new TreeSet<>();

protected transient boolean working = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.authorization;
Expand Down Expand Up @@ -51,7 +51,7 @@ public class AuthorizationStack extends AuthorizationEntity {

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

private List<AuthorizationEntity> stack = new ArrayList<>();
private transient List<AuthorizationEntity> stack = new ArrayList<>();

public AuthorizationStack() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/*
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
*/
package org.opengrok.indexer.configuration;
Expand All @@ -37,11 +37,11 @@ public class Filter implements Serializable {
private static final long serialVersionUID = 3L;

/** The list of exact filenames. */
private final Set<String> filenames;
private final transient Set<String> filenames;
/** The list of filenames with wildcards. */
private final List<Pattern> patterns;
private final transient List<Pattern> patterns;
/** The list of paths. */
private final List<String> paths;
private final transient List<String> paths;
/**
* The full list of all patterns. This list will be saved in the
* configuration file (if used).
Expand Down
Loading
Loading