Repository: googleapis/google-http-java-client
Pull request #2028 (2024-11-19 20:51:40)

build(deps): update dependency com.google.cloud:native-image-shared-config to v1.12.0
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:native-image-shared-config](https://redirect.github.com/googleapis/java-shared-config) | `1.11.3` -> `1.12.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:native-image-shared-config/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:native-image-shared-config/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:native-image-shared-config/1.11.3/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:native-image-shared-config/1.11.3/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-shared-config (com.google.cloud:native-image-shared-config)</summary>

### [`v1.12.0`](https://redirect.github.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#1120-2024-11-13)

[Compare Source](https://redirect.github.com/googleapis/java-shared-config/compare/v1.11.3...v1.12.0)

##### Features

-   Maven profile for Airlock ([#&#8203;928](https://redirect.github.com/googleapis/java-shared-config/issues/928)) ([10da584](https://redirect.github.com/googleapis/java-shared-config/commit/10da5843f6c3fa50c3fff4a4fd01326a1cc68158))
-   Publish graalvm images to new java-graalvm-ci-prod project ([#&#8203;922](https://redirect.github.com/googleapis/java-shared-config/issues/922)) ([69ccd0f](https://redirect.github.com/googleapis/java-shared-config/commit/69ccd0f0dce6d4b3b01ac067000007292d7fff95))

##### Dependencies

-   Update actions/checkout digest to [`11bd719`](https://redirect.github.com/googleapis/java-shared-config/commit/11bd719) ([#&#8203;919](https://redirect.github.com/googleapis/java-shared-config/issues/919)) ([eb0ae86](https://redirect.github.com/googleapis/java-shared-config/commit/eb0ae8622b330045efd76cf6d14f0a9b79071fd7))
-   Update dependency com.puppycrawl.tools:checkstyle to v10.20.1 ([#&#8203;932](https://redirect.github.com/googleapis/java-shared-config/issues/932)) ([ba72db5](https://redirect.github.com/googleapis/java-shared-config/commit/ba72db54f809e8a1dbed4f70736328e3f6bf06ee))
-   Update dependency org.graalvm.sdk:graal-sdk to v24.1.1 ([#&#8203;923](https://redirect.github.com/googleapis/java-shared-config/issues/923)) ([b22170a](https://redirect.github.com/googleapis/java-shared-config/commit/b22170a8fb8fddfb79927ab98cb2e299152cbc8e))
-   Update dependency org.graalvm.sdk:nativeimage to v24.1.1 ([#&#8203;924](https://redirect.github.com/googleapis/java-shared-config/issues/924)) ([fa97ca8](https://redirect.github.com/googleapis/java-shared-config/commit/fa97ca825159016aee31dbac7e9967a572b02a33))
-   Update dependency org.junit.vintage:junit-vintage-engine to v5.11.3 ([#&#8203;917](https://redirect.github.com/googleapis/java-shared-config/issues/917)) ([13766a3](https://redirect.github.com/googleapis/java-shared-config/commit/13766a3837c647398f2c8fea6a3b089287f07a25))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/google-http-java-client).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->


dpebot: /gcbrun
dpebot: /gcbrun

Patch:
diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml
index 7c5ec786..36da117b 100644
--- a/.github/workflows/renovate_config_check.yaml
+++ b/.github/workflows/renovate_config_check.yaml
@@ -7,7 +7,7 @@ on:
 
 jobs:
   renovate_bot_config_validation:
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
 
     steps:
     - name: Checkout code
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index f153dddd..0181d530 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -32,7 +32,7 @@ jobs:
 
     steps:
       - name: "Checkout code"
-        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
         with:
           persist-credentials: false
 
diff --git a/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5HttpResponse.java b/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5HttpResponse.java
index 1574c8c8..ae3c2ffb 100644
--- a/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5HttpResponse.java
+++ b/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5HttpResponse.java
@@ -46,7 +46,8 @@ final class Apache5HttpResponse extends LowLevelHttpResponse {
 
   @Override
   public InputStream getContent() throws IOException {
-    return new Apache5ResponseContent(entity.getContent(), response);
+    InputStream content = entity == null ? null : entity.getContent();
+    return new Apache5ResponseContent(content, response);
   }
 
   @Override
diff --git a/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5ResponseContent.java b/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5ResponseContent.java
index c2d3091d..dfb6da8a 100644
--- a/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5ResponseContent.java
+++ b/google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5ResponseContent.java
@@ -59,8 +59,12 @@ public class Apache5ResponseContent extends InputStream {
 
   @Override
   public void close() throws IOException {
-    wrappedStream.close();
-    response.close();
+    if (wrappedStream != null) {
+      wrappedStream.close();
+    }
+    if (response != null) {
+      response.close();
+    }
   }
 
   @Override
diff --git a/google-http-client-bom/pom.xml b/google-http-client-bom/pom.xml
index 64100950..345d15b4 100644
--- a/google-http-client-bom/pom.xml
+++ b/google-http-client-bom/pom.xml
@@ -133,7 +133,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <version>3.8.0</version>
+        <version>3.11.1</version>
         <configuration>
           <skip>true</skip>
         </configuration>
diff --git a/pom.xml b/pom.xml
index eb087eca..11342707 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>native-image-shared-config</artifactId>
-    <version>1.11.3</version>
+    <version>1.12.0</version>
   </parent>
 
   <!--
@@ -138,7 +138,7 @@
       <dependency>
         <groupId>com.google.errorprone</groupId>
         <artifactId>error_prone_annotations</artifactId>
-        <version>2.30.0</version>
+        <version>2.36.0</version>
       </dependency>
       <dependency>
         <groupId>com.google.appengine</groupId>
@@ -258,7 +258,7 @@
       <dependency>
         <groupId>io.grpc</groupId>
         <artifactId>grpc-context</artifactId>
-        <version>1.66.0</version>
+        <version>1.68.2</version>
       </dependency>
       <dependency>
         <groupId>io.opencensus</groupId>
@@ -330,7 +330,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-javadoc-plugin</artifactId>
-          <version>3.8.0</version>
+          <version>3.11.1</version>
           <executions>
             <execution>
               <id>attach-javadocs</id>
@@ -610,11 +610,11 @@
       - Internally, update the default features.json file
     -->
     <project.http-client.version>1.45.1</project.http-client.version><!-- {x-version-update:google-http-client-parent:current} -->
-    <project.appengine.version>2.0.29</project.appengine.version>
+    <project.appengine.version>2.0.31</project.appengine.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.jsr305.version>3.0.2</project.jsr305.version>
     <project.gson.version>2.11.0</project.gson.version>
-    <project.jackson-core2.version>2.17.2</project.jackson-core2.version>
+    <project.jackson-core2.version>2.18.2</project.jackson-core2.version>
     <project.protobuf-java.version>3.21.12</project.protobuf-java.version>
     <project.guava.version>30.1.1-android</project.guava.version>
     <project.xpp3.version>1.1.4c</project.xpp3.version>
@@ -624,7 +624,7 @@
     <project.apache-httpcore-5.version>5.2.5</project.apache-httpcore-5.version>
     <project.opencensus.version>0.31.1</project.opencensus.version>
     <project.root-directory>..</project.root-directory>
-    <project.surefire.version>3.4.0</project.surefire.version>
+    <project.surefire.version>3.5.2</project.surefire.version>
     <deploy.autorelease>false</deploy.autorelease>
   </properties>
 
@@ -648,7 +648,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
-            <version>3.8.0</version>
+            <version>3.11.1</version>
             <configuration>
               <source>1.8</source>
               <failOnError>false</failOnError>
@@ -806,7 +806,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
-            <version>3.8.0</version>
+            <version>3.11.1</version>
             <configuration>
               <doclet>com.microsoft.doclet.DocFxDoclet</doclet>
               <useStandardDocletOptions>false</useStandardDocletOptions>
diff --git a/samples/dailymotion-simple-cmdline-sample/pom.xml b/samples/dailymotion-simple-cmdline-sample/pom.xml
index 1094cbe8..c1bc351b 100644
--- a/samples/dailymotion-simple-cmdline-sample/pom.xml
+++ b/samples/dailymotion-simple-cmdline-sample/pom.xml
@@ -15,7 +15,7 @@
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
-        <version>3.4.1</version>
+        <version>3.5.0</version>
         <executions>
           <execution>
             <goals>
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 9730678a..c50e894d 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -31,7 +31,7 @@
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>libraries-bom</artifactId>
-        <version>26.44.0</version>
+        <version>26.51.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>


Test patch:
diff --git a/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5HttpResponseTest.java b/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5HttpResponseTest.java
new file mode 100644
index 00000000..d2712b35
--- /dev/null
+++ b/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5HttpResponseTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.api.client.http.apache.v5;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import org.apache.hc.client5.http.classic.methods.HttpPost;
+import org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;
+import org.junit.Test;
+
+public class Apache5HttpResponseTest {
+  @Test
+  public void testNullContent() throws Exception {
+    HttpUriRequestBase base = new HttpPost("http://www.google.com");
+    MockClassicHttpResponse mockResponse = new MockClassicHttpResponse();
+    mockResponse.setEntity(null);
+    Apache5HttpResponse response = new Apache5HttpResponse(base, mockResponse);
+
+    InputStream content = response.getContent();
+
+    assertNotNull(content);
+  }
+}
diff --git a/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5ResponseContentTest.java b/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5ResponseContentTest.java
new file mode 100644
index 00000000..ddbda0dd
--- /dev/null
+++ b/google-http-client-apache-v5/src/test/java/com/google/api/client/http/apache/v5/Apache5ResponseContentTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.api.client.http.apache.v5;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.junit.Test;
+
+public class Apache5ResponseContentTest {
+  @Test
+  public void testNullResponseContent_doesNotThrowExceptionOnClose() throws Exception {
+    Apache5ResponseContent response =
+        new Apache5ResponseContent(
+            new InputStream() {
+              @Override
+              public int read() throws IOException {
+                return 0;
+              }
+            },
+            null);
+
+    response.close();
+  }
+
+  @Test
+  public void testNullWrappedContent_doesNotThrowExceptionOnClose() throws Exception {
+    MockClassicHttpResponse mockResponse = new MockClassicHttpResponse();
+    Apache5ResponseContent response = new Apache5ResponseContent(null, mockResponse);
+
+    response.close();
+  }
+}