ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1051690 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
Date Tue, 21 Dec 2010 22:49:55 GMT
Author: maartenc
Date: Tue Dec 21 22:49:54 2010
New Revision: 1051690

URL: http://svn.apache.org/viewvc?rev=1051690&view=rev
Log:
FIX: ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes (IVY-1253)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1051690&r1=1051689&r2=1051690&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Dec 21 22:49:54 2010
@@ -117,6 +117,7 @@ for detailed view of each issue, please 
 - NEW: ivy:resolve and post resole task can now have inlined dependencies declaration.
 - NEW: Import Bushel into Ivy core (IVY-1241)
 
+- FIX: ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes (IVY-1253)
 - FIX: Can not use a v[revision] in an artifact pattern of a filesystem resolver (IVY-1238)
 - FIX: Cached ivy.xml is invalid if the description contains the ampersand entity (&)
(IVY-1237)
 - FIX: Couldn't authenticate against sites having the same address as the proxy server (IVY-1234)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java?rev=1051690&r1=1051689&r2=1051690&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
Tue Dec 21 22:49:54 2010
@@ -17,7 +17,6 @@
  */
 package org.apache.ivy.plugins.parser.xml;
 
-import java.io.BufferedInputStream;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -1208,9 +1207,9 @@ public final class XmlModuleDescriptorUp
             OutputStream outStream, final UpdateOptions options) 
             throws IOException, SAXException {
         final PrintWriter out = new PrintWriter(new OutputStreamWriter(outStream, "UTF-8"));
-        final BufferedInputStream in = new BufferedInputStream(inStream);
+        final BufferedReader in = new BufferedReader(new InputStreamReader(inStream));
 
-        in.mark(MAX_HEADER_LENGTH); // assume the header is never larger than 10000 bytes.
+        in.mark(MAX_HEADER_LENGTH); // assume the header is never larger than 10000 characters.
         copyHeader(in, out);
         in.reset(); // reposition the stream at the beginning
 
@@ -1234,13 +1233,8 @@ public final class XmlModuleDescriptorUp
      * <ivy-module to out, except if <ivy-module is not found, in which case nothing
is copied. The
      * prolog <?xml version="..." encoding="...."?> is also replaced by <?xml version="1.0"
      * encoding="UTF-8"?> if it was present.
-     * 
-     * @param in
-     * @param out
-     * @throws IOException
      */
-    private static void copyHeader(InputStream in, PrintWriter out) throws IOException {
-        BufferedReader r = new BufferedReader(new InputStreamReader(in));
+    private static void copyHeader(BufferedReader r, PrintWriter out) throws IOException
{
         String line = r.readLine();
         if (line != null && line.startsWith("<?xml ")) {
             out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");



Mime
View raw message