You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2014/10/28 00:37:43 UTC

[1/2] git commit: IVY-1452: NullPointerException when accessing charset to invalid URL (Thanks to Frédéric Riviere)

Repository: ant-ivy
Updated Branches:
  refs/heads/master 9f5f0c098 -> b84f786db


IVY-1452: NullPointerException when accessing charset to invalid URL (Thanks to Frédéric Riviere)

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/902a6809
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/902a6809
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/902a6809

Branch: refs/heads/master
Commit: 902a680951f318488a4bbe0184a3a223c5709b01
Parents: 9f5f0c0
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Tue Oct 28 00:36:39 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Tue Oct 28 00:36:39 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                           | 1 +
 src/java/org/apache/ivy/util/url/ApacheURLLister.java | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/902a6809/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 047cea0..4d18a9d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -153,6 +153,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br
 - FIX: The SSH resolvers fails if the un-required jsch jar is missing (IVY-1471)
 - FIX: failed to resolve dynamic revisions in some cases for URL repositories (IVY-1472)
 - FIX: ClassCastException in Eclipse 4.4.1 (IVY-1487) (Thanks to Carsten Pfeiffer)
+- FIX: NullPointerException when accessing charset to invalid URL (IVY-1452) (Thanks to Frédéric Riviere)
 
    2.4.0-rc1
 =====================================

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/902a6809/src/java/org/apache/ivy/util/url/ApacheURLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/url/ApacheURLLister.java b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
index 1b92fb8..2df69b0 100644
--- a/src/java/org/apache/ivy/util/url/ApacheURLLister.java
+++ b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
@@ -29,6 +29,7 @@ import java.util.regex.Pattern;
 
 import org.apache.ivy.util.FileUtil;
 import org.apache.ivy.util.Message;
+import org.apache.ivy.util.url.URLHandler.URLInfo;
 
 /**
  * Utility class which helps to list urls under a given url. This has been tested with Apache 1.3.33
@@ -108,7 +109,13 @@ public class ApacheURLLister {
         }
 
         URLHandler urlHandler = URLHandlerRegistry.getDefault();
-        String charset = urlHandler.getURLInfo(url).getBodyCharset();
+        URLInfo urlInfo = urlHandler.getURLInfo(url);
+        if (urlInfo == URLHandler.UNAVAILABLE) {
+            return urlList; // not found => return empty list
+        }
+        // here, urlInfo is valid
+        String charset = urlInfo.getBodyCharset();
+
         InputStream contentStream = urlHandler.openStream(url);
         BufferedReader r = new BufferedReader(new InputStreamReader(contentStream, charset));
 


[2/2] git commit: IVY-1493 : Can't resolve wildcard dependencies when remote artifact server does not set content-type header (Thanks to Andrew Bernhagen)

Posted by hi...@apache.org.
IVY-1493 : Can't resolve wildcard dependencies when remote artifact server does not set content-type header (Thanks to Andrew Bernhagen)

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/b84f786d
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/b84f786d
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/b84f786d

Branch: refs/heads/master
Commit: b84f786db6d85cbf9973adfccdf135cb71824b87
Parents: 902a680
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Tue Oct 28 00:37:04 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Tue Oct 28 00:37:04 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                           | 2 ++
 src/java/org/apache/ivy/util/url/ApacheURLLister.java | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/b84f786d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4d18a9d..da4a7ff 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -22,6 +22,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br
 	Andreas Axelsson
 	Stephane Bailliez
 	Karl Baum
+	Andrew Bernhagen
 	Mikkel Bjerg
 	Per Arnold Blaasmo
 	Jeffrey Blattman
@@ -154,6 +155,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br
 - FIX: failed to resolve dynamic revisions in some cases for URL repositories (IVY-1472)
 - FIX: ClassCastException in Eclipse 4.4.1 (IVY-1487) (Thanks to Carsten Pfeiffer)
 - FIX: NullPointerException when accessing charset to invalid URL (IVY-1452) (Thanks to Frédéric Riviere)
+- FIX: Can't resolve wildcard dependencies when remote artifact server does not set content-type header (IVY-1493) (Thanks to Andrew Bernhagen)
 
    2.4.0-rc1
 =====================================

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/b84f786d/src/java/org/apache/ivy/util/url/ApacheURLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/url/ApacheURLLister.java b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
index 2df69b0..e2e7dea 100644
--- a/src/java/org/apache/ivy/util/url/ApacheURLLister.java
+++ b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
@@ -117,7 +117,12 @@ public class ApacheURLLister {
         String charset = urlInfo.getBodyCharset();
 
         InputStream contentStream = urlHandler.openStream(url);
-        BufferedReader r = new BufferedReader(new InputStreamReader(contentStream, charset));
+        BufferedReader r = null;
+        if (charset == null) {
+            r = new BufferedReader(new InputStreamReader(contentStream));
+        } else {
+            r = new BufferedReader(new InputStreamReader(contentStream, charset));
+        }
 
         String htmlText = FileUtil.readEntirely(r);