felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r396876 - in /incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository: RepositoryImpl.java RequirementImpl.java
Date Tue, 25 Apr 2006 13:14:38 GMT
Author: rickhall
Date: Tue Apr 25 06:14:38 2006
New Revision: 396876

URL: http://svn.apache.org/viewcvs?rev=396876&view=rev
Log:
The repository impl now ignores extra metadata in the XML file. Also fixed
a bug in the requirement impl that could lead to a NPE when comparing
requirements with null comments.

Modified:
    incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
    incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java

Modified: incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java?rev=396876&r1=396875&r2=396876&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
(original)
+++ incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
Tue Apr 25 06:14:38 2006
@@ -108,6 +108,16 @@
         }
     }
 
+    /**
+     * Default setter method when setting parsed data from the XML file,
+     * which currently ignores everything. 
+    **/
+    protected Object put(Object key, Object value)
+    {
+        // Ignore everything for now.
+        return null;
+    }
+
     private void parseRepositoryFile(int hopCount)
     {
 // TODO: OBR - Implement hop count.
@@ -145,13 +155,17 @@
                     }
                 };
 
+                // Get default setter method for Repository.
+                Method repoSetter = RepositoryImpl.class.getDeclaredMethod(
+                    "put", new Class[] { Object.class, Object.class });
+
                 // Get default setter method for Resource.
-                Method resourceSetter = ResourceImpl.class.getDeclaredMethod(
+                Method resSetter = ResourceImpl.class.getDeclaredMethod(
                     "put", new Class[] { Object.class, Object.class });
 
                 // Map XML tags to types.
-                handler.addType("repository", factory, Repository.class, null);
-                handler.addType("resource", ResourceImpl.class, Resource.class, resourceSetter);
+                handler.addType("repository", factory, Repository.class, repoSetter);
+                handler.addType("resource", ResourceImpl.class, Resource.class, resSetter);
                 handler.addType("category", CategoryImpl.class, null, null);
                 handler.addType("require", RequirementImpl.class, Requirement.class, null);
                 handler.addType("capability", CapabilityImpl.class, Capability.class, null);

Modified: incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java?rev=396876&r1=396875&r2=396876&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
(original)
+++ incubator/felix/trunk/org.apache.felix.bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
Tue Apr 25 06:14:38 2006
@@ -118,7 +118,8 @@
                 (m_optional == r.isOptional()) &&
                 (m_multiple == r.isMultiple()) &&
                 m_filter.toString().equals(r.getFilter()) &&
-                m_comment.equals(r.getComment());
+                ((m_comment == r.getComment()) ||
+                    ((m_comment != null) && (m_comment.equals(r.getComment()))));
         }
         return false;
     }



Mime
View raw message