Skip to content
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

Chore: Update JDK version used throughout the project #714

Closed
Closed
Show file tree
Hide file tree
Changes from 5 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 .config/pmd-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<exclude name="AtLeastOneConstructor"/>
<!-- Clashes with the usage of var -->
<exclude name="UseDiamondOperator"/>
<!-- Deprecated and counterproductive per PMD doc (replaced by CommentDefaultAccessModifier) -->
<exclude name="DefaultPackage"/>
<!-- Counterproductive -->
<exclude name="CommentDefaultAccessModifier"/>
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
</rule>
<rule ref="category/java/design.xml">
<exclude name="LoosePackageCoupling"/>
Expand All @@ -47,7 +47,7 @@
<!-- Classes should generally use generated SerialVersionUID unless there is a reason to implement compatibility. -->
<exclude name="MissingSerialVersionUID"/>
<!-- Too many false positives, as the rules assumes every class is serializable. -->
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="NonSerializableClass"/>
</rule>
<rule ref="category/java/multithreading.xml">
<exclude name="DoNotUseThreads" />
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

# Initializes the CodeQL tools for scanning.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependencies-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eclipse-dash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/int-test-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonar analysis

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

- name: Cache maven packages
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/irs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Cache maven packages
Expand All @@ -54,10 +54,10 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonar analysis

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/irs-load-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/owasp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Cache maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2

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

- name: Setup Node
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-swagger-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Setup node
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-registry-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Create new version
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- Shells in Job response will contain all submodel descriptors returned by provider, instead filtered by aspect-type parameter. #510
- Updated contributing, notice, and readme files for TRG 7 #681
- Handling of expired policies when approving a notification eclipse-tractusx/traceability-foss#639
- The project now uses JDK version 21 instead of 17.
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved

## Added

Expand Down
2 changes: 1 addition & 1 deletion DOCKER_NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Item-Relationship-Service

**Used base image**

