Skip to content

Commit 2f8c8f3

Browse files
Merge pull request #1616 from CMSgov/QPPA-11346-openrewrite-java-21-upgrade
QPPA-11346: OpenRewrite Java 21 upgrade
2 parents 361872f + c5d9b10 commit 2f8c8f3

90 files changed

Lines changed: 1252 additions & 599 deletions

File tree

Some content is hidden

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

.github/workflows/ci-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
uses: zricethezav/gitleaks-action@6e41781c235feb424ecc3435610dce20ad349a70 # pin@master
2323

2424

25-
- name: Set up JDK 17
25+
- name: Set up JDK 21
2626
uses: actions/setup-java@v4
2727
with:
28-
java-version: "17"
28+
java-version: "21"
2929
distribution: "corretto"
3030

3131
- name: Delete old dependencies (may trigger Snyk vulnerability otherwise)

.github/workflows/draft-new-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.ACTIONS_NICHOLAS_PAT }}
3737

38-
- name: Set up JDK 17
38+
- name: Set up JDK 21
3939
uses: actions/setup-java@v4
4040
with:
41-
java-version: "17"
41+
java-version: "21"
4242
distribution: "corretto"
4343
cache: 'maven'
4444

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if you'd like to contribute to qpp-conversion-tool.
1717

1818
The additional prerequisites that were not already outlined in the
1919
[main README][readme] are...
20-
- [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (version `>= 17`). The Java Runtime
20+
- [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (version `>= 21`). The Java Runtime
2121
will not suffice.
2222
- [Maven](https://maven.apache.org).
2323

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:17 AS builder
1+
FROM eclipse-temurin:21 AS builder
22

33
ARG MAVEN_VERSION=3.9.6
44
ARG USER_HOME_DIR="/root"
@@ -37,7 +37,7 @@ WORKDIR /usr/src/app/
3737
RUN /usr/local/bin/mvn-entrypoint.sh mvn install -Dmaven.test.skip -Djacoco.skip=true -Dskip.generate=true > /dev/null
3838

3939
# Final stage
40-
FROM eclipse-temurin:17-jre
40+
FROM eclipse-temurin:21-jre
4141

4242
RUN mkdir -p /usr/src/run/
4343
COPY --from=builder /usr/src/app/tools/docker/docker-artifacts /usr/src/run/

DockerfileTest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM maven:3.9.6-eclipse-temurin-17 AS builder
1+
FROM maven:3.9.6-eclipse-temurin-21 AS builder
22

33
COPY ./ /usr/src/app/
44
WORKDIR /usr/src/app/
55

66
RUN mvn install -Dmaven.test.skip -Djacoco.skip=true > /dev/null
77

88
# Final stage
9-
FROM eclipse-temurin:17-jre
9+
FROM eclipse-temurin:21-jre
1010

1111
RUN apt-get update && apt-get install -y dos2unix && rm -rf /var/lib/apt/lists/*
1212

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ Before you can use the qpp-conversion-tool application, you must install and con
1616

1717
[GitHub's Guide to Installing Git](https://help.github.com/articles/set-up-git) is a good source of information.
1818

19-
* [Java Runtime](https://java.com/download) (version `17`).
19+
* [Java Runtime](https://java.com/download) (version `21`).
2020

2121
It is important that you have the right version of `java` on your path.
2222

2323
```shell
24-
# When you run 'java -version', you should get 17. For example:
24+
# When you run 'java -version', you should get 21. For example:
2525
java -version
26-
java version "17"
26+
java version "21"
2727
...
2828
```
2929

3030
Sometimes the Java Runtime installer doesn't update your path. So you must do it manually. Alternatively, download and install
31-
the [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (version `>= 17`). The JDK is
31+
the [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (version `>= 21`). The JDK is
3232
better at updating your path.
3333

3434
* [Maven](https://maven.apache.org) (version `3.9.6`).

acceptance-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<name>conversion-tests</name>
88
<packaging>jar</packaging>
99
<properties>
10-
<java.version>17</java.version>
10+
<java.version>21</java.version>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1212
<cucumber.version>4.2.5</cucumber.version>
1313
</properties>

commons/src/main/java/gov/cms/qpp/conversion/util/EnvironmentHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static String get(String variable) {
3939
String value = getIfPresent(variable);
4040
if (value == null) {
4141
LOG.warn(
42-
String.format(NOT_FOUND, variable));
42+
NOT_FOUND.formatted(variable));
4343
}
4444
return value;
4545
}

commons/src/main/java/gov/cms/qpp/conversion/util/MeasuredInputStreamSupplier.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ public class MeasuredInputStreamSupplier implements Supplier<InputStream> {
1818
private final int size;
1919

2020
// Oracle and Sonar recommend the constructor before any methods, even static methods
21-
private MeasuredInputStreamSupplier(InputStream source) {
22-
byte[] byteArray;
23-
try {
24-
byteArray = IOUtils.toByteArray(source);
25-
} catch (IOException e) {
26-
throw new UncheckedIOException(e);
27-
}
21+
private MeasuredInputStreamSupplier(byte[] byteArray) {
2822
delegate = () -> new ByteArrayInputStream(byteArray);
2923
this.size = byteArray.length;
3024
}
@@ -37,8 +31,14 @@ private MeasuredInputStreamSupplier(InputStream source) {
3731
*/
3832
public static MeasuredInputStreamSupplier terminallyTransformInputStream(InputStream source) {
3933
Objects.requireNonNull(source, "source");
34+
byte[] byteArray;
35+
try {
36+
byteArray = IOUtils.toByteArray(source);
37+
} catch (IOException e) {
38+
throw new UncheckedIOException(e);
39+
}
4040

41-
return new MeasuredInputStreamSupplier(source);
41+
return new MeasuredInputStreamSupplier(byteArray);
4242
}
4343

4444
/**

0 commit comments

Comments
 (0)