felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r601539 - /felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
Date Wed, 05 Dec 2007 21:37:08 GMT
Author: fmeschbe
Date: Wed Dec  5 13:36:57 2007
New Revision: 601539

URL: http://svn.apache.org/viewvc?rev=601539&view=rev
Log:
FELIX-430 Default inherit attribute to true
          Default abstract attribute to true for abstract classes
              and false for concrete classes
FELIX-429 Generate bind/unbind methods on the class which defines
          reference, even if the component is abstract

Modified:
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java?rev=601539&r1=601538&r2=601539&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
Wed Dec  5 13:36:57 2007
@@ -239,7 +239,7 @@
 
         final OCD ocd = this.doComponent(componentTag, component, metaData);
 
-        boolean inherited = this.getBoolean(componentTag, Constants.COMPONENT_INHERIT, false);
+        boolean inherited = this.getBoolean(componentTag, Constants.COMPONENT_INHERIT, true);
         this.doServices(description.getTagsByName(Constants.SERVICE, inherited), component,
description);
 
         // collect properties and references from class tags and fields
@@ -349,7 +349,12 @@
 
         // check if this is an abstract definition
         final String abstractType = tag.getNamedParameter(Constants.COMPONENT_ABSTRACT);
-        component.setAbstract((abstractType == null ? false : "yes".equalsIgnoreCase(abstractType)
|| "true".equalsIgnoreCase(abstractType)));
+        if (abstractType != null) {
+            component.setAbstract("yes".equalsIgnoreCase(abstractType) || "true".equalsIgnoreCase(abstractType));
+        } else {
+            // default true for abstract classes, false otherwise
+            component.setAbstract(tag.getJavaClassDescription().isAbstract());
+        }
 
         // check if this is a definition to ignore
         final String ds = tag.getNamedParameter(Constants.COMPONENT_DS);
@@ -633,8 +638,8 @@
         }
         // if this is a field with a single cardinality,
         // we look for the bind/unbind methods
-        // and create them if they are not availabe and the component is not abstract
-        if ( !component.isAbstract() && this.generateAccessors ) {
+        // and create them if they are not availabe
+        if ( this.generateAccessors ) {
             if ( reference.getField() != null && component.getJavaClassDescription()
instanceof ModifiableJavaClassDescription ) {
                 if ( ref.getCardinality().equals("0..1") || ref.getCardinality().equals("1..1")
) {
                     boolean createBind = false;



Mime
View raw message