Skip to content

Commit 411b39f

Browse files
authored
Fix JDK22 compiler warnings (#517)
1 parent 17e8ece commit 411b39f

File tree

22 files changed

+36
-26
lines changed

22 files changed

+36
-26
lines changed

cloudplatform/caching/src/main/java/com/sap/cloud/sdk/cloudplatform/cache/SerializableCacheKey.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import java.io.Serializable;
88
import java.util.ArrayList;
9-
import java.util.List;
109

1110
import javax.annotation.Nonnull;
1211
import javax.annotation.Nullable;
@@ -39,7 +38,7 @@ public final class SerializableCacheKey implements GenericCacheKey<SerializableC
3938
private final String principalId;
4039

4140
@Getter
42-
private final List<Serializable> components = new ArrayList<>();
41+
private final ArrayList<Serializable> components = new ArrayList<>();
4342

4443
@Nonnull
4544
@Override

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataConnectionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ODataConnectionException extends ODataRequestException
2727
* The {@link HttpUriRequest} that was attempted.
2828
*/
2929
@Nonnull
30-
private final HttpUriRequest httpRequest;
30+
private final transient HttpUriRequest httpRequest;
3131

3232
/**
3333
* Default constructor.

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class ODataException extends IllegalStateException
4040
* The OData request that was attempted while this exception occurred.
4141
*/
4242
@Nonnull
43-
private final ODataRequestGeneric request;
43+
private final transient ODataRequestGeneric request;
4444

4545
/**
4646
* Default constructor.

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataResponseException.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
import io.vavr.control.Try;
2222
import lombok.EqualsAndHashCode;
2323
import lombok.Getter;
24+
import lombok.extern.slf4j.Slf4j;
2425

2526
/**
2627
* A generic {@link ODataException} representing an erroneous service response. This exception class comprises details
2728
* of the HTTP response.
2829
*/
2930
@EqualsAndHashCode( callSuper = true )
31+
@Slf4j
3032
public class ODataResponseException extends ODataException
3133
{
3234
private static final long serialVersionUID = 4615831202194546242L;
@@ -42,7 +44,7 @@ public class ODataResponseException extends ODataException
4244
*/
4345
@Getter
4446
@Nonnull
45-
private final Collection<Header> httpHeaders;
47+
private final transient Collection<Header> httpHeaders;
4648

4749
/**
4850
* The content of the HTTP response body as plain text or null, if the response did not contain a body.
@@ -75,7 +77,7 @@ public ODataResponseException(
7577
httpBody =
7678
Try
7779
.of(() -> EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8))
78-
.onFailure(this::addSuppressed)
80+
.onFailure(e -> log.debug("HTTP response could not be consumed.", e))
7981
.toOption();
8082
}
8183
}

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataSerializationException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class ODataSerializationException extends ODataRequestException
2525
*/
2626
@Nonnull
2727
@Getter
28-
private final Object nonSerializableObject;
28+
private final transient Object nonSerializableObject;
2929

3030
/**
3131
* Default constructor.

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataServiceErrorException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class ODataServiceErrorException extends ODataResponseException
2828
* The parsed {@link ODataServiceError} that was found in the HTTP response body.
2929
*/
3030
@Nonnull
31-
private final ODataServiceError odataError;
31+
private final transient ODataServiceError odataError;
3232

3333
/**
3434
* Default constructor.

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/expression/FilterExpressionArithmetic.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Set of OData filter functions for arithmetic types.
1111
*/
12+
@SuppressWarnings( "overloads" )
1213
public interface FilterExpressionArithmetic
1314
{
1415
/**

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/expression/FilterExpressionTemporal.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Set of OData filter functions for temporal types.
1111
*/
12+
@SuppressWarnings( "overloads" )
1213
public interface FilterExpressionTemporal
1314
{
1415
/**

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/request/ODataRequestAction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
import javax.annotation.Nonnull;
1010
import javax.annotation.Nullable;
1111

12+
import org.apache.http.HttpHeaders;
1213
import org.apache.http.client.HttpClient;
1314

15+
import com.google.common.collect.Lists;
1416
import com.sap.cloud.sdk.datamodel.odata.client.ODataProtocol;
1517
import com.sap.cloud.sdk.datamodel.odata.client.expression.ODataResourcePath;
1618

@@ -30,10 +32,6 @@ public class ODataRequestAction extends ODataRequestGeneric
3032
@Nonnull
3133
private final String query;
3234

33-
{
34-
addHeader("Content-Type", "application/json");
35-
}
36-
3735
/**
3836
* Convenience constructor for invocations of unbound actions. For bound actions use
3937
* {@link #ODataRequestAction(String, ODataResourcePath, String, ODataProtocol)}.
@@ -105,6 +103,7 @@ public ODataRequestAction(
105103
super(servicePath, actionPath, protocol);
106104
this.actionParameters = actionParameters != null ? actionParameters : "{}";
107105
this.query = encodedQuery != null ? encodedQuery : "";
106+
headers.putIfAbsent(HttpHeaders.CONTENT_TYPE, Lists.newArrayList("application/json"));
108107
}
109108

110109
@Nonnull

datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/request/ODataRequestCreate.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
import javax.annotation.Nonnull;
1010

11+
import org.apache.http.HttpHeaders;
1112
import org.apache.http.client.HttpClient;
1213

14+
import com.google.common.collect.Lists;
1315
import com.sap.cloud.sdk.datamodel.odata.client.ODataProtocol;
1416
import com.sap.cloud.sdk.datamodel.odata.client.expression.ODataResourcePath;
1517

@@ -26,10 +28,6 @@ public class ODataRequestCreate extends ODataRequestGeneric
2628
@Nonnull
2729
private final String serializedEntity;
2830

29-
{
30-
addHeader("Content-Type", "application/json");
31-
}
32-
3331
/**
3432
* Convenience constructor for OData delete requests on entity collections directly. For operations on nested
3533
* entities use {@link #ODataRequestCreate(String, ODataResourcePath, String, ODataProtocol)}.
@@ -72,6 +70,7 @@ public ODataRequestCreate(
7270
{
7371
super(servicePath, entityPath, protocol);
7472
this.serializedEntity = serializedEntity;
73+
headers.putIfAbsent(HttpHeaders.CONTENT_TYPE, Lists.newArrayList("application/json"));
7574
}
7675

7776
@Nonnull

0 commit comments

Comments
 (0)