FELIX-4035 : Issue warning messages when metatype is be created, but no properties are defined

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1475689 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/changelog.txt b/scrplugin/generator/changelog.txt
index 9f0f51d..f7d4fcb 100644
--- a/scrplugin/generator/changelog.txt
+++ b/scrplugin/generator/changelog.txt
@@ -1,7 +1,8 @@
 Changes from 1.6.0 to 1.5.0
 ---------------------------
 ** Improvement
-    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations
+    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations and an error for declaring the service.id property
+    * [FELIX-4035] - Issue warning messages when metatype is be created, but no properties are defined
 ** Bug
     * [FELIX-4030] - Generated metatype file contains all metatype infos
     * [FELIX-3542] - Escape property values used as Metatype default values
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
index 529e280..79409e5 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
@@ -183,6 +183,13 @@
                 }
             }
 
+            // additional check for metatype (FELIX-4035)
+            if ( this.container.getMetatypeContainer() != null ) {
+                if ( this.container.getProperties().size() == 0.) {
+                    this.logWarn(component, "Component is defined to generate metatype information, however no properties have been " +
+                        "defined; in case no properties are wanted, consider to use 'metatype=false'");
+                }
+            }
             if (iLog.getNumberOfErrors() == currentIssueCount) {
                 // verify references
                 for (final ReferenceDescription ref : this.container.getReferences().values()) {
diff --git a/scrplugin/maven-scr-plugin/changelog.txt b/scrplugin/maven-scr-plugin/changelog.txt
index 95cc068..8bcb540 100644
--- a/scrplugin/maven-scr-plugin/changelog.txt
+++ b/scrplugin/maven-scr-plugin/changelog.txt
@@ -1,7 +1,8 @@
 Changes from 1.12.0 to 1.11.0
 -----------------------------
 ** Improvement
-    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations
+    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations and an error for declaring the service.id property
+    * [FELIX-4035] - Issue warning messages when metatype is be created, but no properties are defined
 ** Bug
     * [FELIX-4030] - Generated metatype file contains all metatype infos
     * [FELIX-4023] - SCR-Plugin not working reliably in m2e 1.3.1 
diff --git a/scrplugin/scrtask/changelog.txt b/scrplugin/scrtask/changelog.txt
index 696035f..d6dd020 100644
--- a/scrplugin/scrtask/changelog.txt
+++ b/scrplugin/scrtask/changelog.txt
@@ -1,7 +1,8 @@
 Changes from 1.6.0 to 1.5.0
 ---------------------------
 ** Improvement
-    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations
+    * [FELIX-4033] - Issue warning messages for redundant SCR annotation combinations and an error for declaring the service.id property
+    * [FELIX-4035] - Issue warning messages when metatype is be created, but no properties are defined
 ** Bug
     * [FELIX-4030] - Generated metatype file contains all metatype infos
     * [FELIX-3542] - Escape property values used as Metatype default values