From 3a23f6180628c2a706c72a3feec662aad92a5ef5 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 29 Oct 2024 17:50:34 +0100 Subject: [PATCH] Revert try with resources changes following feedback https://github.com/openrewrite/rewrite-maven-plugin/commit/9a0d4fce38efd0d16c72b76beab60a5e0f81f3d6#commitcomment-148490710 --- src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java index b26ac11c..4d80d993 100644 --- a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java +++ b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java @@ -79,9 +79,8 @@ Config getConfig() throws IOException { URI uri = new URI(configLocation); if (uri.getScheme() != null && uri.getScheme().startsWith("http")) { HttpSender httpSender = new HttpUrlConnectionSender(); - try (HttpSender.Response send = httpSender.get(configLocation).send()) { - return new Config(send.getBody(), uri); - } + //noinspection resource + return new Config(httpSender.get(configLocation).send().getBody(), uri); } } catch (URISyntaxException e) { // Try to load as a path