tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [1/3] incubator-tamaya git commit: Moved examples to Java 7 as well, to simplify build.
Date Tue, 03 Nov 2015 00:38:09 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 1af37f888 -> 26cc6b23a


Moved examples to Java 7 as well, to simplify build.


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

Branch: refs/heads/master
Commit: 74b5a8e05a49f7528ba7c79b875986b2a23b623d
Parents: 1af37f8
Author: anatole <anatole@apache.org>
Authored: Tue Nov 3 01:21:05 2015 +0100
Committer: anatole <anatole@apache.org>
Committed: Tue Nov 3 01:21:05 2015 +0100

----------------------------------------------------------------------
 examples/2-simple-propertysource-example/pom.xml        |  4 ----
 .../org/apache/tamaya/examples/simple/ExampleMain.java  |  4 +++-
 .../tamaya/examples/simple/SimplePropertySource.java    |  4 +++-
 examples/3-resources-example/pom.xml                    |  4 ----
 .../apache/tamaya/examples/resources/ExampleMain.java   |  4 +++-
 examples/4-resolver-example/pom.xml                     |  4 ----
 .../apache/tamaya/examples/resolver/ExampleMain.java    |  4 +++-
 examples/5-injection-example/pom.xml                    |  4 ----
 examples/6-fileobserver-example/pom.xml                 |  4 ----
 .../tamaya/examples/fileobserver/TestConfigView.java    |  4 ++--
 examples/7-builder-example/pom.xml                      |  4 ----
 examples/8-remote-example/client/pom.xml                |  4 ----
 examples/8-remote-example/server/pom.xml                |  4 ----
 .../examples/remote/server/ClientScopeProvider.java     | 12 +++++++++---
 14 files changed, 23 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/2-simple-propertysource-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/2-simple-propertysource-example/pom.xml b/examples/2-simple-propertysource-example/pom.xml
index 90562a2..d139869 100644
--- a/examples/2-simple-propertysource-example/pom.xml
+++ b/examples/2-simple-propertysource-example/pom.xml
@@ -30,10 +30,6 @@ under the License.
     <description>This project contains a simple example based on the core functionality
