Skip to content

Commit

Permalink
Support for open JDK 21 by updating dependencies (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
napoly authored Mar 9, 2024
1 parent c72372b commit c777133
Show file tree
Hide file tree
Showing 254 changed files with 1,596 additions and 1,963 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Build with Gradle
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codacy-code-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: Publish coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'adopt'

- name: Build with Gradle
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -47,8 +54,8 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -57,8 +64,8 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# ./gradlew build
- name: Build
run: ./gradlew build --stacktrace -x test -x checkstyleMain -x checkstyleTest

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Bounty explanation
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
if: github.event.label.name == '💰bounty'
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
20 changes: 12 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
classpath 'com.github.johnrengelman:shadow:8.1.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.6.3'
classpath 'com.gradle:gradle-enterprise-gradle-plugin:3.12.4' // added for windows build verification-metadata.xml error
classpath 'com.gradle:gradle-enterprise-gradle-plugin:3.16.1' // added for windows build verification-metadata.xml error
}
}

Expand All @@ -31,7 +31,7 @@ configure(subprojects) {
apply plugin: 'jacoco-report-aggregation'
apply plugin: 'checkstyle'

sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21

ext { // in alphabetical order
bcVersion = '1.63'
Expand All @@ -47,16 +47,16 @@ configure(subprojects) {
fontawesomefxMaterialdesignfontVersion = '2.0.26-9.1.2'
grpcVersion = '1.42.1'
gsonVersion = '2.8.5'
guavaVersion = '30.1.1-jre'
guiceVersion = '5.1.0'
guavaVersion = '32.1.1-jre'
guiceVersion = '7.0.0'
moneroJavaVersion = '0.8.10'
httpclient5Version = '5.0'
hamcrestVersion = '2.2'
httpclientVersion = '4.5.12'
httpcoreVersion = '4.4.13'
ioVersion = '2.6'
jacksonVersion = '2.12.1'
javafxVersion = '16'
javafxVersion = '21.0.2'
javaxAnnotationVersion = '1.2'
jcsvVersion = '1.4.0'
jetbrainsAnnotationsVersion = '13.0'
Expand All @@ -69,8 +69,8 @@ configure(subprojects) {
langVersion = '3.11'
logbackVersion = '1.1.11'
loggingVersion = '1.2'
lombokVersion = '1.18.24'
mockitoVersion = '5.2.0'
lombokVersion = '1.18.30'
mockitoVersion = '5.10.0'
netlayerVersion = '6797461310f077bbea4f43a3a509c077b0ed8c34' // Netlayer version 0.7.3 with Tor browser version 11.0.14 and tor binary version: 0.4.7.7
protobufVersion = '3.19.1'
protocVersion = protobufVersion
Expand Down Expand Up @@ -174,7 +174,11 @@ configure([project(':cli'),
if (applicationName == 'desktop') {
def script = file("${rootProject.projectDir}/haveno-$applicationName")
script.text = script.text.replace(
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4g"')
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4g ' +
'--add-opens=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED ' +
'--add-opens=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED ' +
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED ' +
'--add-opens=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED"')
}

if (applicationName == 'apitest') {
Expand Down
5 changes: 2 additions & 3 deletions common/src/main/java/haveno/common/ClockWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

package haveno.common;

import lombok.extern.slf4j.Slf4j;

import javax.inject.Singleton;
import com.google.inject.Singleton;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;

// Helps configure listener objects that are run by the `UserThread` each second
// and can do per second, per minute and delayed second actions. Also detects when we were in standby, and logs it.
Expand Down
11 changes: 5 additions & 6 deletions common/src/main/java/haveno/common/crypto/KeyRing.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

package haveno.common.crypto;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.security.KeyPair;
import javax.annotation.Nullable;
import javax.crypto.SecretKey;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nullable;
import javax.crypto.SecretKey;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.security.KeyPair;

@Getter
@EqualsAndHashCode
@Slf4j
Expand Down
16 changes: 7 additions & 9 deletions common/src/main/java/haveno/common/crypto/KeyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
package haveno.common.crypto;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import haveno.common.config.Config;
import haveno.common.file.FileUtil;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.crypto.SecretKey;
import javax.inject.Named;
import javax.inject.Singleton;
import static haveno.common.util.Preconditions.checkDir;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand All @@ -48,8 +44,10 @@
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.RSAPublicKeySpec;

import static haveno.common.util.Preconditions.checkDir;
import javax.crypto.SecretKey;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* KeyStorage uses password protection to save a symmetric key in PKCS#12 format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

package haveno.common.file;

import lombok.extern.slf4j.Slf4j;

import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package haveno.common.persistence;

import static com.google.common.base.Preconditions.checkNotNull;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import haveno.common.Timer;
import haveno.common.UserThread;
import haveno.common.app.DevEnv;
Expand All @@ -30,13 +32,9 @@
import haveno.common.handlers.ResultHandler;
import haveno.common.proto.persistable.PersistableEnvelope;
import haveno.common.proto.persistable.PersistenceProtoResolver;
import haveno.common.util.SingleThreadExecutorUtils;
import haveno.common.util.GcUtil;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nullable;
import javax.inject.Named;
import static haveno.common.util.Preconditions.checkDir;
import haveno.common.util.SingleThreadExecutorUtils;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
Expand All @@ -51,9 +49,9 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;

import static com.google.common.base.Preconditions.checkNotNull;
import static haveno.common.util.Preconditions.checkDir;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
* Responsible for reading persisted data and writing it on disk. We read usually only at start-up and keep data in RAM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Charsets;
import com.google.inject.Inject;
import haveno.common.UserThread;
import haveno.common.crypto.CryptoException;
import haveno.common.crypto.Hash;
Expand All @@ -34,11 +35,6 @@
import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;

import javax.inject.Inject;
import java.math.BigInteger;
import java.security.PublicKey;
import java.security.SignatureException;
Expand All @@ -56,6 +52,9 @@
import java.util.Set;
import java.util.Stack;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;

@Slf4j
public class SignedWitnessService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

package haveno.core.account.sign;

import com.google.inject.Inject;
import com.google.inject.name.Named;
import haveno.common.config.Config;
import haveno.common.persistence.PersistenceManager;
import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
import haveno.network.p2p.storage.persistence.MapStoreService;
import lombok.extern.slf4j.Slf4j;

import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SignedWitnessStorageService extends MapStoreService<SignedWitnessStore, PersistableNetworkPayload> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package haveno.core.account.witness;

import com.google.common.annotations.VisibleForTesting;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.inject.Inject;
import haveno.common.UserThread;
import haveno.common.crypto.CryptoException;
import haveno.common.crypto.Hash;
Expand Down Expand Up @@ -51,12 +53,6 @@
import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;

import javax.inject.Inject;
import java.math.BigInteger;
import java.security.PublicKey;
import java.time.Clock;
Expand All @@ -74,8 +70,10 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.google.common.base.Preconditions.checkNotNull;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;

@Slf4j
public class AccountAgeWitnessService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

package haveno.core.account.witness;

import com.google.inject.Inject;
import com.google.inject.name.Named;
import haveno.common.config.Config;
import haveno.common.persistence.PersistenceManager;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
import haveno.network.p2p.storage.persistence.HistoricalDataStoreService;
import lombok.extern.slf4j.Slf4j;

import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AccountAgeWitnessStorageService extends HistoricalDataStoreService<AccountAgeWitnessStore> {
Expand Down
Loading

0 comments on commit c777133

Please sign in to comment.