diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6966549c..25e1bdcc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -145,7 +145,7 @@ jobs: cache: maven - name: Build and generate Javadoc run: | - mvn clean install javadoc:javadoc + mvn clean install javadoc:javadoc -DskipTests env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to GitHub Pages diff --git a/pom.xml b/pom.xml index 8595a0d2..4d78f227 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,6 @@ org.projectlombok lombok 1.18.20 - provided com.h2database @@ -119,7 +118,16 @@ org.springframework.boot spring-boot-starter-validation - + + com.sun.mail + jakarta.mail + 2.0.1 + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + diff --git a/src/main/java/com/lpvs/controller/LPVSWebController.java b/src/main/java/com/lpvs/controller/LPVSWebController.java index ef095ebe..20cd9c08 100644 --- a/src/main/java/com/lpvs/controller/LPVSWebController.java +++ b/src/main/java/com/lpvs/controller/LPVSWebController.java @@ -38,8 +38,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.util.HtmlUtils; -import java.sql.Timestamp; import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -234,7 +234,7 @@ public ResponseEntity newHistoryPageByUser( for (LPVSPullRequest pr : lpvsPullRequests) { String[] pullNumberTemp = pr.getPullRequestUrl().split("/"); LocalDateTime localDateTime = - new Timestamp(pr.getDate().getTime()).toLocalDateTime(); + pr.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); String formattingDateTime = lpvsLoginCheckService.dateTimeFormatting(localDateTime); // Validate and sanitize user inputs to prevent XSS attacks diff --git a/src/main/java/com/lpvs/service/LPVSStatisticsService.java b/src/main/java/com/lpvs/service/LPVSStatisticsService.java index fb49c301..f09ad7a5 100644 --- a/src/main/java/com/lpvs/service/LPVSStatisticsService.java +++ b/src/main/java/com/lpvs/service/LPVSStatisticsService.java @@ -21,8 +21,8 @@ import org.springframework.security.core.Authentication; import org.springframework.stereotype.Service; -import java.sql.Date; import java.time.LocalDate; +import java.time.ZoneId; import java.util.*; /** @@ -122,7 +122,6 @@ public Dashboard getDashboardEntity(String type, String name, Authentication aut int totalIssueCount = 0; int totalParticipantsCount = 0; int totalRepositoryCount = 0; - Set participantsSet = new HashSet<>(); List prList = pathCheck(type, name, authentication); Map licenseCountMap = new HashMap<>(); @@ -137,7 +136,8 @@ public Dashboard getDashboardEntity(String type, String name, Authentication aut Set totalSenderSet = new HashSet<>(); Set totalRepositorySet = new HashSet<>(); for (LPVSPullRequest pr : prList) { - LocalDate localDate = new Date(pr.getDate().getTime()).toLocalDate(); + LocalDate localDate = + pr.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); List datePrMapValue = datePrMap.get(localDate); if (datePrMapValue == null) { datePrMapValue = new ArrayList<>();