Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
uses: zricethezav/gitleaks-action@6e41781c235feb424ecc3435610dce20ad349a70 # pin@master


- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
distribution: "corretto"

- name: Delete old dependencies (may trigger Snyk vulnerability otherwise)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_NICHOLAS_PAT }}

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
distribution: "corretto"
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if you'd like to contribute to qpp-conversion-tool.

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

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17 AS builder
FROM eclipse-temurin:21 AS builder

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

# Final stage
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre

RUN mkdir -p /usr/src/run/
COPY --from=builder /usr/src/app/tools/docker/docker-artifacts /usr/src/run/
Expand Down
4 changes: 2 additions & 2 deletions DockerfileTest
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM maven:3.9.6-eclipse-temurin-17 AS builder
FROM maven:3.9.6-eclipse-temurin-21 AS builder

COPY ./ /usr/src/app/
WORKDIR /usr/src/app/

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

# Final stage
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre

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

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ Before you can use the qpp-conversion-tool application, you must install and con

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

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

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

```shell
# When you run 'java -version', you should get 17. For example:
# When you run 'java -version', you should get 21. For example:
java -version
java version "17"
java version "21"
...
```

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

* [Maven](https://maven.apache.org) (version `3.9.6`).
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<name>conversion-tests</name>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cucumber.version>4.2.5</cucumber.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static String get(String variable) {
String value = getIfPresent(variable);
if (value == null) {
LOG.warn(
String.format(NOT_FOUND, variable));
NOT_FOUND.formatted(variable));
}
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ public class MeasuredInputStreamSupplier implements Supplier<InputStream> {
private final int size;

// Oracle and Sonar recommend the constructor before any methods, even static methods
private MeasuredInputStreamSupplier(InputStream source) {
byte[] byteArray;
try {
byteArray = IOUtils.toByteArray(source);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
private MeasuredInputStreamSupplier(byte[] byteArray) {
delegate = () -> new ByteArrayInputStream(byteArray);
this.size = byteArray.length;
}
Expand All @@ -37,8 +31,14 @@ private MeasuredInputStreamSupplier(InputStream source) {
*/
public static MeasuredInputStreamSupplier terminallyTransformInputStream(InputStream source) {
Objects.requireNonNull(source, "source");
byte[] byteArray;
try {
byteArray = IOUtils.toByteArray(source);
} catch (IOException e) {
throw new UncheckedIOException(e);
}

return new MeasuredInputStreamSupplier(source);
return new MeasuredInputStreamSupplier(byteArray);
}

/**
Expand Down
Loading
Loading