Skip to content

Commit

Permalink
Merge pull request #229 from AAFC-BICoE/34080_update_to_Java_21
Browse files Browse the repository at this point in the history
34080 update to java 21
  • Loading branch information
brandonandre authored Jun 25, 2024
2 parents 75737b2 + fdfeb46 commit 50ec3f0
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 34 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ jobs:
runs-on: ubuntu-latest

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

- name: Build with Maven
run: mvn verify
run: mvn -B -q verify
- name: Run Checkstyle
run: mvn checkstyle:check
run: mvn -q checkstyle:check
- name: Run SpotBugs
run: mvn com.github.spotbugs:spotbugs-maven-plugin:check
run: mvn -q com.github.spotbugs:spotbugs-maven-plugin:check
- name: Run OWASP dependency-check (only on dev)
run: mvn org.owasp:dependency-check-maven:check
run: mvn -q org.owasp:dependency-check-maven:check
if: ${{ github.ref == 'refs/heads/dev' }}

- name: Extract Version
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre-jammy
FROM eclipse-temurin:21-jre-jammy

RUN useradd -s /bin/bash user
USER user
Expand Down
24 changes: 9 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@
</parent>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<javax.inject.version>1</javax.inject.version>
<!-- Different from SpringBoot javax-jaxb.version since they don't manage jaxb-core and jaxb-impl-->
<javax.interceptor-api>1.2.2</javax.interceptor-api>
<spotbugs-maven-plugin.version>4.6.0.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.7.1</spotbugs.version>

<spotbugs-maven-plugin.version>4.8.5.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.8.5</spotbugs.version>

<!-- Override SpringBoot version (3.6) to avoid NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent -->
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>

<dependency.check.version>8.3.1</dependency.check.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<dependency.check.version>8.4.3</dependency.check.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>

<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
<checkstyle.version>9.3</checkstyle.version>
<checkstyle-antlr.version>4.9.3</checkstyle-antlr.version>
<maven-checkstyle-plugin.version>3.4.0</maven-checkstyle-plugin.version>
<checkstyle.version>10.17.0</checkstyle.version>

<asciidoctor-maven-plugin.version>2.1.0</asciidoctor-maven-plugin.version>
<dina-base-api.version>0.125</dina-base-api.version>

<postgresql.version>42.4.3</postgresql.version>
<postgresql.version>42.4.4</postgresql.version>
<snakeyaml.version>1.33</snakeyaml.version>
<spring-boot-maven-plugin.fork>false</spring-boot-maven-plugin.fork>

Expand Down Expand Up @@ -171,11 +170,6 @@
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${checkstyle-antlr.version}</version>
</dependency>
</dependencies>
<configuration>
<configLocation>checkstyle.xml</configLocation>
Expand Down
4 changes: 4 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ See https://spotbugs.readthedocs.io/en/latest/filter.html
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>

</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public <T> List<T> findAll(@NonNull Class<T> entityClass, @NonNull PredicateSupp
@NonNull Set<String> relationships) {

List<T> itemsList = super.findAll(entityClass, where, orderBy, startIndex, maxResult, includes, relationships);
if(PcrBatchItem.class == entityClass) {
if (PcrBatchItem.class == entityClass) {
itemsList.forEach(t -> setCellNumber((PcrBatchItem) t));
}
return itemsList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public <T> List<T> findAll(@NonNull Class<T> entityClass, @NonNull PredicateSupp
@NonNull Set<String> relationships) {

List<T> itemsList = super.findAll(entityClass, where, orderBy, startIndex, maxResult, includes, relationships);
if(SeqReaction.class == entityClass) {
if (SeqReaction.class == entityClass) {
itemsList.forEach(t -> setCellNumber((SeqReaction) t));
}
return itemsList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.SeqSubmission;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class SeqSubmissionService extends DefaultDinaService<SeqSubmission> {

Expand All @@ -23,4 +25,9 @@ public SeqSubmissionService(
protected void preCreate(SeqSubmission entity) {
entity.setUuid(UUID.randomUUID());
}

// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import java.util.UUID;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class SequencingFacilityService extends DefaultDinaService<SequencingFacility> {

Expand All @@ -23,5 +25,10 @@ public SequencingFacilityService(
protected void preCreate(SequencingFacility entity) {
entity.setUuid(UUID.randomUUID());
}

// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.ThermocyclerProfile;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class ThermocyclerProfileService extends DefaultDinaService<ThermocyclerProfile> {

Expand All @@ -23,5 +25,9 @@ public ThermocyclerProfileService(
protected void preCreate(ThermocyclerProfile entity) {
entity.setUuid(UUID.randomUUID());
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.libraryprep.IndexSet;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class IndexSetService extends DefaultDinaService<IndexSet> {

Expand All @@ -23,5 +25,9 @@ public IndexSetService(
protected void preCreate(IndexSet entity) {
entity.setUuid(UUID.randomUUID());
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.libraryprep.LibraryPrepBatch;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class LibraryPrepBatchService extends DefaultDinaService<LibraryPrepBatch> {

Expand All @@ -23,5 +25,9 @@ public LibraryPrepBatchService(
protected void preCreate(LibraryPrepBatch entity) {
entity.setUuid(UUID.randomUUID());
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import ca.gc.aafc.seqdb.api.validation.ContainerLocationValidator;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class LibraryPrepService extends DefaultDinaService<LibraryPrep> {

Expand Down Expand Up @@ -93,5 +95,10 @@ private void handleOverlap(LibraryPrep libraryPrep) {
}
}
}

// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.libraryprep.NgsIndex;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class NgsIndexService extends DefaultDinaService<NgsIndex> {

Expand All @@ -23,5 +25,9 @@ public NgsIndexService(
protected void preCreate(NgsIndex entity) {
entity.setUuid(UUID.randomUUID());
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import ca.gc.aafc.seqdb.api.entities.pooledlibraries.LibraryPoolContent;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class LibraryPoolContentService extends DefaultDinaService<LibraryPoolContent> {

Expand Down Expand Up @@ -94,5 +96,9 @@ private List<LibraryPrepBatch> getBatches(LibraryPool pool) {

return batchs;
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import ca.gc.aafc.seqdb.api.entities.pooledlibraries.LibraryPool;
import lombok.NonNull;

// CHECKSTYLE:OFF NoFinalizer
// CHECKSTYLE:OFF SuperFinalize
@Service
public class LibraryPoolService extends DefaultDinaService<LibraryPool> {

Expand All @@ -23,5 +25,9 @@ public LibraryPoolService(
protected void preCreate(LibraryPool entity) {
entity.setUuid(UUID.randomUUID());
}


// Fixes CT_CONSTRUCTOR_THROW
protected final void finalize() {
// no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static class ContainerLocationArgs {
private ContainerType containerType;

public StorageGridLayout getStorageGridLayout() {
if(containerType == null) {
if (containerType == null) {
return null;
}
return StorageGridLayout.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void validate(Object target, Errors errors) {

// if there is no storage restriction defined, we can't validate.
// we return and allow the location since we can't say for sure it's invalid
if(pcrBatchItem.getPcrBatch() == null || pcrBatchItem.getPcrBatch().getStorageRestriction() == null) {
if (pcrBatchItem.getPcrBatch() == null || pcrBatchItem.getPcrBatch().getStorageRestriction() == null) {
return;
}

Expand Down

0 comments on commit 50ec3f0

Please sign in to comment.