Skip to content

Commit

Permalink
Upgrading Spring dependency and preparing release 13.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-brandizi committed Jul 31, 2023
1 parent 586b66b commit ef9cb96
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>uk.ac.ebi</groupId>
<artifactId>jutils</artifactId>
<version>12.0.1-SNAPSHOT</version>
<version>13.0-SNAPSHOT</version>


<name>JUtils - Miscellanea of Java Utils</name>
Expand Down Expand Up @@ -142,7 +142,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.3.25</version>
<version>6.0.11</version>
<optional>true</optional>
</dependency>

Expand All @@ -158,9 +158,9 @@

<!-- Required by uk.ac.ebi.utils.opt.net.ConfigBootstrapWebListener -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<optional>true</optional>
</dependency>

Expand Down
11 changes: 7 additions & 4 deletions revision-history.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Revision History

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

## 12.0.1-SNAPSHOT
* Current snapshot
## 13.0.1-SNAPSHOT

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

## 12.0-SNAPSHOT
## 12.0
* Migration to Java 17. **No backward compatibility guaranteed**.

## 11.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;

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

Expand Down Expand Up @@ -54,7 +54,7 @@ public void contextInitialized ( ServletContextEvent sce )
@Override
public void contextDestroyed ( ServletContextEvent sce )
{
// Does nothing, added just for compatibility with older servlet APIs.
// Does nothing, added just for compatibility with servlet APIs.
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Optional;

import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.web.server.ResponseStatusException;

/**
Expand Down Expand Up @@ -54,7 +55,12 @@ public ResponseStatusException2 ( int rawStatusCode, String reason, Throwable ca
*/
public String getMessage ()
{
int code = this.getRawStatusCode ();
HttpStatusCode statusCode = Optional.ofNullable ( this.getStatusCode () )
.orElse ( HttpStatus.INTERNAL_SERVER_ERROR );

int code = statusCode.value ();

// Finding a reason with Spring >= 6
HttpStatus status = HttpStatus.resolve ( code );

String codeStr = "HTTP " +
Expand Down

0 comments on commit ef9cb96

Please sign in to comment.