Skip to content

Commit b021313

Browse files
author
Thierry Boileau
committed
Fix TUs, Upgrade JDK 21
1 parent 22ea932 commit b021313

File tree

75 files changed

+603
-876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+603
-876
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java adoptopenjdk-17.0.8+101
1+
java adoptopenjdk-21.0.2+13.0.LTS
22
maven 3.8.8

org.restlet/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
<testResource>
101101
<directory>src/test/resources</directory>
102102
<filtering>true</filtering>
103+
<includes>
104+
<include>**/*.properties</include>
105+
</includes>
103106
</testResource>
104107
</testResources>
105108
<plugins>

org.restlet/src/main/java/org/restlet/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* @author Jerome Louvel
6060
*/
6161
public class Application extends Restlet {
62-
private static final ThreadLocal<Application> CURRENT = new ThreadLocal<Application>();
62+
private static final ThreadLocal<Application> CURRENT = new ThreadLocal<>();
6363

6464
/**
6565
* This variable is stored internally as a thread local variable and updated

org.restlet/src/main/java/org/restlet/Client.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,10 @@ public void handle(Request request, Response response) {
129129
if (getHelper() != null) {
130130
getHelper().handle(request, response);
131131
} else {
132-
StringBuilder sb = new StringBuilder();
133-
sb.append(
134-
"No available client connector supports the required protocol: ");
135-
sb.append("'").append(request.getProtocol().getName()).append("'.");
136-
sb.append(
137-
" Please add the JAR of a matching connector to your classpath.");
138-
response.setStatus(Status.CONNECTOR_ERROR_INTERNAL, sb.toString());
132+
String sb = "No available client connector supports the required protocol: " +
133+
"'" + request.getProtocol().getName() + "'." +
134+
" Please add the JAR of a matching connector to your classpath.";
135+
response.setStatus(Status.CONNECTOR_ERROR_INTERNAL, sb);
139136
}
140137
}
141138

org.restlet/src/main/java/org/restlet/Restlet.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public abstract class Restlet implements Uniform {
3939
*/
4040
private static void fireContextChanged(Restlet restlet, Context context) {
4141
if (context != null) {
42-
if (context instanceof org.restlet.engine.util.ChildContext) {
43-
org.restlet.engine.util.ChildContext childContext = (org.restlet.engine.util.ChildContext) context;
42+
if (context instanceof org.restlet.engine.util.ChildContext childContext) {
4443

4544
if (childContext.getChild() == null) {
4645
childContext.setChild(restlet);

org.restlet/src/main/java/org/restlet/data/ChallengeRequest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,18 @@ public boolean equals(final Object obj) {
6565
if (obj == this) {
6666
return true;
6767
}
68-
if (!(obj instanceof ChallengeRequest)) {
68+
if (!(obj instanceof ChallengeRequest that)) {
6969
return false;
7070
}
7171

72-
final ChallengeRequest that = (ChallengeRequest) obj;
73-
74-
return getParameters().equals(that.getParameters()) && Objects.equals(getRealm(), that.getRealm())
72+
return getParameters().equals(that.getParameters())
73+
&& Objects.equals(getRealm(), that.getRealm())
7574
&& Objects.equals(getScheme(), that.getScheme());
7675
}
7776

7877
/**
7978
* Returns the base URI references that collectively define the protected
80-
* domains for the digest authentication. By default it return a list with a
79+
* domains for the digest authentication. By default, it returns a list with a
8180
* single "/" URI reference.
8281
*
8382
* @return The base URI references.

org.restlet/src/main/java/org/restlet/data/Cookie.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public boolean equals(Object obj) {
9797
return true;
9898
}
9999

100-
if (!(obj instanceof Cookie)) {
100+
if (!(obj instanceof Cookie that)) {
101101
// if obj isn't a cookie or is null don't evaluate further
102102
return false;
103103
}
104104

105-
Cookie that = (Cookie) obj;
106-
107-
return Objects.equals(getName(), that.getName()) && Objects.equals(getValue(), that.getValue())
108-
&& (this.version == that.version) && Objects.equals(getDomain(), that.getDomain())
105+
return Objects.equals(getName(), that.getName())
106+
&& Objects.equals(getValue(), that.getValue())
107+
&& (this.version == that.version)
108+
&& Objects.equals(getDomain(), that.getDomain())
109109
&& Objects.equals(getPath(), that.getPath());
110110
}
111111

org.restlet/src/main/java/org/restlet/data/CookieSetting.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
public final class CookieSetting extends Cookie {
2828
/**
29-
* Indicates whether to restrict cookie access to untrusted parties. Currently
29+
* Indicates whether to restrict cookie access to untrusted parties. Currently,
3030
* this toggles the non-standard but widely supported HttpOnly cookie parameter.
3131
*/
3232
private volatile boolean accessRestricted;
@@ -139,13 +139,13 @@ public boolean equals(Object obj) {
139139
if (obj == this) {
140140
return true;
141141
}
142-
if (!(obj instanceof CookieSetting)) {
142+
if (!(obj instanceof CookieSetting that)) {
143143
return false;
144144
}
145145

146-
CookieSetting that = (CookieSetting) obj;
147-
148-
return super.equals(obj) && this.maxAge == that.maxAge && this.secure == that.secure
146+
return super.equals(obj)
147+
&& this.maxAge == that.maxAge
148+
&& this.secure == that.secure
149149
&& Objects.equals(this.comment, that.comment);
150150
}
151151

org.restlet/src/main/java/org/restlet/data/Expectation.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public final class Expectation implements NamedValue<String> {
2727

2828
/**
29-
* Creates a "100-continue" expectation. If a client will wait for a 100
29+
* Creates a "100-continue" expectation. If a client waits for a 100
3030
* (Continue) provisional response before sending the request body, it MUST send
3131
* this expectation. A client MUST NOT send this expectation if it does not
3232
* intend to send a request entity.
@@ -76,13 +76,12 @@ public boolean equals(Object obj) {
7676
return true;
7777
}
7878

79-
if (!(obj instanceof Expectation)) {
79+
if (!(obj instanceof Expectation that)) {
8080
return false;
8181
}
8282

83-
Expectation that = (Expectation) obj;
84-
85-
return Objects.equals(getName(), that.getName()) && Objects.equals(getValue(), that.getValue())
83+
return Objects.equals(getName(), that.getName())
84+
&& Objects.equals(getValue(), that.getValue())
8685
&& getParameters().equals(that.getParameters());
8786
}
8887

org.restlet/src/main/java/org/restlet/data/Header.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public boolean equals(Object obj) {
5151
if (obj == this) {
5252
return true;
5353
}
54-
if (!(obj instanceof Header)) {
54+
if (!(obj instanceof Header that)) {
5555
return false;
5656
}
5757

58-
Header that = (Header) obj;
59-
return Objects.equals(getName(), that.getName()) && Objects.equals(getValue(), that.getValue());
58+
return Objects.equals(getName(), that.getName())
59+
&& Objects.equals(getValue(), that.getValue());
6060
}
6161

6262
/**

0 commit comments

Comments
 (0)