You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2015/04/26 00:03:03 UTC

[1/2] incubator-tamaya git commit: Added the class converter to its service configuration.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master aa4ee5059 -> fd00b28aa


Added the class converter to its service configuration.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/c4af7892
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/c4af7892
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/c4af7892

Branch: refs/heads/master
Commit: c4af7892649e3ab15102da1e609e60ef3df81eb8
Parents: aa4ee50
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Sat Apr 25 23:26:29 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Sat Apr 25 23:26:29 2015 +0200

----------------------------------------------------------------------
 .../META-INF/services/org.apache.tamaya.spi.PropertyConverter       | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4af7892/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
----------------------------------------------------------------------
diff --git a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter b/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
index f64b42b..fff680a 100644
--- a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
+++ b/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
@@ -19,6 +19,7 @@
 org.apache.tamaya.core.internal.converters.BooleanConverter
 org.apache.tamaya.core.internal.converters.ByteConverter
 org.apache.tamaya.core.internal.converters.CharConverter
+org.apache.tamaya.core.internal.converters.ClassConverter
 org.apache.tamaya.core.internal.converters.DoubleConverter
 org.apache.tamaya.core.internal.converters.FloatConverter
 org.apache.tamaya.core.internal.converters.IntegerConverter


[2/2] incubator-tamaya git commit: Added a jQAssistant rule to detect not properly configured service providers.

Posted by pl...@apache.org.
Added a jQAssistant rule to detect not properly configured service providers.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/fd00b28a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/fd00b28a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/fd00b28a

Branch: refs/heads/master
Commit: fd00b28aa815c74e25e2f731c0c20afcfb87a19d
Parents: c4af789
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Sun Apr 26 00:02:09 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Sun Apr 26 00:02:09 2015 +0200

----------------------------------------------------------------------
 jqassistant/default.xml             |  1 +
 jqassistant/serviceloader-rules.xml | 42 +++++++++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/fd00b28a/jqassistant/default.xml
----------------------------------------------------------------------
diff --git a/jqassistant/default.xml b/jqassistant/default.xml
index 222a685..f35def2 100644
--- a/jqassistant/default.xml
+++ b/jqassistant/default.xml
@@ -56,5 +56,6 @@ under the License.
         <includeConstraint refId="naming:namingOfPropertyConverters"/>
         <includeConstraint refId="naming:namingOfPropertyFilters"/>
         <includeConstraint refId="serviceLoader:correctServiceLoaderNaming"/>
+        <includeConstraint refId="serviceLoader:ServiceImplementationsMustBeListedInServiceConfigurations"/>
     </group>
 </jqa:jqassistant-rules>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/fd00b28a/jqassistant/serviceloader-rules.xml
----------------------------------------------------------------------
diff --git a/jqassistant/serviceloader-rules.xml b/jqassistant/serviceloader-rules.xml
index 808b7b2..346ebb8 100644
--- a/jqassistant/serviceloader-rules.xml
+++ b/jqassistant/serviceloader-rules.xml
@@ -50,4 +50,44 @@ under the License.
         ]]></cypher>
 	</constraint>
 
-</jqa:jqassistant-rules>
\ No newline at end of file
+	<constraint id="serviceLoader:ServiceImplementationsMustBeListedInServiceConfigurations"
+				severity="info">
+		<requiresConcept refId="java:AnonymousInnerType"/>
+		<requiresConcept refId="serviceLoader:SPI"/>
+		<description>All property converter implementations must be declared in a service loader file.</description>
+        <cypher><![CDATA[
+            MATCH
+				(impl)-[:IMPLEMENTS*]->(spi:SPI)
+
+			WHERE
+                NOT (:ServiceLoader)-[:CONTAINS]->(impl)
+                AND NOT impl:Anonymous:Inner
+                AND (impl.abstract=false OR impl.abstract IS NULL)
+
+                // Ignore SPI implementations without a default constructor
+                // We assume that the developer of this class had to implement for some reason
+                // this interface but not intended it to be used as service provider
+                AND NOT (impl)-[:DECLARES]->(:Constructor)-[:HAS]->(:Parameter)
+
+                // Do not pay attention to test utilities. We rely on the name of the class
+                AND NOT (impl.name =~ 'Test.*' OR impl.name =~ '.*\\$Test.*'
+                         OR impl.name =~'.*Test\\$.*')
+
+                AND NOT impl.fqn IN [// All classes of the builder MUST not use the SPI mechanism
+                                     'org.apache.tamaya.builder.ProgrammaticConfigurationContext',
+                                     // See TAMAYA-77 and TAMAYA-78, Oliver B. Fischer, 2015-04-25
+                                     'org.apache.tamaya.core.internal.DefaultConfigurationContextBuilder'
+                                    ]
+
+                RETURN
+                    impl.fqn AS undeclaredService
+        ]]></cypher>
+	</constraint>
+
+	<!-- @todo
+      Constraints to be defined
+      - Empty service configurations
+
+      -->
+
+</jqa:jqassistant-rules>