You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2023/03/17 11:59:39 UTC

[ant-ivy] branch master updated: IVY-1641: fix NullPointerException if content type has no charset

This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant-ivy.git


The following commit(s) were added to refs/heads/master by this push:
     new c63ce79f IVY-1641: fix NullPointerException if content type has no charset
c63ce79f is described below

commit c63ce79f52133857d1146cd2335d51178714effd
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Fri Mar 17 12:59:02 2023 +0100

    IVY-1641: fix NullPointerException if content type has no charset
---
 asciidoc/release-notes.adoc                             | 7 +++++--
 src/java/org/apache/ivy/util/url/HttpClientHandler.java | 3 ++-
 version.properties                                      | 4 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/asciidoc/release-notes.adoc b/asciidoc/release-notes.adoc
index 91453803..84379627 100644
--- a/asciidoc/release-notes.adoc
+++ b/asciidoc/release-notes.adoc
@@ -19,7 +19,7 @@
 
 = Ivy Release Announcement
 
-XXXX Date XXXX - The Apache Ivy project is pleased to announce its 2.6.0 release.
+XXXX Date XXXX - The Apache Ivy project is pleased to announce its 2.5.2 release.
 
 == What is Ivy?
 Apache Ivy is a tool for managing (recording, tracking, resolving and reporting) project dependencies, characterized by flexibility,
@@ -34,8 +34,9 @@ More information about the project can be found on the website link:https://ant.
 
 == Key features in this release
 
-Key features of this 2.6.0 release are:
+Key features of this 2.5.2 release are:
 
+- FIX: ivy:retrieve could fail because of a `NullPointerException` (jira:IVY-1641[])
 
 == List of Changes in this Release
 
@@ -51,6 +52,8 @@ For details about the following changes, check our JIRA install at link:https://
 - DOCUMENTATION: bla bla bla (jira:IVY-1234[]) (Thanks to Jane Doe)
 ////
 
+- FIX: ivy:retrieve could fail because of a `NullPointerException` (jira:IVY-1641[])
+
 == Committers and Contributors
 
 Here is the list of people who have contributed source code and documentation up to this release. Many thanks to all of them, and also to the whole IvyDE community contributing ideas and feedback, and promoting the use of Apache Ivy !
diff --git a/src/java/org/apache/ivy/util/url/HttpClientHandler.java b/src/java/org/apache/ivy/util/url/HttpClientHandler.java
index d79cd27c..8f117753 100644
--- a/src/java/org/apache/ivy/util/url/HttpClientHandler.java
+++ b/src/java/org/apache/ivy/util/url/HttpClientHandler.java
@@ -239,8 +239,9 @@ public class HttpClientHandler extends AbstractURLHandler implements TimeoutCons
             if (checkStatusCode(httpMethod, url, response)) {
                 final HttpEntity responseEntity = response.getEntity();
                 final Charset charSet = ContentType.getOrDefault(responseEntity).getCharset();
+                final String charSetName = charSet != null ? charSet.name() : null;
                 return new URLInfo(true, responseEntity == null ? 0 : responseEntity.getContentLength(),
-                        getLastModified(response), charSet.name());
+                        getLastModified(response), charSetName);
             }
         } catch (IOException | IllegalArgumentException e) {
             // IllegalArgumentException is thrown by HttpClient library to indicate the URL is not valid,
diff --git a/version.properties b/version.properties
index 57a04932..dc92edea 100644
--- a/version.properties
+++ b/version.properties
@@ -16,9 +16,9 @@
 #	 * specific language governing permissions and limitations
 #	 * under the License.
 #	 ***************************************************************
-target.ivy.version=2.6.0
+target.ivy.version=2.5.2
 # Following OSGi spec: have to be 3 numbers separated by dots
-target.ivy.bundle.version=2.6.0
+target.ivy.bundle.version=2.5.2
 # in case we want to add a qualifier such as alpha, beta, etc...
 # if non empty, add a '_' at the end of the qualifier, so the version would look like 1.2.3.alpha_200901011200
 # NB: be careful with naming, OSGi orders version alphabetically. Suggested values: alpha_, beta_, cr1_ (for RC-1), final_