felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r919180 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
Date Thu, 04 Mar 2010 20:58:08 GMT
Author: gnodet
Date: Thu Mar  4 20:58:08 2010
New Revision: 919180

URL: http://svn.apache.org/viewvc?rev=919180&view=rev
Log:
[bundlerepository] fix stax parser which does not read additional resource properties (license,
copyright, size, etc...)

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java?rev=919180&r1=919179&r2=919180&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
Thu Mar  4 20:58:08 2010
@@ -187,7 +187,26 @@
                 }
                 else
                 {
-                    ignoreTag(reader);
+                    StringBuffer sb = null;
+                    while ((event = reader.next()) != XMLStreamConstants.END_ELEMENT)
+                    {
+                        switch (event)
+                        {
+                            case XMLStreamConstants.START_ELEMENT:
+                                throw new Exception("Unexpected element inside <require/>
element");
+                            case XMLStreamConstants.CHARACTERS:
+                                if (sb == null)
+                                {
+                                    sb = new StringBuffer();
+                                }
+                                sb.append(reader.getText());
+                                break;
+                        }
+                    }
+                    if (sb != null)
+                    {
+                        resource.put(element, sb.toString().trim());
+                    }
                 }
             }
             // Sanity check



Mime
View raw message