Skip to content

Commit ef9cb96

Browse files
Upgrading Spring dependency and preparing release 13.0.
1 parent 586b66b commit ef9cb96

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>uk.ac.ebi</groupId>
66
<artifactId>jutils</artifactId>
7-
<version>12.0.1-SNAPSHOT</version>
7+
<version>13.0-SNAPSHOT</version>
88

99

1010
<name>JUtils - Miscellanea of Java Utils</name>
@@ -142,7 +142,7 @@
142142
<dependency>
143143
<groupId>org.springframework</groupId>
144144
<artifactId>spring-web</artifactId>
145-
<version>5.3.25</version>
145+
<version>6.0.11</version>
146146
<optional>true</optional>
147147
</dependency>
148148

@@ -158,9 +158,9 @@
158158

159159
<!-- Required by uk.ac.ebi.utils.opt.net.ConfigBootstrapWebListener -->
160160
<dependency>
161-
<groupId>javax.servlet</groupId>
162-
<artifactId>javax.servlet-api</artifactId>
163-
<version>4.0.1</version>
161+
<groupId>jakarta.servlet</groupId>
162+
<artifactId>jakarta.servlet-api</artifactId>
163+
<version>6.0.0</version>
164164
<optional>true</optional>
165165
</dependency>
166166

revision-history.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Revision History
22

3-
*This file was last revised on 2023-07-26*. **Please keep this note updated**.
3+
*This file was last revised on 2023-07-31*. **Please keep this note updated**.
44

5-
## 12.0.1-SNAPSHOT
6-
* Current snapshot
5+
## 13.0.1-SNAPSHOT
76

7+
## 13.0
8+
* **These migrations are incompatible with older versions**:
9+
* `javax.servlet-api` migrated to `jakarta.servlet-api`.
10+
* `spring-web` moved to 6.0.
811

9-
## 12.0-SNAPSHOT
12+
## 12.0
1013
* Migration to Java 17. **No backward compatibility guaranteed**.
1114

1215
## 11.1.1

src/main/java/uk/ac/ebi/utils/opt/net/ConfigBootstrapWebListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
import javax.servlet.ServletContextEvent;
7-
import javax.servlet.ServletContextListener;
6+
import jakarta.servlet.ServletContextEvent;
7+
import jakarta.servlet.ServletContextListener;
88

99
import uk.ac.ebi.utils.collections.OptionsMap;
1010

@@ -54,7 +54,7 @@ public void contextInitialized ( ServletContextEvent sce )
5454
@Override
5555
public void contextDestroyed ( ServletContextEvent sce )
5656
{
57-
// Does nothing, added just for compatibility with older servlet APIs.
57+
// Does nothing, added just for compatibility with servlet APIs.
5858
}
5959

6060

src/main/java/uk/ac/ebi/utils/opt/springweb/exceptions/ResponseStatusException2.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Optional;
44

55
import org.springframework.http.HttpStatus;
6+
import org.springframework.http.HttpStatusCode;
67
import org.springframework.web.server.ResponseStatusException;
78

89
/**
@@ -54,7 +55,12 @@ public ResponseStatusException2 ( int rawStatusCode, String reason, Throwable ca
5455
*/
5556
public String getMessage ()
5657
{
57-
int code = this.getRawStatusCode ();
58+
HttpStatusCode statusCode = Optional.ofNullable ( this.getStatusCode () )
59+
.orElse ( HttpStatus.INTERNAL_SERVER_ERROR );
60+
61+
int code = statusCode.value ();
62+
63+
// Finding a reason with Spring >= 6
5864
HttpStatus status = HttpStatus.resolve ( code );
5965

6066
String codeStr = "HTTP " +

0 commit comments

Comments
 (0)