felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1033171 - in /felix/trunk/ipojo/core/src: main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java
Date Tue, 09 Nov 2010 19:30:12 GMT
Author: clement
Date: Tue Nov  9 19:30:12 2010
New Revision: 1033171

URL: http://svn.apache.org/viewvc?rev=1033171&view=rev
Log:
Second attempt to fix FELIX-2685 Wrong Element name when XML namespace contains ':'

Modified:
    felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java

Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java?rev=1033171&r1=1033170&r2=1033171&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
(original)
+++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManifestMetadataParser.java
Tue Nov  9 19:30:12 2010
@@ -544,9 +544,9 @@ public class ManifestMetadataParser {
                     	elem = new Element(n, null);
                     } else {
                     	// The namespace ends on the first ':'
-                    	int index = n.indexOf(':');
-                    	String ns = n.substring(0, index);
-                    	String name = n.substring(index + 1);
+                    	int last = n.lastIndexOf(':');
+                    	String ns = n.substring(0, last);
+                    	String name = n.substring(last + 1);
                     	elem = new Element(name.toString(), ns.toString());
                     }
 

Modified: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java?rev=1033171&r1=1033170&r2=1033171&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java
(original)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/util/ManifestMetadataParserTest.java
Tue Nov  9 19:30:12 2010
@@ -38,11 +38,11 @@ public class ManifestMetadataParserTest 
 	 */
 	public void testNameWithColumn() throws ParseException {
 		// Create a test element
-		String header = "mynamespace://jasmine.ow2.org/rules/1.0.0:configuration {}";
+		String header = "http://jasmine.ow2.org/rules/1.0.0:configuration {}";
 		Element elem = ManifestMetadataParser.parse(header);
 
-		Assert.assertEquals("mynamespace", elem.getNameSpace());
-		Assert.assertEquals("//jasmine.ow2.org/rules/1.0.0:configuration", elem.getName());
+		Assert.assertEquals("http://jasmine.ow2.org/rules/1.0.0", elem.getNameSpace());
+		Assert.assertEquals("configuration", elem.getName());
 	}
 
 	/**



Mime
View raw message