You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2010/05/06 09:23:56 UTC

svn commit: r941594 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java

Author: fmeschbe
Date: Thu May  6 07:23:56 2010
New Revision: 941594

URL: http://svn.apache.org/viewvc?rev=941594&view=rev
Log:
FELIX-2325 Return the implementation class name from the getName method if the component name has not been explicitly set with the name attribute.

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java?rev=941594&r1=941593&r2=941594&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java Thu May  6 07:23:56 2010
@@ -381,7 +381,19 @@ public class ComponentMetadata
      */
     public String getName()
     {
-        return m_name;
+        // FELIX-2325: Be lenient here and return the name if set or
+        // the implementation class name. This allows for the
+        // BundleComponentActivator.loadComponents method to access the
+        // name before validating the component, which then makes sure
+        // that the name may only be unset for DS 1.1 and newer components
+
+        if ( m_name != null )
+        {
+            return m_name;
+        }
+
+        // return the implementation class name if the name is not set
+        return getImplementationClassName();
     }