From 4a2ce3862ac36b975695cbf3b5d83d7ad906ef26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 09:05:10 +0000 Subject: [PATCH 1/7] chore(deps): bump com.github.spotbugs from 6.5.5 to 6.5.6 Bumps com.github.spotbugs from 6.5.5 to 6.5.6. --- updated-dependencies: - dependency-name: com.github.spotbugs dependency-version: 6.5.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b8fe0a4f..17a97c32 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,5 +22,5 @@ org-mockito-mockito-core = { group = "org.mockito", name = "mockito-core", versi [plugins] com-diffplug-spotless = { id = "com.diffplug.spotless", version = "8.6.0" } -com-github-spotbugs = { id = "com.github.spotbugs", version = "6.5.5" } +com-github-spotbugs = { id = "com.github.spotbugs", version = "6.5.6" } org-sonarqube = { id = "org.sonarqube", version = "7.3.1.8318" } From d8c2f643dd1498272e461b8967dc721ebc5b0385 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 07:07:54 -0400 Subject: [PATCH 2/7] ci: adds a dependendabot configuration to update dev containers --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 71db154c..03d94877 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -48,3 +48,8 @@ updates: open-telemetry: patterns: - "*opentelemetry*" +- package-ecosystem: devcontainers + directory: "/.devcontainer" + schedule: + interval: daily + open-pull-requests-limit: 10 From 879bccfb9c08dc83800a96865856d68757192332 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 07:08:19 -0400 Subject: [PATCH 3/7] chore: adds lock file for dev containers --- .devcontainer/devcontainer-lock.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .devcontainer/devcontainer-lock.json diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 00000000..663ea55a --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,24 @@ +{ + "features": { + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "1.1.0", + "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671", + "integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671" + }, + "ghcr.io/devcontainers/features/java:1": { + "version": "1.8.0", + "resolved": "ghcr.io/devcontainers/features/java@sha256:9663ce0219ff85786e87901ce5f0a59f488edd5f99b46015192cda48468b233a", + "integrity": "sha256:9663ce0219ff85786e87901ce5f0a59f488edd5f99b46015192cda48468b233a" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "1.7.1", + "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6", + "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6" + }, + "ghcr.io/devcontainers/features/powershell:1": { + "version": "1.5.1", + "resolved": "ghcr.io/devcontainers/features/powershell@sha256:df7baa89598c93bfd15808641d9ec9eb03e0ccdf52e5de4cbbce9ab2d9755d18", + "integrity": "sha256:df7baa89598c93bfd15808641d9ec9eb03e0ccdf52e5de4cbbce9ab2d9755d18" + } + } +} From d9d2ef7e45284e2f6cd9729efd479c21e709ba85 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 07:24:39 -0400 Subject: [PATCH 4/7] ci: upgrades devcontainer configuration --- .devcontainer/devcontainer-lock.json | 16 ++++++++-------- .devcontainer/devcontainer.json | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json index 663ea55a..cc2a3d6b 100644 --- a/.devcontainer/devcontainer-lock.json +++ b/.devcontainer/devcontainer-lock.json @@ -10,15 +10,15 @@ "resolved": "ghcr.io/devcontainers/features/java@sha256:9663ce0219ff85786e87901ce5f0a59f488edd5f99b46015192cda48468b233a", "integrity": "sha256:9663ce0219ff85786e87901ce5f0a59f488edd5f99b46015192cda48468b233a" }, - "ghcr.io/devcontainers/features/node:1": { - "version": "1.7.1", - "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6", - "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6" + "ghcr.io/devcontainers/features/node:2": { + "version": "2.0.0", + "resolved": "ghcr.io/devcontainers/features/node@sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f", + "integrity": "sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f" }, - "ghcr.io/devcontainers/features/powershell:1": { - "version": "1.5.1", - "resolved": "ghcr.io/devcontainers/features/powershell@sha256:df7baa89598c93bfd15808641d9ec9eb03e0ccdf52e5de4cbbce9ab2d9755d18", - "integrity": "sha256:df7baa89598c93bfd15808641d9ec9eb03e0ccdf52e5de4cbbce9ab2d9755d18" + "ghcr.io/devcontainers/features/powershell:2": { + "version": "2.0.2", + "resolved": "ghcr.io/devcontainers/features/powershell@sha256:82ea3880c5706ac3963f1b5e940a7f5871835393a5472f80008148b995d58d61", + "integrity": "sha256:82ea3880c5706ac3963f1b5e940a7f5871835393a5472f80008148b995d58d61" } } } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0581619f..f91a8022 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,17 @@ { - "name": "Java", - "image": "mcr.microsoft.com/devcontainers/java:17", + "name": "Java 21 & Gradle", + "image": "mcr.microsoft.com/devcontainers/java:21-bookworm", "features": { "ghcr.io/devcontainers/features/java:1": { "version": "none", "installMaven": "true", "installGradle": "true" }, - "ghcr.io/devcontainers/features/node:1": { + "ghcr.io/devcontainers/features/node:2": { "version": "lts" }, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/powershell:1": {} + "ghcr.io/devcontainers/features/powershell:2": {} }, // Configure tool-specific properties. "customizations": { From 2729f8e3d3eac449e09f3753812eb5e87d61e62d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 08:12:30 -0400 Subject: [PATCH 5/7] ci: fixes devcontainer startup --- .devcontainer/devcontainer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f91a8022..bfde8e3c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,6 +13,9 @@ "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/powershell:2": {} }, + "containerEnv": { + "WAYLAND_DISPLAY": "disabled" + }, // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. From 47ea6b393c904c0c0d954f46749b4b6df468b25b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 09:12:52 -0400 Subject: [PATCH 6/7] fix: null reference handling and spotbug infringements --- .../microsoft/kiota/ApiExceptionBuilder.java | 4 +++ .../microsoft/kiota/BaseRequestBuilder.java | 4 +++ .../java/com/microsoft/kiota/Headers.java | 4 +++ .../microsoft/kiota/RequestInformation.java | 6 +++- ...BaseBearerTokenAuthenticationProvider.java | 7 +++++ .../BasicAccessAuthenticationProvider.java | 4 +++ .../serialization/KiotaSerialization.java | 4 ++- .../serialization/ParseNodeProxyFactory.java | 4 +++ .../SerializationWriterProxyFactory.java | 4 +++ .../kiota/BaseRequestConfigurationTest.java | 3 +- .../kiota/RequestInformationTest.java | 1 + .../kiota/store/InMemoryBackingStoreTest.java | 5 +++- .../AzureIdentityAccessTokenProvider.java | 4 +++ .../AzureIdentityAccessTokenProviderTest.java | 6 ++-- .../kiota/http/OkHttpRequestAdapter.java | 30 ++++++++++++------- .../http/middleware/AuthorizationHandler.java | 4 +++ .../middleware/HeadersInspectionHandler.java | 4 +++ .../ParametersNameDecodingHandler.java | 4 +++ .../kiota/http/middleware/RetryHandler.java | 12 ++++---- .../http/middleware/UrlReplaceHandler.java | 4 +++ .../options/UrlReplaceHandlerOption.java | 4 +++ .../kiota/serialization/FormParseNode.java | 6 +++- .../kiota/serialization/ParseNodeTests.java | 15 ++++++++++ .../kiota/serialization/JsonParseNode.java | 4 +++ .../serialization/JsonParseNodeFactory.java | 4 +++ .../JsonSerializationWriter.java | 4 +++ .../JsonSerializationWriterFactory.java | 4 +++ .../kiota/serialization/TextParseNode.java | 10 +++++-- 28 files changed, 144 insertions(+), 25 deletions(-) diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java b/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java index ae7440c7..e3941e1d 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java @@ -99,4 +99,8 @@ public ApiExceptionBuilder(@Nonnull final Supplier builder) { value = null; return result; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java b/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java index c59a4242..7154ff94 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java @@ -54,4 +54,8 @@ protected BaseRequestBuilder( this(requestAdapter, urlTemplate); this.pathParameters.put(RequestInformation.RAW_URL_KEY, Objects.requireNonNull(rawUrl)); } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java b/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java index 8ff31a6d..8228a488 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java @@ -88,4 +88,8 @@ public boolean remove(@Nonnull final String key, @Nonnull final String value) { } return false; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java b/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java index be16d49e..9f2c861e 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java @@ -91,7 +91,7 @@ public void configure( @Nullable public String urlTemplate; /** The path parameters for the current request */ - @Nullable public Map pathParameters = new HashMap<>(); + @Nonnull public Map pathParameters = new HashMap<>(); private URI uri; @@ -127,6 +127,10 @@ public void configure( } } + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} + /** * Sets the URI of the request. * @param uri the URI of the request. diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java index 819c63bf..b3ef7e2a 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java @@ -42,6 +42,9 @@ public void authenticateRequest( } catch (URISyntaxException e) { throw new RuntimeException("Malformed URI.", e); } + if (targetUri == null) { + throw new IllegalStateException("Request URI cannot be null."); + } String accessToken = this.accessTokenProvider.getAuthorizationToken( targetUri, additionalAuthenticationContext); @@ -54,4 +57,8 @@ public void authenticateRequest( public @Nonnull AccessTokenProvider getAccessTokenProvider() { return this.accessTokenProvider; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java index 3233e3df..8167b77f 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java @@ -44,4 +44,8 @@ public void authenticateRequest( @Nullable final Map additionalAuthenticationContext) { request.headers.add(AUTHORIZATION_HEADER_KEY, BASIC + encoded); } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java index a9c0a9e0..a4ef68a2 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/KiotaSerialization.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -259,6 +260,7 @@ private static InputStream getInputStreamFromString(@Nonnull final String value) @Nonnull final InputStream stream, @Nonnull final ParsableFactory parsableFactory) { final ParseNode parseNode = getRootParseNode(contentType, stream, parsableFactory); - return parseNode.getCollectionOfObjectValues(parsableFactory); + final List values = parseNode.getCollectionOfObjectValues(parsableFactory); + return values != null ? values : new ArrayList<>(); } } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java index 38a5be2c..16c83c81 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java @@ -59,4 +59,8 @@ public ParseNodeProxyFactory( }); return node; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java index fe3d34c9..510ceab1 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java @@ -73,4 +73,8 @@ public SerializationWriterProxyFactory( }); return writer; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/abstractions/src/test/java/com/microsoft/kiota/BaseRequestConfigurationTest.java b/components/abstractions/src/test/java/com/microsoft/kiota/BaseRequestConfigurationTest.java index 257060f7..f7c8122c 100644 --- a/components/abstractions/src/test/java/com/microsoft/kiota/BaseRequestConfigurationTest.java +++ b/components/abstractions/src/test/java/com/microsoft/kiota/BaseRequestConfigurationTest.java @@ -20,9 +20,10 @@ void testOptions() { RequestOption requestOption = new RequestOption() { + @SuppressWarnings("unchecked") @Override public Class getType() { - return null; + return (Class) RequestOption.class; } }; // options should be mutable list diff --git a/components/abstractions/src/test/java/com/microsoft/kiota/RequestInformationTest.java b/components/abstractions/src/test/java/com/microsoft/kiota/RequestInformationTest.java index d1c07d1c..526d5fa3 100644 --- a/components/abstractions/src/test/java/com/microsoft/kiota/RequestInformationTest.java +++ b/components/abstractions/src/test/java/com/microsoft/kiota/RequestInformationTest.java @@ -44,6 +44,7 @@ void BuildsUrlOnProvidedBaseUrl() { requestInfo.urlTemplate = "{+baseurl}/users{?%24count}"; // Act + assertNotNull(requestInfo.pathParameters); requestInfo.pathParameters.put("baseurl", "http://localhost"); // Assert diff --git a/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java b/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java index 39f97e71..96f4bbe8 100644 --- a/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java +++ b/components/abstractions/src/test/java/com/microsoft/kiota/store/InMemoryBackingStoreTest.java @@ -450,6 +450,7 @@ void TestsBackingStoreUpdateToItemInNestedCollectionWithAnotherBackedModel() { manager.setId("2fe22fe5-1132-42cf-90f9-1dc17e325a74"); manager.getBackingStore().setIsInitializationCompleted(true); var collectionValues = testUserCollectionResponse.getValue(); + assertNotNull(collectionValues); collectionValues.get(0).setManager(manager); // Assert by retrieving only changed values @@ -504,7 +505,9 @@ void testInitializationCompletedIsPropagatedToCollectionItems() { testUser.setValue(colleagues); testUser.getBackingStore().setIsInitializationCompleted(true); - for (TestEntity colleague : testUser.getValue()) { + final var values = testUser.getValue(); + assertNotNull(values); + for (TestEntity colleague : values) { assertTrue(colleague.getBackingStore().getIsInitializationCompleted()); } } diff --git a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java index a247c572..e7774d34 100644 --- a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java +++ b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java @@ -181,4 +181,8 @@ private static boolean isLocalhostUrl(@Nonnull String host) { Objects.requireNonNull(host); return localhostStrings.contains(host.toLowerCase(Locale.ROOT)); } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java b/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java index 3dd49bb1..081fe165 100644 --- a/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java +++ b/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java @@ -32,7 +32,8 @@ void testLocalhostHttpUrlIsValid(String urlString) throws URISyntaxException { var tokenCredential = mock(TokenCredential.class); when(tokenCredential.getTokenSync(any(TokenRequestContext.class))) .thenReturn(new AccessToken("token", null)); - var accessTokenProvider = new AzureIdentityAccessTokenProvider(tokenCredential, null, ""); + var accessTokenProvider = + new AzureIdentityAccessTokenProvider(tokenCredential, new String[] {}, ""); assertEquals( "token", accessTokenProvider.getAuthorizationToken(new URI(urlString), new HashMap<>())); @@ -42,7 +43,8 @@ void testLocalhostHttpUrlIsValid(String urlString) throws URISyntaxException { @ValueSource(strings = {"http://graph.microsoft.com/me"}) void testNonLocalhostHttpUrlIsInvalid(String urlString) { var tokenCredential = mock(TokenCredential.class); - var accessTokenProvider = new AzureIdentityAccessTokenProvider(tokenCredential, null, ""); + var accessTokenProvider = + new AzureIdentityAccessTokenProvider(tokenCredential, new String[] {}, ""); assertThrows( IllegalArgumentException.class, () -> diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java index a944de06..193b7055 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java @@ -879,8 +879,12 @@ private void setBaseUrlForRequestInformation(@Nonnull final RequestInformation r .setParent(Context.current().with(parentSpan)) .startSpan(); try (final Scope scope = span.makeCurrent()) { - spanForAttributes.setAttribute(HTTP_REQUEST_METHOD, requestInfo.httpMethod.toString()); - final URL requestURL = requestInfo.getUri().toURL(); + final HttpMethod requestMethod = + Objects.requireNonNull(requestInfo.httpMethod, "httpMethod cannot be null"); + spanForAttributes.setAttribute(HTTP_REQUEST_METHOD, requestMethod.toString()); + final java.net.URI requestUri = + Objects.requireNonNull(requestInfo.getUri(), "request URI cannot be null"); + final URL requestURL = requestUri.toURL(); if (obsOptions.getIncludeEUIIAttributes()) { spanForAttributes.setAttribute(URL_FULL, requestURL.toString()); } @@ -888,8 +892,9 @@ private void setBaseUrlForRequestInformation(@Nonnull final RequestInformation r spanForAttributes.setAttribute(SERVER_ADDRESS, requestURL.getHost()); spanForAttributes.setAttribute(URL_SCHEME, requestURL.getProtocol()); + final InputStream requestContent = requestInfo.content; RequestBody body = - requestInfo.content == null + requestContent == null ? null : new RequestBody() { @Override @@ -910,7 +915,8 @@ public MediaType contentType() { @Override public boolean isOneShot() { - return !requestInfo.content.markSupported(); + return requestContent == null + || !requestContent.markSupported(); } @Override @@ -924,9 +930,9 @@ public long contentLength() throws IOException { } // super.contentLength() is not relied on since it defaults to // -1L, causing wrong telemetry added to the attributes. - if (requestInfo.content instanceof ByteArrayInputStream) { + if (requestContent instanceof ByteArrayInputStream) { final ByteArrayInputStream contentStream = - (ByteArrayInputStream) requestInfo.content; + (ByteArrayInputStream) requestContent; // using available() on a byte-array backed input stream is // reliable because array size is defined. return contentStream.available(); @@ -936,14 +942,14 @@ public long contentLength() throws IOException { @Override public void writeTo(@Nonnull BufferedSink sink) throws IOException { - long contentLength = contentLength(); + final long contentLength = contentLength(); if (contentLength > 0) { - requestInfo.content.mark((int) contentLength); + requestContent.mark((int) contentLength); } - sink.writeAll(Okio.source(requestInfo.content)); + sink.writeAll(Okio.source(requestContent)); if (!isOneShot()) { try { - requestInfo.content.reset(); + requestContent.reset(); } catch (Exception ex) { spanForAttributes.recordException(ex); // we don't want to fail the request if reset() fails @@ -999,4 +1005,8 @@ public void writeTo(@Nonnull BufferedSink sink) throws IOException { span.end(); } } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java index c80b1617..5a70a095 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java @@ -137,4 +137,8 @@ public AuthorizationHandler( } return request; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java index 3de7831a..9ffe11b4 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java @@ -85,4 +85,8 @@ public HeadersInspectionHandler(@Nonnull final HeadersInspectionOption options) } } } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java index 0cab034c..2d381d13 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java @@ -98,6 +98,10 @@ public ParametersNameDecodingHandler(@Nonnull final ParametersNameDecodingOption } } + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} + /** * INTERNAL Decodes the query parameters that are in the list of parameters to decode * @param original the original query string diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/RetryHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/RetryHandler.java index 275acdb8..50d63e9a 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/RetryHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/RetryHandler.java @@ -85,7 +85,7 @@ boolean retryRequest( int executionCount, @Nonnull final Request request, @Nonnull final RetryHandlerOption retryOption, - @Nonnull final Span span) { + @Nullable final Span span) { // Should retry option // Use should retry common for all requests @@ -110,7 +110,9 @@ && isBuffered(request) if (shouldRetry) { long retryInterval = getRetryAfter(response, retryOption.delay(), executionCount); - span.setAttribute(HTTP_REQUEST_RESEND_DELAY, Math.round(retryInterval / 1000f)); + if (span != null) { + span.setAttribute(HTTP_REQUEST_RESEND_DELAY, Math.round(retryInterval / 1000f)); + } try { Thread.sleep(retryInterval); } catch (InterruptedException e) { @@ -258,7 +260,8 @@ boolean isBuffered(final Request request) { } int executionCount = 1; - while (retryRequest(response, executionCount, request, retryOption, span)) { + while (retryRequest( + response, executionCount, request, Objects.requireNonNull(retryOption), span)) { final Request.Builder builder = request.newBuilder() .addHeader(RETRY_ATTEMPT_HEADER, String.valueOf(executionCount)); @@ -266,9 +269,6 @@ boolean isBuffered(final Request request) { builder.tag(Span.class, span); } request = builder.build(); - if (request == null) { - throw new IllegalArgumentException("request cannot be null"); - } executionCount++; final ResponseBody body = response.body(); if (body != null) body.close(); diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java index cf2d2bba..9453721a 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java @@ -72,6 +72,10 @@ public Response intercept(@Nonnull Chain chain) throws IOException { return chain.proceed(request); } + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} + /** * Gets the UrlReplaceHandlerOption for the UrlReplaceHandler. * @return the UrlReplaceHandlerOption for the UrlReplaceHandler. diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java index ac6b37e8..b1c0c4d5 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java @@ -86,4 +86,8 @@ public boolean isEnabled() { @Nonnull public Class getType() { return (Class) UrlReplaceHandlerOption.class; } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/serialization/form/src/main/java/com/microsoft/kiota/serialization/FormParseNode.java b/components/serialization/form/src/main/java/com/microsoft/kiota/serialization/FormParseNode.java index b2df53eb..f62827c5 100644 --- a/components/serialization/form/src/main/java/com/microsoft/kiota/serialization/FormParseNode.java +++ b/components/serialization/form/src/main/java/com/microsoft/kiota/serialization/FormParseNode.java @@ -140,7 +140,11 @@ private String sanitizeKey(@Nonnull final String key) { } @Nullable public List getCollectionOfPrimitiveValues(@Nonnull final Class targetClass) { - final String[] primitiveStringCollection = getStringValue().split(","); + final String rawValue = getStringValue(); + if (rawValue == null) { + return null; + } + final String[] primitiveStringCollection = rawValue.split(","); final List result = new ArrayList<>(primitiveStringCollection.length); for (final String item : primitiveStringCollection) { String decodedItem; diff --git a/components/serialization/form/src/test/java/com/microsoft/kiota/serialization/ParseNodeTests.java b/components/serialization/form/src/test/java/com/microsoft/kiota/serialization/ParseNodeTests.java index 6cb719e0..5448edf1 100644 --- a/components/serialization/form/src/test/java/com/microsoft/kiota/serialization/ParseNodeTests.java +++ b/components/serialization/form/src/test/java/com/microsoft/kiota/serialization/ParseNodeTests.java @@ -89,6 +89,7 @@ void returnsDefaultIfChildNodeDoesNotExist() { void getCollectionOfBooleanPrimitiveValuesFromForm() { final String TestFormData = "bools=true&" + "bools=false"; final ParseNode numberNode = new FormParseNode(TestFormData).getChildNode("bools"); + assertNotNull(numberNode); final List numberCollection = numberNode.getCollectionOfPrimitiveValues(Boolean.class); assertNotNull(numberCollection); @@ -102,6 +103,7 @@ void getCollectionOfGuidPrimitiveValuesFromForm() { "ids=48d31887-5fad-4d73-a9f5-3c356e68a038&" + "ids=48d31887-5fad-4d73-a9f5-3c356e68a038"; final ParseNode numberNode = new FormParseNode(TestFormData).getChildNode("ids"); + assertNotNull(numberNode); var numberCollection = numberNode.getCollectionOfPrimitiveValues(UUID.class); assertNotNull(numberCollection); assertEquals(2, numberCollection.size()); @@ -143,6 +145,7 @@ void testInvalidOffsetDateTimeStringThrowsException(final String dateTimeString) void getCollectionOfStringPrimitiveValuesFromForm() { final String testFormData = "names=Alice&names=Bob"; final ParseNode node = new FormParseNode(testFormData).getChildNode("names"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(String.class); assertNotNull(result); assertEquals(2, result.size()); @@ -154,6 +157,7 @@ void getCollectionOfStringPrimitiveValuesFromForm() { void getCollectionOfIntegerPrimitiveValuesFromForm() { final String testFormData = "nums=1&nums=2&nums=3"; final ParseNode node = new FormParseNode(testFormData).getChildNode("nums"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Integer.class); assertNotNull(result); assertEquals(3, result.size()); @@ -166,6 +170,7 @@ void getCollectionOfIntegerPrimitiveValuesFromForm() { void getCollectionOfLongPrimitiveValuesFromForm() { final String testFormData = "vals=100&vals=200"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Long.class); assertNotNull(result); assertEquals(2, result.size()); @@ -177,6 +182,7 @@ void getCollectionOfLongPrimitiveValuesFromForm() { void getCollectionOfDoublePrimitiveValuesFromForm() { final String testFormData = "vals=1.5&vals=2.5"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Double.class); assertNotNull(result); assertEquals(2, result.size()); @@ -188,6 +194,7 @@ void getCollectionOfDoublePrimitiveValuesFromForm() { void getCollectionOfFloatPrimitiveValuesFromForm() { final String testFormData = "vals=1.5&vals=2.5"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Float.class); assertNotNull(result); assertEquals(2, result.size()); @@ -199,6 +206,7 @@ void getCollectionOfFloatPrimitiveValuesFromForm() { void getCollectionOfShortPrimitiveValuesFromForm() { final String testFormData = "vals=10&vals=20"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Short.class); assertNotNull(result); assertEquals(2, result.size()); @@ -210,6 +218,7 @@ void getCollectionOfShortPrimitiveValuesFromForm() { void getCollectionOfBytePrimitiveValuesFromForm() { final String testFormData = "vals=1&vals=2"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(Byte.class); assertNotNull(result); assertEquals(2, result.size()); @@ -221,6 +230,7 @@ void getCollectionOfBytePrimitiveValuesFromForm() { void getCollectionOfBigDecimalPrimitiveValuesFromForm() { final String testFormData = "vals=123.45&vals=678.90"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(BigDecimal.class); assertNotNull(result); assertEquals(2, result.size()); @@ -238,6 +248,7 @@ void getCollectionOfOffsetDateTimePrimitiveValuesFromForm() { + "&vals=" + URLEncoder.encode(dt2, StandardCharsets.UTF_8); final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(OffsetDateTime.class); assertNotNull(result); @@ -250,6 +261,7 @@ void getCollectionOfOffsetDateTimePrimitiveValuesFromForm() { void getCollectionOfLocalDatePrimitiveValuesFromForm() { final String testFormData = "vals=2024-01-01&vals=2024-06-15"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(LocalDate.class); assertNotNull(result); assertEquals(2, result.size()); @@ -261,6 +273,7 @@ void getCollectionOfLocalDatePrimitiveValuesFromForm() { void getCollectionOfLocalTimePrimitiveValuesFromForm() { final String testFormData = "vals=08:00:00&vals=17:30:00"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(LocalTime.class); assertNotNull(result); assertEquals(2, result.size()); @@ -272,6 +285,7 @@ void getCollectionOfLocalTimePrimitiveValuesFromForm() { void getCollectionOfPeriodAndDurationPrimitiveValuesFromForm() { final String testFormData = "vals=P1M&vals=PT2H"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); final List result = node.getCollectionOfPrimitiveValues(PeriodAndDuration.class); assertNotNull(result); @@ -284,6 +298,7 @@ void getCollectionOfPeriodAndDurationPrimitiveValuesFromForm() { void getCollectionOfPrimitiveValuesThrowsForUnknownType() { final String testFormData = "vals=foo"; final ParseNode node = new FormParseNode(testFormData).getChildNode("vals"); + assertNotNull(node); assertThrows( RuntimeException.class, () -> node.getCollectionOfPrimitiveValues(Object.class)); } diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java index 83ae5efa..0207d560 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java @@ -119,6 +119,10 @@ public JsonParseNode(@Nonnull final JsonElement node, @Nonnull final Gson gson) return gson.fromJson(currentNode, LocalDate.class); } + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} + @Nullable public LocalTime getLocalTimeValue() { return gson.fromJson(currentNode, LocalTime.class); } diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java index 65a8d487..a1a6749b 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java @@ -54,4 +54,8 @@ public JsonParseNodeFactory(@Nonnull Gson gson) { throw new RuntimeException("could not close the reader", ex); } } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java index 11ca51d7..d8425a86 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java @@ -111,6 +111,10 @@ public void writeBigDecimalValue(@Nullable final String key, @Nullable final Big } } + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} + public void writeIntegerValue(@Nullable final String key, @Nullable final Integer value) { if (value != null) try { diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java index f6420a1c..276a8401 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java @@ -42,4 +42,8 @@ public JsonSerializationWriterFactory(@Nonnull Gson gson) { } return new JsonSerializationWriter(gson); } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } diff --git a/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java b/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java index 11ddafc2..de4a444c 100644 --- a/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java +++ b/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java @@ -78,7 +78,8 @@ public TextParseNode(@Nonnull final String rawText) { } @Nullable public UUID getUUIDValue() { - return UUID.fromString(this.getStringValue()); + final String value = this.getStringValue(); + return value != null ? UUID.fromString(value) : null; } @Nullable public OffsetDateTime getOffsetDateTimeValue() { @@ -104,7 +105,8 @@ public TextParseNode(@Nonnull final String rawText) { } @Nullable public PeriodAndDuration getPeriodAndDurationValue() { - return PeriodAndDuration.parse(this.getStringValue()); + final String value = this.getStringValue(); + return value != null ? PeriodAndDuration.parse(value) : null; } @Nullable public List getCollectionOfPrimitiveValues(@Nonnull final Class targetClass) { @@ -165,4 +167,8 @@ public void setOnAfterAssignFieldValues(@Nullable final Consumer value } return Base64.getDecoder().decode(base64); } + + @Override + @SuppressWarnings("deprecation") + protected final void finalize() {} } From e26c5dd66971ace35773cf2d0e72d26455da7a80 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 10 Jun 2026 09:46:22 -0400 Subject: [PATCH 7/7] chore: reverts finalize noise --- components/abstractions/spotBugsExcludeFilter.xml | 13 +++++++++++++ .../com/microsoft/kiota/ApiExceptionBuilder.java | 4 ---- .../com/microsoft/kiota/BaseRequestBuilder.java | 4 ---- .../src/main/java/com/microsoft/kiota/Headers.java | 4 ---- .../com/microsoft/kiota/RequestInformation.java | 4 ---- .../BaseBearerTokenAuthenticationProvider.java | 4 ---- .../BasicAccessAuthenticationProvider.java | 4 ---- .../kiota/serialization/ParseNodeProxyFactory.java | 4 ---- .../SerializationWriterProxyFactory.java | 4 ---- .../authentication/azure/spotBugsExcludeFilter.xml | 8 ++++++++ .../AzureIdentityAccessTokenProvider.java | 4 ---- components/http/okHttp/spotBugsExcludeFilter.xml | 11 +++++++++++ .../microsoft/kiota/http/OkHttpRequestAdapter.java | 4 ---- .../kiota/http/middleware/AuthorizationHandler.java | 4 ---- .../http/middleware/HeadersInspectionHandler.java | 4 ---- .../middleware/ParametersNameDecodingHandler.java | 4 ---- .../kiota/http/middleware/UrlReplaceHandler.java | 4 ---- .../middleware/options/UrlReplaceHandlerOption.java | 4 ---- .../serialization/json/spotBugsExcludeFilter.xml | 9 +++++++++ .../kiota/serialization/JsonParseNode.java | 4 ---- .../kiota/serialization/JsonParseNodeFactory.java | 4 ---- .../serialization/JsonSerializationWriter.java | 4 ---- .../JsonSerializationWriterFactory.java | 4 ---- .../serialization/text/spotBugsExcludeFilter.xml | 4 ++++ .../kiota/serialization/TextParseNode.java | 4 ---- 25 files changed, 45 insertions(+), 80 deletions(-) diff --git a/components/abstractions/spotBugsExcludeFilter.xml b/components/abstractions/spotBugsExcludeFilter.xml index 68e65df8..8c33623a 100644 --- a/components/abstractions/spotBugsExcludeFilter.xml +++ b/components/abstractions/spotBugsExcludeFilter.xml @@ -67,4 +67,17 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu + + + + + + + + + + + + + diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java b/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java index e3941e1d..ae7440c7 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/ApiExceptionBuilder.java @@ -99,8 +99,4 @@ public ApiExceptionBuilder(@Nonnull final Supplier builder) { value = null; return result; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java b/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java index 7154ff94..c59a4242 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/BaseRequestBuilder.java @@ -54,8 +54,4 @@ protected BaseRequestBuilder( this(requestAdapter, urlTemplate); this.pathParameters.put(RequestInformation.RAW_URL_KEY, Objects.requireNonNull(rawUrl)); } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java b/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java index 8228a488..8ff31a6d 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/Headers.java @@ -88,8 +88,4 @@ public boolean remove(@Nonnull final String key, @Nonnull final String value) { } return false; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java b/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java index 9f2c861e..7cd98aa9 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java @@ -127,10 +127,6 @@ public void configure( } } - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} - /** * Sets the URI of the request. * @param uri the URI of the request. diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java index b3ef7e2a..43ceaa0d 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BaseBearerTokenAuthenticationProvider.java @@ -57,8 +57,4 @@ public void authenticateRequest( public @Nonnull AccessTokenProvider getAccessTokenProvider() { return this.accessTokenProvider; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java index 8167b77f..3233e3df 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/authentication/BasicAccessAuthenticationProvider.java @@ -44,8 +44,4 @@ public void authenticateRequest( @Nullable final Map additionalAuthenticationContext) { request.headers.add(AUTHORIZATION_HEADER_KEY, BASIC + encoded); } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java index 16c83c81..38a5be2c 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/ParseNodeProxyFactory.java @@ -59,8 +59,4 @@ public ParseNodeProxyFactory( }); return node; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java index 510ceab1..fe3d34c9 100644 --- a/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java +++ b/components/abstractions/src/main/java/com/microsoft/kiota/serialization/SerializationWriterProxyFactory.java @@ -73,8 +73,4 @@ public SerializationWriterProxyFactory( }); return writer; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/authentication/azure/spotBugsExcludeFilter.xml b/components/authentication/azure/spotBugsExcludeFilter.xml index 4c106093..1925dadf 100644 --- a/components/authentication/azure/spotBugsExcludeFilter.xml +++ b/components/authentication/azure/spotBugsExcludeFilter.xml @@ -7,4 +7,12 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu + + + + + + + + \ No newline at end of file diff --git a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java index e7774d34..a247c572 100644 --- a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java +++ b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java @@ -181,8 +181,4 @@ private static boolean isLocalhostUrl(@Nonnull String host) { Objects.requireNonNull(host); return localhostStrings.contains(host.toLowerCase(Locale.ROOT)); } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/http/okHttp/spotBugsExcludeFilter.xml b/components/http/okHttp/spotBugsExcludeFilter.xml index a242f453..cd4710d9 100644 --- a/components/http/okHttp/spotBugsExcludeFilter.xml +++ b/components/http/okHttp/spotBugsExcludeFilter.xml @@ -39,4 +39,15 @@ + + + + + + + + + + + diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java index 193b7055..a73f1db9 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java @@ -1005,8 +1005,4 @@ public void writeTo(@Nonnull BufferedSink sink) throws IOException { span.end(); } } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java index 5a70a095..c80b1617 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/AuthorizationHandler.java @@ -137,8 +137,4 @@ public AuthorizationHandler( } return request; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java index 9ffe11b4..3de7831a 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/HeadersInspectionHandler.java @@ -85,8 +85,4 @@ public HeadersInspectionHandler(@Nonnull final HeadersInspectionOption options) } } } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java index 2d381d13..0cab034c 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java @@ -98,10 +98,6 @@ public ParametersNameDecodingHandler(@Nonnull final ParametersNameDecodingOption } } - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} - /** * INTERNAL Decodes the query parameters that are in the list of parameters to decode * @param original the original query string diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java index 9453721a..cf2d2bba 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/UrlReplaceHandler.java @@ -72,10 +72,6 @@ public Response intercept(@Nonnull Chain chain) throws IOException { return chain.proceed(request); } - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} - /** * Gets the UrlReplaceHandlerOption for the UrlReplaceHandler. * @return the UrlReplaceHandlerOption for the UrlReplaceHandler. diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java index b1c0c4d5..ac6b37e8 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UrlReplaceHandlerOption.java @@ -86,8 +86,4 @@ public boolean isEnabled() { @Nonnull public Class getType() { return (Class) UrlReplaceHandlerOption.class; } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/serialization/json/spotBugsExcludeFilter.xml b/components/serialization/json/spotBugsExcludeFilter.xml index 4a40a57f..75443282 100644 --- a/components/serialization/json/spotBugsExcludeFilter.xml +++ b/components/serialization/json/spotBugsExcludeFilter.xml @@ -32,4 +32,13 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu + + + + + + + + + diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java index 0207d560..83ae5efa 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNode.java @@ -119,10 +119,6 @@ public JsonParseNode(@Nonnull final JsonElement node, @Nonnull final Gson gson) return gson.fromJson(currentNode, LocalDate.class); } - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} - @Nullable public LocalTime getLocalTimeValue() { return gson.fromJson(currentNode, LocalTime.class); } diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java index a1a6749b..65a8d487 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonParseNodeFactory.java @@ -54,8 +54,4 @@ public JsonParseNodeFactory(@Nonnull Gson gson) { throw new RuntimeException("could not close the reader", ex); } } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java index d8425a86..11ca51d7 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriter.java @@ -111,10 +111,6 @@ public void writeBigDecimalValue(@Nullable final String key, @Nullable final Big } } - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} - public void writeIntegerValue(@Nullable final String key, @Nullable final Integer value) { if (value != null) try { diff --git a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java index 276a8401..f6420a1c 100644 --- a/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java +++ b/components/serialization/json/src/main/java/com/microsoft/kiota/serialization/JsonSerializationWriterFactory.java @@ -42,8 +42,4 @@ public JsonSerializationWriterFactory(@Nonnull Gson gson) { } return new JsonSerializationWriter(gson); } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} } diff --git a/components/serialization/text/spotBugsExcludeFilter.xml b/components/serialization/text/spotBugsExcludeFilter.xml index c20dac93..478f6b1d 100644 --- a/components/serialization/text/spotBugsExcludeFilter.xml +++ b/components/serialization/text/spotBugsExcludeFilter.xml @@ -7,4 +7,8 @@ + + + + \ No newline at end of file diff --git a/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java b/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java index de4a444c..38743686 100644 --- a/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java +++ b/components/serialization/text/src/main/java/com/microsoft/kiota/serialization/TextParseNode.java @@ -167,8 +167,4 @@ public void setOnAfterAssignFieldValues(@Nullable final Consumer value } return Base64.getDecoder().decode(base64); } - - @Override - @SuppressWarnings("deprecation") - protected final void finalize() {} }