only.</description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/ExampleMain.java
----------------------------------------------------------------------
diff --git a/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/ExampleMain.java
b/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/ExampleMain.java
index b9da92f..76b38bb 100644
--- a/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/ExampleMain.java
+++ b/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/ExampleMain.java
@@ -55,7 +55,9 @@ public class ExampleMain {
 
     private static String dump(Map<String, String> properties) {
         StringBuilder b = new StringBuilder();
-        new TreeMap<>(properties).forEach((k,v)->b.append("  " + k + " = " + v +
'\n'));
+        for(Map.Entry<String,String> en: new TreeMap<>(properties).entrySet()){
+            b.append("  " + en.getKey() + " = " + en.getValue() + '\n');
+        }
         return b.toString();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/SimplePropertySource.java
----------------------------------------------------------------------
diff --git a/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/SimplePropertySource.java
b/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/SimplePropertySource.java
index 60e033d..72bfc98 100644
--- a/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/SimplePropertySource.java
+++ b/examples/2-simple-propertysource-example/src/main/java/org/apache/tamaya/examples/simple/SimplePropertySource.java
@@ -42,7 +42,9 @@ public class SimplePropertySource extends BasePropertySource{
             properties.load(is);
         }
         finally{
-            properties.forEach((k,v) -> props.put(k.toString(), v.toString()));
+            for(Map.Entry en: properties.entrySet()){
+                props.put(en.getKey().toString(), en.getValue().toString());
+            }
             props = Collections.unmodifiableMap(props);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/3-resources-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/3-resources-example/pom.xml b/examples/3-resources-example/pom.xml
index c58cc61..80625a1 100644
--- a/examples/3-resources-example/pom.xml
+++ b/examples/3-resources-example/pom.xml
@@ -31,10 +31,6 @@ under the License.
     <description>This project contains a simple example using the resource location
module.</description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/3-resources-example/src/main/java/org/apache/tamaya/examples/resources/ExampleMain.java
----------------------------------------------------------------------
diff --git a/examples/3-resources-example/src/main/java/org/apache/tamaya/examples/resources/ExampleMain.java
b/examples/3-resources-example/src/main/java/org/apache/tamaya/examples/resources/ExampleMain.java
index d43358a..ac2e44e 100644
--- a/examples/3-resources-example/src/main/java/org/apache/tamaya/examples/resources/ExampleMain.java
+++ b/examples/3-resources-example/src/main/java/org/apache/tamaya/examples/resources/ExampleMain.java
@@ -55,7 +55,9 @@ public class ExampleMain {
 
     private static String dump(Map<String, String> properties) {
         StringBuilder b = new StringBuilder();
-        new TreeMap<>(properties).forEach((k,v)->b.append("  " + k + " = " + v +
'\n'));
+        for(Map.Entry en: new TreeMap<>(properties).entrySet()){
+            b.append("  " + en.getKey() + " = " + en.getValue() + '\n');
+        }
         return b.toString();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/4-resolver-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/4-resolver-example/pom.xml b/examples/4-resolver-example/pom.xml
index 7113479..e724219 100644
--- a/examples/4-resolver-example/pom.xml
+++ b/examples/4-resolver-example/pom.xml
@@ -30,10 +30,6 @@ under the License.
     <description>This project contains a simple example using the resolver module.</description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/4-resolver-example/src/main/java/org/apache/tamaya/examples/resolver/ExampleMain.java
----------------------------------------------------------------------
diff --git a/examples/4-resolver-example/src/main/java/org/apache/tamaya/examples/resolver/ExampleMain.java
b/examples/4-resolver-example/src/main/java/org/apache/tamaya/examples/resolver/ExampleMain.java
index ae32f56..67d5e53 100644
--- a/examples/4-resolver-example/src/main/java/org/apache/tamaya/examples/resolver/ExampleMain.java
+++ b/examples/4-resolver-example/src/main/java/org/apache/tamaya/examples/resolver/ExampleMain.java
@@ -55,7 +55,9 @@ public class ExampleMain {
 
     private static String dump(Map<String, String> properties) {
         StringBuilder b = new StringBuilder();
-        new TreeMap<>(properties).forEach((k, v) -> b.append("  " + k + " = " +
v + '\n'));
+        for(Map.Entry en: new TreeMap<>(properties).entrySet()){
+            b.append("  " + en.getKey() + " = " + en.getValue() + '\n');
+        }
         return b.toString();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/5-injection-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/5-injection-example/pom.xml b/examples/5-injection-example/pom.xml
index 47bbd8f..94df7f5 100644
--- a/examples/5-injection-example/pom.xml
+++ b/examples/5-injection-example/pom.xml
@@ -31,10 +31,6 @@ under the License.
     <description>This project contains a simple illustrating how configuration values
can be injected.</description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/6-fileobserver-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/6-fileobserver-example/pom.xml b/examples/6-fileobserver-example/pom.xml
index db6f23b..09c0bad 100644
--- a/examples/6-fileobserver-example/pom.xml
+++ b/examples/6-fileobserver-example/pom.xml
@@ -32,10 +32,6 @@ under the License.
     </description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/6-fileobserver-example/src/test/java/org/aspache/tamaya/examples/fileobserver/TestConfigView.java
----------------------------------------------------------------------
diff --git a/examples/6-fileobserver-example/src/test/java/org/aspache/tamaya/examples/fileobserver/TestConfigView.java
b/examples/6-fileobserver-example/src/test/java/org/aspache/tamaya/examples/fileobserver/TestConfigView.java
index 42dcf4f..75752cf 100644
--- a/examples/6-fileobserver-example/src/test/java/org/aspache/tamaya/examples/fileobserver/TestConfigView.java
+++ b/examples/6-fileobserver-example/src/test/java/org/aspache/tamaya/examples/fileobserver/TestConfigView.java
@@ -47,7 +47,7 @@ public class TestConfigView implements ConfigOperator{
     }
 
     @Override
-    public Configuration operate(Configuration config) {
+    public Configuration operate(final Configuration config) {
         return new Configuration() {
             @Override
             public Map<String, String> getProperties() {
@@ -95,7 +95,7 @@ public class TestConfigView implements ConfigOperator{
 
             @Override
             public <T> T get(String key, Class<T> type) {
-                return get(key, TypeLiteral.of(type));
+                return (T)get(key, TypeLiteral.of(type));
             }
 
             /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/7-builder-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/7-builder-example/pom.xml b/examples/7-builder-example/pom.xml
index 8764808..ca2d58a 100644
--- a/examples/7-builder-example/pom.xml
+++ b/examples/7-builder-example/pom.xml
@@ -31,10 +31,6 @@ under the License.
     </description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/8-remote-example/client/pom.xml
----------------------------------------------------------------------
diff --git a/examples/8-remote-example/client/pom.xml b/examples/8-remote-example/client/pom.xml
index 7ce573c..3d19c73 100644
--- a/examples/8-remote-example/client/pom.xml
+++ b/examples/8-remote-example/client/pom.xml
@@ -31,10 +31,6 @@ under the License.
     </description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/8-remote-example/server/pom.xml
----------------------------------------------------------------------
diff --git a/examples/8-remote-example/server/pom.xml b/examples/8-remote-example/server/pom.xml
index 83be273..8540a33 100644
--- a/examples/8-remote-example/server/pom.xml
+++ b/examples/8-remote-example/server/pom.xml
@@ -31,10 +31,6 @@ under the License.
     </description>
     <packaging>jar</packaging>
 
-    <properties>
-        <jdkVersion>1.8</jdkVersion>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/74b5a8e0/examples/8-remote-example/server/src/main/java/org/apache/tamaya/examples/remote/server/ClientScopeProvider.java
----------------------------------------------------------------------
diff --git a/examples/8-remote-example/server/src/main/java/org/apache/tamaya/examples/remote/server/ClientScopeProvider.java
b/examples/8-remote-example/server/src/main/java/org/apache/tamaya/examples/remote/server/ClientScopeProvider.java
index 16f3e7c..12dc82d 100644
--- a/examples/8-remote-example/server/src/main/java/org/apache/tamaya/examples/remote/server/ClientScopeProvider.java
+++ b/examples/8-remote-example/server/src/main/java/org/apache/tamaya/examples/remote/server/ClientScopeProvider.java
@@ -19,6 +19,7 @@
 package org.apache.tamaya.examples.remote.server;
 
 import org.apache.tamaya.ConfigOperator;
+import org.apache.tamaya.Configuration;
 import org.apache.tamaya.functions.ConfigurationFunctions;
 import org.apache.tamaya.server.spi.ScopeProvider;
 
@@ -39,11 +40,16 @@ public class ClientScopeProvider implements ScopeProvider{
     }
 
     @Override
-    public ConfigOperator getScope(String scopeId) {
-        return c ->
-                ConfigurationFunctions.combine("Scoped Config CLIENT="+scopeId,
+    public ConfigOperator getScope(final String scopeId) {
+        return new ConfigOperator() {
+            @Override
+            public Configuration operate(Configuration c) {
+                return ConfigurationFunctions.combine("Scoped Config CLIENT="+scopeId,
                         c.with(ConfigurationFunctions.sectionRecursive(true, "client.default")),
                         c.with(ConfigurationFunctions.sectionRecursive(true, "client." +
scopeId))
                 );
+            }
+        };
+
     }
 }


Mime
View raw message