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 2016/09/25 21:24:11 UTC

[23/50] [abbrv] incubator-tamaya-sandbox git commit: TAMAYA-113: Remove Java 8 related parts - added JDK8 flags where necessary, fixed some tests/examples using Java8 APIs, checked built.

TAMAYA-113: Remove Java 8 related parts - added JDK8 flags where necessary, fixed some tests/examples using Java8 APIs, checked built.


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

Branch: refs/heads/master
Commit: 89e97b1192db3fba58d227faab1fa61ac6e7deca
Parents: 24bb6c6
Author: anatole <an...@apache.org>
Authored: Tue Sep 29 09:00:46 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Sep 29 09:00:46 2015 +0200

----------------------------------------------------------------------
 pom.xml                                                     | 4 ++++
 .../tamaya/builder/ProgrammaticConfigurationContext.java    | 9 ++++-----
 .../java/org/apache/tamaya/builder/TestPropertySource.java  | 4 ++--
 .../apache/tamaya/builder/TestPropertySourceProvider.java   | 5 +++--
 .../apache/tamaya/builder/TestPropertySourceProviderB.java  | 5 +++--
 5 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/89e97b11/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5912c2c..a078f79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,10 @@ under the License.
 
     <inceptionYear>2015</inceptionYear>
 
+    <properties>
+        <jdkVersion>1.8</jdkVersion>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/89e97b11/src/main/java/org/apache/tamaya/builder/ProgrammaticConfigurationContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/tamaya/builder/ProgrammaticConfigurationContext.java b/src/main/java/org/apache/tamaya/builder/ProgrammaticConfigurationContext.java
index d867c3e..b333986 100644
--- a/src/main/java/org/apache/tamaya/builder/ProgrammaticConfigurationContext.java
+++ b/src/main/java/org/apache/tamaya/builder/ProgrammaticConfigurationContext.java
@@ -28,7 +28,7 @@ import org.apache.tamaya.spi.PropertyFilter;
 import org.apache.tamaya.spi.PropertySource;
 import org.apache.tamaya.spi.PropertySourceProvider;
 import org.apache.tamaya.spi.PropertyValueCombinationPolicy;
-import org.apache.tamaya.spi.ServiceContext;
+import org.apache.tamaya.spi.ServiceContextManager;
 
 import javax.annotation.Priority;
 import java.util.ArrayList;
@@ -128,7 +128,7 @@ class ProgrammaticConfigurationContext implements ConfigurationContext {
 
     private List<PropertyFilter> getPropertyFilters(Builder builder) {
         List<PropertyFilter> provided = builder.loadProvidedPropertyFilters
-                ? ServiceContext.getInstance().getServices(PropertyFilter.class)
+                ? ServiceContextManager.getServiceContext().getServices(PropertyFilter.class)
                 : new ArrayList<>(0);
 
         List<PropertyFilter> configured = builder.propertyFilters;
@@ -139,11 +139,11 @@ class ProgrammaticConfigurationContext implements ConfigurationContext {
 
     private List<PropertySource> getAllPropertySources(Builder builder) {
         List<PropertySource> provided = builder.loadProvidedPropertySources
-                ? ServiceContext.getInstance().getServices(PropertySource.class)
+                ? ServiceContextManager.getServiceContext().getServices(PropertySource.class)
                 : new ArrayList<>(0);
 
         if (builder.loadProvidedPropertySourceProviders) {
-            List<PropertySourceProvider> providers = ServiceContext.getInstance()
+            List<PropertySourceProvider> providers = ServiceContextManager.getServiceContext()
                                                                   .getServices(PropertySourceProvider.class);
             for (PropertySourceProvider provider : providers) {
                 Collection<PropertySource> sources = provider.getPropertySources();
@@ -260,7 +260,6 @@ class ProgrammaticConfigurationContext implements ConfigurationContext {
         throw new RuntimeException("This method is currently not supported.");
     }
 
-    @Override
     public Collection<PropertySource> getPropertySources(Predicate<PropertySource> selector) {
         // @todo Check if it could be useful to support this method, Oliver B. Fischer
         throw new RuntimeException("This method is currently not supported.");

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/89e97b11/src/test/java/org/apache/tamaya/builder/TestPropertySource.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/tamaya/builder/TestPropertySource.java b/src/test/java/org/apache/tamaya/builder/TestPropertySource.java
index 54deca3..e30c244 100644
--- a/src/test/java/org/apache/tamaya/builder/TestPropertySource.java
+++ b/src/test/java/org/apache/tamaya/builder/TestPropertySource.java
@@ -18,14 +18,14 @@
  */
 package org.apache.tamaya.builder;
 
+import org.apache.tamaya.core.propertysource.BasePropertySource;
 import org.apache.tamaya.spi.PropertySource;
 
 import java.util.Collections;
 import java.util.Hashtable;
 import java.util.Map;
 
-public class TestPropertySource
-    implements PropertySource
+public class TestPropertySource  extends BasePropertySource
 {
     private Map<String, String> properties;
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/89e97b11/src/test/java/org/apache/tamaya/builder/TestPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/tamaya/builder/TestPropertySourceProvider.java b/src/test/java/org/apache/tamaya/builder/TestPropertySourceProvider.java
index 4e7db79..0dcd68c 100644
--- a/src/test/java/org/apache/tamaya/builder/TestPropertySourceProvider.java
+++ b/src/test/java/org/apache/tamaya/builder/TestPropertySourceProvider.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tamaya.builder;
 
+import org.apache.tamaya.core.propertysource.BasePropertySource;
 import org.apache.tamaya.spi.PropertySource;
 import org.apache.tamaya.spi.PropertySourceProvider;
 
@@ -39,7 +40,7 @@ public class TestPropertySourceProvider
         return sources;
     }
 
-    private class YProvidingPropertySource implements PropertySource {
+    private class YProvidingPropertySource extends BasePropertySource {
         private Map<String, String> props = Collections.singletonMap("tpsp_x", "X");
 
         @Override
@@ -63,7 +64,7 @@ public class TestPropertySourceProvider
         }
     }
 
-    private class XProvidingPropertySource implements PropertySource {
+    private class XProvidingPropertySource  extends BasePropertySource {
         private Map<String, String> props = Collections.singletonMap("tpsp_y", "Y");
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/89e97b11/src/test/java/org/apache/tamaya/builder/TestPropertySourceProviderB.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/tamaya/builder/TestPropertySourceProviderB.java b/src/test/java/org/apache/tamaya/builder/TestPropertySourceProviderB.java
index ddfb132..e06c75c 100644
--- a/src/test/java/org/apache/tamaya/builder/TestPropertySourceProviderB.java
+++ b/src/test/java/org/apache/tamaya/builder/TestPropertySourceProviderB.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tamaya.builder;
 
+import org.apache.tamaya.core.propertysource.BasePropertySource;
 import org.apache.tamaya.spi.PropertySource;
 import org.apache.tamaya.spi.PropertySourceProvider;
 
@@ -39,7 +40,7 @@ public class TestPropertySourceProviderB
         return sources;
     }
 
-    private class BProvidingPropertySource implements PropertySource {
+    private class BProvidingPropertySource extends BasePropertySource {
         private Map<String, String> props = Collections.singletonMap("tpsp_b", "B");
 
         @Override
@@ -63,7 +64,7 @@ public class TestPropertySourceProviderB
         }
     }
 
-    private class AProvidingPropertySource implements PropertySource {
+    private class AProvidingPropertySource extends BasePropertySource {
         private Map<String, String> props = Collections.singletonMap("tpsp_a", "A");
 
         @Override