From b43be3e8f5f2b63f4987e66184eecbbc8d69630c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:34:51 +0000 Subject: [PATCH] bug: upgrade embedded Tomcat to 9.0.98 for CVE-2024-56337 (sfind-43a5867e) Spring Boot parent 1.5.4.RELEASE -> 2.7.18 (Java 1.8 kept), tomcat.version 9.0.98, mysql-connector-j coordinates, findById, Boot 1.5-compatible JPA/bean defaults, sun.io.useCanonCaches=false for spring-boot:run. --- UserFront/pom.xml | 11 ++++++++--- .../UserServiceImpl/AppointmentServiceImpl.java | 2 +- UserFront/src/main/resources/application.properties | 4 ++++ .../java/com/userFront/UserFrontApplicationTests.java | 5 +---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/UserFront/pom.xml b/UserFront/pom.xml index 902ec2b3..26ecc196 100644 --- a/UserFront/pom.xml +++ b/UserFront/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.4.RELEASE + 2.7.18 @@ -22,6 +22,7 @@ UTF-8 UTF-8 1.8 + 9.0.98 @@ -46,8 +47,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j @@ -67,6 +68,10 @@ org.springframework.boot spring-boot-maven-plugin + + + -Dsun.io.useCanonCaches=false + diff --git a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java index 838ad223..0d62b84c 100644 --- a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java +++ b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java @@ -24,7 +24,7 @@ public List findAll() { } public Appointment findAppointment(Long id) { - return appointmentDao.findOne(id); + return appointmentDao.findById(id).orElse(null); } public void confirmAppointment(Long id) { diff --git a/UserFront/src/main/resources/application.properties b/UserFront/src/main/resources/application.properties index d7e04942..e24a97bd 100644 --- a/UserFront/src/main/resources/application.properties +++ b/UserFront/src/main/resources/application.properties @@ -33,3 +33,7 @@ spring.jpa.hibernate.ddl-auto = update # Allows Hibernate to generate SQL optimized for a particular DBMS spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect +# Spring Boot 2.x defaults: keep the Boot 1.5 behaviour (circular SecurityConfig/UserService +# wiring, IDENTITY ids for GenerationType.AUTO so existing rows/ids are untouched). +spring.main.allow-circular-references=true +spring.jpa.hibernate.use-new-id-generator-mappings=false diff --git a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java index 81fed97b..3e51f21d 100644 --- a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java +++ b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java @@ -1,11 +1,8 @@ package com.userFront; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringRunner.class) @SpringBootTest public class UserFrontApplicationTests {