Author: hibou
Date: Sun Sep  8 14:48:35 2013
New Revision: 1520874

URL: http://svn.apache.org/r1520874
Log:
IVY-1438:
 - fix the parsing of header values with space

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderValue.java
    
ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/ManifestHeaderTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1520874&r1=1520873&r2=1520874&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sun Sep  8 14:48:35 2013
@@ -151,6 +151,7 @@ for detailed view of each issue, please 
 - IMPROVEMENT: add support for source bundles from p2 repositories
 - IMPROVEMENT: add support for source URI from OBR repositories
 
+- FIX: ParseException when "Bundle-Description" is present in OSGI MANIFEST.MF 
(IVY-1438)
 - FIX: NIO FileLocker released locks too early (IVY-1424) (thanks to Charles 
Duffy)
 - FIX: Ssh Resolver doesn't work with Java 7 (IVY-1408) (thanks to Mykhailo 
Delegan)
 - FIX: Parsing publication date in Ant tasks not thread-safe (IVY-1412)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderValue.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderValue.java?rev=1520874&r1=1520873&r2=1520874&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderValue.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderValue.java 
Sun Sep  8 14:48:35 2013
@@ -189,8 +189,6 @@ public class ManifestHeaderValue {
         private void parseValueOrParameter() throws ParseException {
             // true if the value/parameter parsing has started, white spaces 
skipped
             boolean start = false;
-            // true if the value/parameter parsing is ended, then only white 
spaces are allowed
-            boolean end = false;
             do {
                 switch (readNext()) {
                     case '\0':
@@ -210,15 +208,10 @@ public class ManifestHeaderValue {
                     case '\n':
                     case '\r':
                         if (start) {
-                            end = true;
+                            buffer.append(c);
                         }
                         break;
                     default:
-                        if (end) {
-                            error("Expecting the end of a value or of an 
parameter name");
-                            // try to recover: restart the parsing of the 
value or parameter
-                            end = false;
-                        }
                         start = true;
                         buffer.append(c);
                 }

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/ManifestHeaderTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/ManifestHeaderTest.java?rev=1520874&r1=1520873&r2=1520874&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/ManifestHeaderTest.java 
(original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/ManifestHeaderTest.java 
Sun Sep  8 14:48:35 2013
@@ -112,4 +112,9 @@ public class ManifestHeaderTest extends 
             ManifestHeaderValue.writeParseException(System.out, value, e);
         }
     }
+
+    public void testSpaceInValue() throws Exception {
+        ManifestHeaderValue value = new ManifestHeaderValue("glassfish 
javax.servlet.3.1.0.b33");
+        assertEquals("glassfish javax.servlet.3.1.0.b33", 
value.getSingleValue());
+    }
 }


Reply via email to