- [eclipse-temurin:17-jre-alpine](https://github.com/adoptium/containers)
- [eclipse-temurin:21-jre-alpine](https://github.com/adoptium/containers)
- Official Eclipse Temurin DockerHub page: https://hub.docker.com/_/eclipse-temurin
- Eclipse Temurin Project: https://projects.eclipse.org/projects/adoptium.temurin
- Additional information about the Eclipse Temurin
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# * SPDX-License-Identifier: Apache-2.0

# Dependencies
FROM maven:3-eclipse-temurin-17-alpine AS maven
FROM maven:3-eclipse-temurin-21-alpine AS maven
ARG BUILD_TARGET=irs-api

WORKDIR /build
Expand Down Expand Up @@ -48,7 +48,7 @@ RUN --mount=type=cache,target=/root/.m2 mvn -B clean package -pl :$BUILD_TARGET


# Copy the jar and build image
FROM eclipse-temurin:17-jre-alpine AS irs-api
FROM eclipse-temurin:21-jre-alpine AS irs-api

WORKDIR /app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
Expand Down Expand Up @@ -54,9 +55,9 @@ public class ItemTreesAssembler {
/* package */ ItemContainer retrieveItemGraph(final Stream<ItemContainer> partialGraph) {
final var relationships = new LinkedHashSet<Relationship>();
final var numberOfPartialTrees = new AtomicInteger();
final ArrayList<Tombstone> tombstones = new ArrayList<>();
final ArrayList<Shell> shells = new ArrayList<>();
final ArrayList<Submodel> submodels = new ArrayList<>();
final List<Tombstone> tombstones = new ArrayList<>();
final List<Shell> shells = new ArrayList<>();
final List<Submodel> submodels = new ArrayList<>();
final Set<Bpn> bpns = new HashSet<>();

partialGraph.forEachOrdered(itemGraph -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -50,7 +51,7 @@ interface BpnInvestigationJobCache {
@Service
class InMemoryBpnInvestigationJobCache implements BpnInvestigationJobCache {

private final ConcurrentHashMap<UUID, BpnInvestigationJob> inMemory = new ConcurrentHashMap<>();
private final Map<UUID, BpnInvestigationJob> inMemory = new ConcurrentHashMap<>();

@Override
public List<BpnInvestigationJob> findAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ private HttpEntity<String> toEntity(final String body) {
return new HttpEntity<>(body, headers());
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
private HttpHeaders headers() {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private void triggerInvestigationOnNextLevel(final Jobs completedJob,
final Map<String, List<String>> bpns = getBPNsFromRelationships(completedJob.getRelationships());
log.debug("Extracted BPNs '{}'", bpns);

final HashMap<String, List<String>> resolvedBPNs = new HashMap<>();
final Map<String, List<String>> resolvedBPNs = new HashMap<>();
bpns.keySet().forEach(bpn -> resolvedBPNs.put(bpn, connectorEndpointsService.fetchConnectorEndpoints(bpn)));
log.debug("Found Endpoints to BPNs '{}'", resolvedBPNs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
********************************************************************************/
package org.eclipse.tractusx.irs.ess.service;

import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -46,7 +47,7 @@ interface RelatedInvestigationJobsCache {
@Service
class InMemoryRelatedInvestigationJobsCache implements RelatedInvestigationJobsCache {

private final ConcurrentHashMap<String, RelatedInvestigationJobs> inMemory = new ConcurrentHashMap<>();
private final Map<String, RelatedInvestigationJobs> inMemory = new ConcurrentHashMap<>();

@Override
public void store(final String notificationId, final RelatedInvestigationJobs relatedInvestigationJobs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public JobHandle registerItemJob(final @NonNull RegisterJob request, final UUID

private void validateAspectTypeValues(final List<String> aspectTypeValues) {
try {
final HashSet<AspectModel> availableModels = new HashSet<>(
final Set<AspectModel> availableModels = new HashSet<>(
semanticsHubFacade.getAllAspectModels().models());
log.debug("Number of available AspectModels: '{}'", availableModels.size());
log.debug("Provided AspectModels: '{}'", aspectTypeValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private ProcessingState calculateProcessingState(final List<JobProgress> progres
}
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
record LimitedJobEventQueue(ConcurrentLinkedQueue<JobProcessingFinishedEvent> linkedQueue, Integer limit) {
private boolean hasReachLimit() {
return linkedQueue.size() == limit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private TransferProcessResponse getTransferProcessResponse(final Response transf
return edcRestTemplate.exchange(url, HttpMethod.GET, objectHttpEntity, TransferProcessResponse.class).getBody();
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
private HttpHeaders headers() {
final HttpHeaders headers = new HttpHeaders();
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public String getData(final EndpointDataReference dataReference, final String su
return extractEmbeddedData(response);
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
public EdcNotificationResponse sendData(final EndpointDataReference dataReference,
final EdcNotification<NotificationContent> notification) {
final String url = dataReference.getEndpoint();
Expand All @@ -77,6 +78,7 @@ public EdcNotificationResponse sendData(final EndpointDataReference dataReferenc
return () -> response.getStatusCode().is2xxSuccessful();
}

@SuppressWarnings({ "PMD.LooseCoupling" })
private HttpHeaders headers(final EndpointDataReference dataReference) {
final HttpHeaders headers = new HttpHeaders();
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ private EdcContractAgreementRequest buildContractAgreementRequest(final List<Str
return new EdcContractAgreementRequest(edcContractAgreementFilterExpression);
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
private HttpHeaders headers() {
final HttpHeaders headers = new HttpHeaders();
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -277,7 +278,7 @@ public List<AcceptedPolicy> getAcceptedPolicies(final String bpn) {
}

private static Stream<Policy> sortByPolicyId(final List<Policy> policies) {
final TreeSet<Policy> result = new TreeSet<>(Comparator.comparing(Policy::getPolicyId));
final Set<Policy> result = new TreeSet<>(Comparator.comparing(Policy::getPolicyId));
result.addAll(policies);
return result.stream();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private String encodeWithBase64(final IdentifierKeyValuePair assetIds) {
return Base64.getEncoder().encodeToString(serializationHelper.serialize(assetIds));
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
private HttpHeaders headers(final EndpointDataReference dataReference) {
final HttpHeaders headers = new HttpHeaders();
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public AssetAdministrationShellDescriptor createShell(
"Failed to create shell %s".formatted(assetAdministrationShellDescriptor.getGlobalAssetId()));
}

@SuppressWarnings({ "PMD.LooseCoupling" })
ds-pweick marked this conversation as resolved.
Show resolved Hide resolved
private HttpHeaders headers() {
final HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</modules>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -113,7 +113,7 @@
<checkstyle-plugin.version>3.3.1</checkstyle-plugin.version>
<checkstyle.version>10.12.6</checkstyle.version>
<jacoco.version>0.8.10</jacoco.version>
<pmd-plugin.version>3.19.0</pmd-plugin.version>
<pmd-plugin.version>3.23.0</pmd-plugin.version>
<owasp-plugin.version>8.2.1</owasp-plugin.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<jar-plugin.version>3.3.0</jar-plugin.version>
Expand Down
Loading