FELIX-2475 : Metatype information should not be generated for abstract components
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@963960 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
index b8f7b52..daab888 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
@@ -20,33 +20,12 @@
import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-import org.apache.felix.scrplugin.helper.IssueLog;
-import org.apache.felix.scrplugin.helper.PropertyHandler;
-import org.apache.felix.scrplugin.helper.StringUtils;
-import org.apache.felix.scrplugin.om.Component;
-import org.apache.felix.scrplugin.om.Components;
-import org.apache.felix.scrplugin.om.Implementation;
-import org.apache.felix.scrplugin.om.Interface;
-import org.apache.felix.scrplugin.om.Property;
-import org.apache.felix.scrplugin.om.Reference;
-import org.apache.felix.scrplugin.om.Service;
-import org.apache.felix.scrplugin.om.metatype.Designate;
-import org.apache.felix.scrplugin.om.metatype.MTObject;
-import org.apache.felix.scrplugin.om.metatype.MetaData;
-import org.apache.felix.scrplugin.om.metatype.OCD;
-import org.apache.felix.scrplugin.tags.JavaClassDescription;
-import org.apache.felix.scrplugin.tags.JavaClassDescriptionInheritanceComparator;
-import org.apache.felix.scrplugin.tags.JavaField;
-import org.apache.felix.scrplugin.tags.JavaTag;
-import org.apache.felix.scrplugin.tags.ModifiableJavaClassDescription;
+import org.apache.felix.scrplugin.helper.*;
+import org.apache.felix.scrplugin.om.*;
+import org.apache.felix.scrplugin.om.metatype.*;
+import org.apache.felix.scrplugin.tags.*;
import org.apache.felix.scrplugin.tags.qdox.QDoxJavaClassDescription;
import org.apache.felix.scrplugin.xml.ComponentDescriptorIO;
import org.apache.felix.scrplugin.xml.MetaTypeIO;
@@ -637,7 +616,7 @@
final String metaType = tag.getNamedParameter( Constants.COMPONENT_METATYPE );
final boolean hasMetaType = metaType == null || "yes".equalsIgnoreCase( metaType )
|| "true".equalsIgnoreCase( metaType );
- if ( hasMetaType )
+ if ( !component.isAbstract() && hasMetaType )
{
// ocd
final OCD ocd = new OCD();
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
index 0ccf33b..f8f0be7 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
@@ -24,9 +24,7 @@
import org.apache.felix.scrplugin.Constants;
import org.apache.felix.scrplugin.SCRDescriptorException;
import org.apache.felix.scrplugin.helper.IssueLog;
-import org.apache.felix.scrplugin.tags.JavaClassDescription;
-import org.apache.felix.scrplugin.tags.JavaMethod;
-import org.apache.felix.scrplugin.tags.JavaTag;
+import org.apache.felix.scrplugin.tags.*;
/**
* <code>Component</code>
@@ -487,4 +485,24 @@
public void setConfigurationPolicy(final String value) {
this.configurationPolicy = value;
}
-}
+
+ @Override
+ public String toString() {
+ return "Component " + this.name + " (" +
+ "enabled=" + (enabled==null?"<notset>":enabled) +
+ ", immediate=" + (immediate == null?"<notset>":immediate) +
+ ", abstract=" + isAbstract +
+ ", isDS=" + isDs +
+ (factory != null ? ", factory="+factory:"")+
+ (configurationPolicy != null ? ", configurationPolicy=" + configurationPolicy : "") +
+ (activate != null ? ", activate=" + activate : "") +
+ (deactivate != null ? ", deactivate=" + deactivate : "") +
+ (modified != null ? ", modified=" + modified : "") +
+ ", specVersion=" + specVersion +
+ ", implementation=" + implementation +
+ ", service=" + service +
+ ", properties=" + properties +
+ ", references=" + references +
+ ")";
+ }
+}
\ No newline at end of file