From c264f66f758aa0bc5d0d0e25c951218a304cff66 Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Tue, 28 Jan 2025 15:42:50 -0500 Subject: [PATCH 1/3] feat: support JDK 23 --- .github/workflows/ci.yaml | 4 ++-- .../http/javanet/NetHttpTransportTest.java | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4595806ea..85257b0f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [8, 11, 17, 23] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [8, 11, 17, 21] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java index 835730793..bee26761c 100644 --- a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java +++ b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java @@ -203,14 +203,17 @@ public void testDisconnectShouldNotWaitToReadResponse() throws IOException { public void handle(HttpExchange httpExchange) throws IOException { byte[] response = httpExchange.getRequestURI().toString().getBytes(); httpExchange.sendResponseHeaders(200, response.length); - - // Sleep for longer than the test timeout - try { - Thread.sleep(100_000); - } catch (InterruptedException e) { - throw new IOException("interrupted", e); - } try (OutputStream out = httpExchange.getResponseBody()) { + byte[] firstByte = new byte[] { 0x01 }; + out.write(firstByte); + out.flush(); + + // Sleep for longer than the test timeout + try { + Thread.sleep(100_000); + } catch (InterruptedException e) { + throw new IOException("interrupted", e); + } out.write(response); } } From b4f4e7a17a672eda5f1195b69390142f205daaae Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Tue, 28 Jan 2025 15:53:07 -0500 Subject: [PATCH 2/3] format --- .../google/api/client/http/javanet/NetHttpTransportTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java index bee26761c..26ecd5139 100644 --- a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java +++ b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java @@ -204,7 +204,7 @@ public void handle(HttpExchange httpExchange) throws IOException { byte[] response = httpExchange.getRequestURI().toString().getBytes(); httpExchange.sendResponseHeaders(200, response.length); try (OutputStream out = httpExchange.getResponseBody()) { - byte[] firstByte = new byte[] { 0x01 }; + byte[] firstByte = new byte[] {0x01}; out.write(firstByte); out.flush(); From 9f113dcfd1aacebb39af807bfc76da015b783fce Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Tue, 28 Jan 2025 15:56:32 -0500 Subject: [PATCH 3/3] fix supported version in ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85257b0f0..12e4343aa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17, 21] + java: [8, 11, 17, 23] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4