tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [05/22] incubator-tamaya git commit: TAMAYA-274 Reduced API footprint by using Java 8 features. Added some lambdas. TAMAYA-355 Enable mapping of lists and arrays into internal datastructures. TAMAYA-353 Adding support for different classloaders.
Date Sun, 18 Nov 2018 21:21:09 GMT
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueBuilderTest.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueBuilderTest.java b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueBuilderTest.java
index f927d94..d0d8874 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueBuilderTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueBuilderTest.java
@@ -1,275 +1,215 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.spi;
-
-import static org.assertj.core.api.Assertions.*;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-public class PropertyValueBuilderTest {
-
-    /*
-     * Tests for PropertyValueBuilder(String)
-     */
-
-    @Test(expected = NullPointerException.class)
-    public void constructorWithSingleParameterRequiresNonNullValue() {
-        new PropertyValue(null);
-    }
-
-    /*
-     * Tests for PropertyValueBuilder(String, String)
-     */
-
-    @Test(expected = NullPointerException.class)
-    public void constructorWithTwoParametersRequiresNonNullValueForKey() {
-        new PropertyValueBuilder(null, "s");
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void constructorWithTwoParametersRequiresNonNullValueForSource() {
-        new PropertyValueBuilder("a", null);
-    }
-
-    /*
-     * Tests for PropertyValueBuilder(String, String, String)
-     */
-
-    @Test(expected = NullPointerException.class)
-    public void constructorWithThreeParametersRequiresNonNullValueForSource() {
-        new PropertyValueBuilder("a", "b", null);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void constructorWithThreeParametersRequiresNonNullValueForKey() {
-        new PropertyValueBuilder(null, "b", "s");
-    }
-
-    /*
-     * Tests for addMetaEntry(String, Object)
-     */
-
-    @Test(expected = NullPointerException.class)
-    public void addMetaEntryRequiresNonNullParameterForKey() {
-        new PropertyValueBuilder("a", "b", "c").addMetaEntry(null, "a");
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void addMetaEntryRequiresNonNullParameterForValue() {
-        new PropertyValueBuilder("a", "b", "c").addMetaEntry("a", null);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void setKeyRequiresNonNullParameterForKey() {
-        new PropertyValueBuilder("a", "b", "s").setKey(null);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void setKeyRequiresNonNullParameterForValue() {
-        new PropertyValueBuilder("a", "b", "s").setValue(null);
-    }
-    
-    /*
-     * Tests für addMetaEntries(Map)
-     */
-
-    @Test(expected = NullPointerException.class)
-    public void addMetaEntriesRequiresNonNullParameter() {
-        new PropertyValueBuilder("a", "b", "s").addMetaEntries(null);
-    }
-
-    @Test
-    public void testCreate1(){
-        new PropertyValueBuilder("k");
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void testCreate1_Null(){
-        new PropertyValueBuilder(null);
-    }
-
-    @Test
-    public void testCreate2(){
-        new PropertyValueBuilder("k", "source");
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void testCreate2_Null(){
-        new PropertyValueBuilder("k", null);
-    }
-
-    @Test
-    public void testKey() throws Exception {
-        PropertyValueBuilder b = new PropertyValueBuilder("k", "testKey").setValue("v");
-        PropertyValue val = b.build();
-        assertThat("k").isEqualTo(val.getKey());
-        assertThat("v").isEqualTo(val.getValue());
-        assertThat(val.getMetaEntries().get("k")).isNull();
-    }
-    
-    @Test
-    public void testSetKey() {
-        PropertyValueBuilder b = new PropertyValueBuilder("k", "testSetKey").setKey("key");
-        PropertyValue val = b.build();
-        assertThat("key").isEqualTo(val.getKey());
-    }
-
-    @Test
-    public void testSource() throws Exception {
-        PropertyValueBuilder b = new PropertyValueBuilder("k", "testSource").setValue("v");
-        PropertyValue val = b.build();
-        assertThat("testSource").isEqualTo(val.getSource());
-        
-        PropertyValueBuilder b2 = b.setSource("differentSource");
-        val = b2.build();
-        assertThat("differentSource").isEqualTo(val.getSource());
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testKeyNullValue() throws Exception {
-        new PropertyValueBuilder(null, "testKeyNullValue");
-    }
-
-    @Test
-    public void testSetMetaEntries() throws Exception {
-        Map<String,String> meta = new HashMap<>();
-        meta.put("1","2");
-        meta.put("a", "b");
-        PropertyValue pv = PropertyValue.builder("k", "testGetKey")
-                .setValue("v")
-                .addMetaEntry("k", "v2")
-                .setMetaEntries(meta).build();
-        assertThat(pv.getValue()).isEqualTo("v");
-        assertThat(pv.getKey()).isEqualTo("k");
-        assertThat(pv.getMetaEntry("k")).isNull();
-        assertThat(pv.getSource()).isEqualTo("testGetKey");
-        assertThat(pv.getMetaEntries()).hasSize(2);
-        assertThat(pv.getMetaEntry("1")).isEqualTo("2");
-        assertThat(pv.getMetaEntry("a")).isEqualTo("b");
-    }
-
-    @Test
-    public void testGetKey() throws Exception {
-        PropertyValue pv = PropertyValue.builder("k", "testGetKey").setValue("v").build();
-        assertThat(pv.getKey()).isEqualTo("k");
-    }
-
-    @Test
-    public void testGetValue1() throws Exception {
-        PropertyValue pv = PropertyValue.of("k", "v", "testGetValue");
-        assertThat(pv.getValue()).isEqualTo("v");
-    }
-
-    @Test
-    public void testGetValue2() throws Exception {
-        PropertyValue pv = PropertyValue.builder("k", "testGetValue").setValue("v").build();
-        assertThat(pv.getValue()).isEqualTo("v");
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void removeMetaEntryRequiresNonNullParameter() {
-        new PropertyValueBuilder("y").removeMetaEntry(null);
-    }
-
-    @Test
-    public void testRemoveMetaEntry() throws Exception {
-        PropertyValue pv = PropertyValue.builder("k", "testGetKey")
-                .setValue("v")
-                .addMetaEntry("k", "v2")
-                .addMetaEntry("k2", "v22")
-                .removeMetaEntry("k").build();
-        assertThat(pv.getMetaEntry("k2")).isEqualTo("v22");
-        assertThat(pv.getMetaEntry("k")).isNull();
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testSourceNullValue() throws Exception {
-        new PropertyValueBuilder("k", null);
-    }
-
-    @Test
-    public void testGetMetaEntries() throws Exception {
-        Map<String,String> meta = new HashMap<>();
-        meta.put("1","2");
-        meta.put("a", "b");
-        PropertyValueBuilder b = PropertyValue.builder("k", "testGetKey")
-                .setValue("v")
-                .setMetaEntries(meta);
-        PropertyValue pv = b.build();
-        assertThat(b.getMetaEntries()).isEqualTo(meta);
-        assertThat(pv.getMetaEntries()).isEqualTo(meta);
-    }
-
-    @Test
-    public void testSetContextData() throws Exception {
-        PropertyValueBuilder b = new PropertyValueBuilder("k", "testSetContextData").setValue("v");
-        Map<String,String> context = new HashMap<>();
-        context.put("source", "testSetContextData");
-        context.put("ts", String.valueOf(System.currentTimeMillis()));
-        context.put("y", "yValue");
-        b.setMetaEntries(new HashMap<String, String>());
-        b.setMetaEntries(context);
-        context.remove("y");
-        b.setMetaEntries(context);
-        PropertyValue contextData = b.build();
-        assertThat(context.size()).isEqualTo(contextData.getMetaEntries().size());
-        assertThat("testSetContextData").isEqualTo(contextData.getMetaEntry("source"));
-        assertThat(contextData.getMetaEntry("ts")).isNotNull();
-        assertThat(contextData.getMetaEntry("y")).isNull();
-    }
-
-    @Test
-    public void testAddContextData() throws Exception {
-        PropertyValueBuilder b = new PropertyValueBuilder("k", "testAddContextData").setValue("v");
-        b.addMetaEntry("ts", System.currentTimeMillis());
-        b.addMetaEntry("y", "yValue");
-        b.addMetaEntry("y", "y2");
-        PropertyValue contextData = b.build();
-        assertThat(2).isEqualTo(contextData.getMetaEntries().size());
-        assertThat(contextData.getMetaEntry("ts")).isNotNull();
-        assertThat("y2").isEqualTo(contextData.getMetaEntry("y"));
-    }
-    
-    @Test
-    public void testMapKey() {
-        PropertyValueBuilder b = new PropertyValueBuilder("key", "testMapKey")
-                .setValue("value")
-                .addMetaEntry("_keyAndThenSome", "mappedvalue")
-                .addMetaEntry("somethingelse", "othervalue")
-                .mapKey("mappedkey");
-        PropertyValue pv = b.build();     
-        assertThat(pv.getKey()).isEqualTo("mappedkey");
-        assertThat(pv.getValue()).isEqualTo("value");
-        assertThat(pv.getMetaEntries()).hasSize(2);
-        assertThat(pv.getMetaEntry("_mappedkey.AndThenSome")).isEqualTo("mappedvalue");
-        assertThat(pv.getMetaEntry("somethingelse")).isEqualTo("othervalue");
-    }
-    
-    @Test
-    public void testToString(){
-        PropertyValueBuilder b = new PropertyValueBuilder("k")
-                .setValue("v")
-                .addMetaEntry("metak", "metav");
-        assertThat(b.toString()).isEqualTo("PropertyValueBuilder{key='k'value='v', metaEntries={metak=metav}}");
-    }
-
-}
\ No newline at end of file
+///*
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *   http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing,
+// * software distributed under the License is distributed on an
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// * KIND, either express or implied.  See the License for the
+// * specific language governing permissions and limitations
+// * under the License.
+// */
+//package org.apache.tamaya.spi;
+//
+//import static org.assertj.core.api.Assertions.*;
+//import static org.junit.Assert.assertEquals;
+//
+//import java.util.Collections;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//import org.assertj.core.api.Assertions;
+//import org.junit.Test;
+//
+//public class PropertyValueBuilderTest {
+//
+//    /*
+//     * Tests for PropertyValueBuilder(String, String)
+//     */
+//
+//    @Test(expected = NullPointerException.class)
+//    public void constructorWithSingleParameterRequiresNonNullValue_String() {
+//        new PropertyValueBuilder((String)null, (String)null);
+//    }
+//
+//    /*
+//     * Tests for PropertyValueBuilder(PropertyValue)
+//     */
+//
+//    @Test(expected = NullPointerException.class)
+//    public void constructorWithSingleParameterRequiresNonNullValue_PropertyValue() {
+//        new PropertyValueBuilder((PropertyValue) null);
+//    }
+//
+//    @Test
+//    public void constructorWithSingleParameter_PropertyValue() {
+//        assertEquals(PropertyValue.of("k", "v", "s"),
+//                new PropertyValueBuilder(PropertyValue.of("k", "v", "s")).build());
+//    }
+//
+//    /*
+//     * Tests for setMeta(String, Object)
+//     */
+//
+//
+//    /*
+//     * Tests für withMetaEntries(Map)
+//     */
+//
+//    @Test(expected = NullPointerException.class)
+//    public void addMetaEntriesRequiresNonNullParameter() {
+//        new PropertyValueBuilder("a", "v").withMetaEntries(null);
+//    }
+//
+//    @Test
+//    public void testCreate1(){
+//        new PropertyValueBuilder("k", "v");
+//    }
+//
+//
+//    @Test
+//    public void testKey() throws Exception {
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v");
+//        PropertyValue val = b.build();
+//        Assertions.assertThat("k").isEqualTo(val.getKey());
+//        Assertions.assertThat("v").isEqualTo(val.getValue());
+//        Assertions.assertThat(val.getMeta().current("k")).isNull();
+//    }
+//
+//    @Test
+//    public void testSource() throws Exception {
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v").setSource("testSource");
+//        PropertyValue val = b.build();
+//        Assertions.assertThat("testSource").isEqualTo(val.getSource());
+//
+//        PropertyValueBuilder b2 = b.setSource("differentSource");
+//        val = b2.build();
+//        Assertions.assertThat("differentSource").isEqualTo(val.getSource());
+//    }
+//
+//    @Test
+//    public void testSetMetaEntries() throws Exception {
+//        Map<String,String> meta = new HashMap<>();
+//        meta.put("1","2");
+//        meta.put("a", "b");
+//        PropertyValue pv = new PropertyValueBuilder("k", "v")
+//                .setMeta("k", "v2")
+//                .setMeta(meta).build();
+//        Assertions.assertThat(pv.getValue()).isEqualTo("v");
+//        Assertions.assertThat(pv.getKey()).isEqualTo("k");
+//        assertThat(pv.getMeta().current("k")).isNull();
+//        Assertions.assertThat(pv.getMeta()).hasSize(2);
+//        assertThat(pv.getMeta().current("1")).isEqualTo("2");
+//        assertThat(pv.getMeta().current("a")).isEqualTo("b");
+//    }
+//
+//    @Test
+//    public void testGetValue1() throws Exception {
+//        PropertyValue pv = PropertyValue.of("k", "v", "testGetValue");
+//        Assertions.assertThat(pv.getValue()).isEqualTo("v");
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void removeMetaEntryRequiresNonNullParameter() {
+//        new PropertyValueBuilder("y", "v").removeMetaEntry(null);
+//    }
+//
+//    @Test
+//    public void testRemoveMetaEntry() throws Exception {
+//        PropertyValue pv = new PropertyValueBuilder("k", "v")
+//                .setSource("testGetKey")
+//                .setMeta("k", "v2")
+//                .setMeta("k2", "v22")
+//                .removeMetaEntry("k").build();
+//        assertThat(pv.getMeta().current("k2")).isEqualTo("v22");
+//        assertThat(pv.getMeta().current("k")).isNull();
+//    }
+//
+//    @Test
+//    public void testGetMetaEntries() throws Exception {
+//        Map<String,String> meta = new HashMap<>();
+//        meta.put("1","2");
+//        meta.put("a", "b");
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v")
+//                .setSource("testGetKey")
+//                .setMeta(meta);
+//        PropertyValue pv = b.build();
+//        assertThat(b.getMeta()).isEqualTo(meta);
+//        Assertions.assertThat(pv.getMeta()).isEqualTo(meta);
+//    }
+//
+//    @Test
+//    public void testSetContextData() throws Exception {
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v").setSource("testSetContextData");
+//        Map<String,String> context = new HashMap<>();
+//        context.put("source", "testSetContextData");
+//        context.put("ts", String.valueOf(System.currentTimeMillis()));
+//        context.put("y", "yValue");
+//        b.setMeta(new HashMap<String, String>());
+//        b.setMeta(context);
+//        context.remove("y");
+//        b.setMeta(context);
+//        PropertyValue contextData = b.build();
+//        Assertions.assertThat(context.size()).isEqualTo(contextData.getMeta().size());
+//        Assertions.assertThat("testSetContextData").isEqualTo(contextData.getMeta("source"));
+//        assertThat(contextData.getMeta("ts")).isNotNull();
+//        assertThat(contextData.getMeta("y")).isNull();
+//    }
+//
+//    @Test
+//    public void testAddContextData() throws Exception {
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v");
+//        b.setMeta("ts", System.currentTimeMillis());
+//        b.setMeta("y", "yValue");
+//        b.setMeta("y", "y2");
+//        PropertyValue contextData = b.build();
+//        Assertions.assertThat(2).isEqualTo(contextData.getMeta().size());
+//        assertThat(contextData.getMeta("ts")).isNotNull();
+//        Assertions.assertThat("y2").isEqualTo(contextData.getMeta("y"));
+//    }
+//
+//    @Test
+//    public void testMapKey() {
+//        PropertyValueBuilder b = new PropertyValueBuilder("key", "value")
+//                .setMeta("_keyAndThenSome", "mappedvalue")
+//                .setMeta("somethingelse", "othervalue")
+//                .mapKey("mappedkey");
+//        PropertyValue pv = b.build();
+//        Assertions.assertThat(pv.getKey()).isEqualTo("mappedkey");
+//        Assertions.assertThat(pv.getValue()).isEqualTo("value");
+//        Assertions.assertThat(pv.getMeta()).hasSize(2);
+//        assertThat(pv.getMeta("_mappedkey.AndThenSome")).isEqualTo("mappedvalue");
+//        assertThat(pv.getMeta("somethingelse")).isEqualTo("othervalue");
+//    }
+//
+//    @Test
+//    public void testToString(){
+//        PropertyValueBuilder b = new PropertyValueBuilder("k", "v")
+//                .setMeta("metak", "metav");
+//        System.out.println(b.toString());
+//        assertThat(b.toString()).isEqualTo("PropertyValueBuilder{key='k'value='v'listValue='[]', metaEntries={metak=metav}}");
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void mapThreeParameterVariantRequiresNonNullValueForConfigParameter() {
+//        PropertyValueBuilder.map(null, "a", Collections.EMPTY_MAP);
+//    }
+//
+//    @Test
+//    public void mapThreeParameterVariantRequiresNonNullValueForSource() {
+//        PropertyValueBuilder.map(Collections.EMPTY_MAP, null, Collections.EMPTY_MAP);
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void mapThreeParameterVariantRequiresNonNullValueForMetaData() {
+//        PropertyValueBuilder.map(Collections.EMPTY_MAP, "s", null);
+//    }
+//
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueCombinationPolicyTest.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueCombinationPolicyTest.java b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueCombinationPolicyTest.java
index c7a4698..edf6765 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueCombinationPolicyTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueCombinationPolicyTest.java
@@ -32,10 +32,9 @@ public class PropertyValueCombinationPolicyTest {
         PropertyValueCombinationPolicy policy = PropertyValueCombinationPolicy.DEFAULT_OVERRIDING_POLICY;
 
         PropertyValue current = PropertyValue.of("a", "AAA", "Test");
-        PropertyValue result = policy.collect(current, "a", new DummyPropertySource());
-
-        assertThat(result.getKey()).isEqualTo("a");
-        assertThat(result.getValue()).isEqualTo("Ami");
+        PropertyValue v = policy.collect(current, "a", new DummyPropertySource());
+        assertThat(v.getKey()).isEqualTo("a");
+        assertThat(v.getValue()).isEqualTo("Ami");
     }
 
     @Test
@@ -43,11 +42,10 @@ public class PropertyValueCombinationPolicyTest {
         PropertyValueCombinationPolicy policy = PropertyValueCombinationPolicy.DEFAULT_OVERRIDING_POLICY;
 
         PropertyValue current = PropertyValue.of("a", "AAA", "Test");
-        PropertyValue result = policy.collect(current, "a", PropertySource.EMPTY);
-
-        assertThat(result.getKey()).isEqualTo("a");
-        assertThat(result.getValue()).isEqualTo("AAA");
-        assertThat(result).isEqualTo(current);
+        PropertyValue v = policy.collect(current, "a", PropertySource.EMPTY);
+        assertThat(v.getKey()).isEqualTo("a");
+        assertThat(v.getValue()).isEqualTo("AAA");
+        assertThat(v).isEqualTo(current);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
index e23bd35..3a9d3ef 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/PropertyValueTest.java
@@ -18,55 +18,112 @@
  */
 package org.apache.tamaya.spi;
 
+import org.assertj.core.api.Assertions;
 import org.junit.Test;
 
-import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import static org.assertj.core.api.Assertions.*;
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 
 @SuppressWarnings("unchecked")
 public class PropertyValueTest {
 
     @Test(expected = NullPointerException.class)
-    public void mapThreeParameterVariantRequiresNonNullValueForConfigParameter() {
-        PropertyValue.map(null, "a", Collections.EMPTY_MAP);
+    public void ofDoesNotAcceptNullAsKey() throws Exception {
+        PropertyValue.of(null, "b", "source");
     }
 
-    @Test(expected = NullPointerException.class)
-    public void mapThreeParameterVariantRequiresNonNullValueForSource() {
-        PropertyValue.map(Collections.EMPTY_MAP, null, Collections.EMPTY_MAP);
+    @Test
+    public void ofDoesAcceptNullAsSource() throws Exception {
+        PropertyValue.of("a", "b", null);
+    }
+
+    @Test
+    public void testOf(){
+        assertThat(PropertyValue.of("k", "v", "testGetKey")).isNotNull();
     }
 
     @Test(expected = NullPointerException.class)
-    public void mapThreeParameterVariantRequiresNonNullValueForMetaData() {
-        PropertyValue.map(Collections.EMPTY_MAP, "s", null);
+    public void getMetaEntryRequiresNonNullValueForKey() {
+        PropertyValue.of("a", "b", "s").getMeta((String)null);
     }
 
     @Test(expected = NullPointerException.class)
-    public void ofDoesNotAcceptNullAsKey() throws Exception {
-        PropertyValue.of(null, "b", "source");
+    public void getMetaEntryRequiresNonNullValueForKeyClass() {
+        PropertyValue.of("a", "b", "s").getMeta((Class)null);
     }
 
     @Test(expected = NullPointerException.class)
-    public void ofDoesNotAcceptNullAsSource() throws Exception {
-        PropertyValue.of("a", "b", null);
+    public void testSetMetaEntriesRequiresNonNullParameter() {
+        PropertyValue.create().setMeta(null);
     }
 
     @Test
-    public void testOf(){
-        assertThat(PropertyValue.of("k", "v", "testGetKey")).isNotNull();
+    public void testSetMetaEntries() throws Exception {
+        Map<String,Object> meta = new HashMap<>();
+        meta.put("1","2");
+        meta.put("a", "b");
+        PropertyValue pv = PropertyValue.create()
+                .setMeta("k", "v2")
+                .setMeta(meta);
+        assertThat(pv.getMeta().get("k")).isNull();
+        Assertions.assertThat(pv.getMeta()).hasSize(2);
+        assertThat(pv.getMeta().get("1")).isEqualTo("2");
+        assertThat(pv.getMeta().get("a")).isEqualTo("b");
     }
 
     @Test(expected = NullPointerException.class)
-    public void getMetaEntryRequiresNonNullValueForKey() {
-        PropertyValue.of("a", "b", "s").getMetaEntry(null);
+    public void removeMetaEntryRequiresNonNullParameter() {
+        PropertyValue.create().removeMeta((String)null);
     }
 
     @Test(expected = NullPointerException.class)
-    public void testSetMetaEntriesRequiresNonNullParameter() {
-        new PropertyValueBuilder("a").setMetaEntries(null);
+    public void removeMetaEntryRequiresNonNullParameterClass() {
+        PropertyValue.create().removeMeta((Class)null);
+    }
+
+
+    @Test
+    public void testRemoveMetaEntry() throws Exception {
+        PropertyValue pv = PropertyValue.create("k")
+                .setMeta("k", "v2")
+                .setMeta("k2", "v22")
+                .removeMeta("k");
+        assertThat(pv.getMeta().get("k2")).isEqualTo("v22");
+        assertThat(pv.getMeta().get("k")).isNull();
+    }
+
+    @Test
+    public void testRemoveMetaEntryClass() throws Exception {
+        PropertyValue pv = PropertyValue.create("k")
+                .setMeta(String.class, "v2")
+                .setMeta("k2", "v22")
+                .removeMeta(String.class);
+        assertThat(pv.getMeta().get("k2")).isEqualTo("v22");
+        assertThat(pv.getMeta(String.class)).isNull();
+    }
+
+    @Test
+    public void testGetMetaEntries() throws Exception {
+        Map<String,Object> meta = new HashMap<>();
+        meta.put("1","2");
+        meta.put("a", "b");
+        PropertyValue pv = PropertyValue.create("k")
+                .setMeta(meta);
+        assertThat(pv.getMeta()).isEqualTo(meta);
+        Assertions.assertThat(pv.getMeta()).isEqualTo(meta);
+    }
+
+    @Test
+    public void testGetMetaEntries2() throws Exception {
+        PropertyValue pv = PropertyValue.of("k", "v", null);
+        Assertions.assertThat(pv.getMeta()).isNotNull();
+        Assertions.assertThat(pv.getMeta().isEmpty()).isTrue();
     }
 
     @Test
@@ -86,99 +143,40 @@ public class PropertyValueTest {
     }
         
     @Test
-    public void testBuilder(){
-        assertThat(PropertyValue.builder("k", "testGetKey")).isNotNull();
-        assertThat(PropertyValue.of("k", "v", "testEquals")).isEqualTo(PropertyValue.builder("k", "testEquals").setValue("v").build());
-    }
-
-    @Test
-    public void testToBuilder(){
-        assertThat(PropertyValue.of("k", "v", "testGetKey").toBuilder()).isNotNull();
-        // round-trip
-        PropertyValue val = PropertyValue.of("k", "v", "testGetKey");
-        assertThat(val).isEqualTo(val.toBuilder().build());
-    }
-
-    @Test
     public void testGetKey() throws Exception {
         PropertyValue pv = PropertyValue.of("k", "v", "testGetKey");
-        assertThat(pv.getKey()).isEqualTo("k");
+        Assertions.assertThat(pv.getKey()).isEqualTo("k");
     }
 
     @Test
     public void testGetValue() throws Exception {
         PropertyValue pv = PropertyValue.of("k", "v", "testGetValue");
-        assertThat(pv.getValue()).isEqualTo("v");
+        Assertions.assertThat(pv.getValue()).isEqualTo("v");
     }
 
     @Test
     public void testGetSource() throws Exception {
         PropertyValue pv = PropertyValue.of("k", "v", "testGetSource");
-        assertThat(pv.getSource()).isEqualTo("testGetSource");
+        Assertions.assertThat(pv.getSource()).isEqualTo("testGetSource");
         pv = PropertyValue.of("k", "v", "testGetSource");
-        assertThat(pv.getSource()).isEqualTo("testGetSource");
+        Assertions.assertThat(pv.getSource()).isEqualTo("testGetSource");
     }
 
     @Test
     public void testGetMetaEntry() throws Exception {
-        PropertyValue pv = PropertyValue.builder("k", "testGetMetaEntry").setValue("v")
-                .addMetaEntry("k", "v2").build();
-        assertThat(pv.getValue()).isEqualTo("v");
-        assertThat(pv.getKey()).isEqualTo("k");
-        assertThat(pv.getMetaEntry("k")).isEqualTo("v2");
-        assertThat(pv.getSource()).isEqualTo("testGetMetaEntry");
+        PropertyValue pv = PropertyValue.create("k")
+                .setValue("v")
+                .setMeta("k", "v2");
+        Assertions.assertThat(pv.getValue()).isEqualTo("v");
+        Assertions.assertThat(pv.getKey()).isEqualTo("k");
+        assertThat(pv.getMeta().get("k")).isEqualTo("v2");
+        assertThat((String)pv.getMeta("k")).isEqualTo("v2");
     }
 
-    @Test
-    public void testGetMetaEntries() throws Exception {
-        PropertyValue pv = PropertyValue.of("k", "v", "testGetMetaEntries");
-        assertThat(pv.getMetaEntries()).isNotNull();
-        assertThat(pv.getMetaEntries().isEmpty()).isTrue();
-    }
-
-    @Test
-    public void testMap() throws Exception {
-        Map<String,String> map = new HashMap<>();
-        map.put("a", "1");
-        map.put("b", "2");
-        Map<String,PropertyValue> result = PropertyValue.map(map, "source1");
-        assertThat(result).isNotNull();
-        assertThat(result.size()).isEqualTo(map.size());
-
-        for (Map.Entry<String,String>en:map.entrySet()) {
-            PropertyValue val = result.get(en.getKey());
-            assertThat(val).isNotNull();
-            assertThat(en.getKey()).isEqualTo(val.getKey());
-            assertThat(en.getValue()).isEqualTo(val.getValue());
-            assertThat("source1").isEqualTo(val.getSource());
-            assertThat(val.getMetaEntries().isEmpty()).isTrue();
-        }
-    }
-
-    @Test
-    public void testMapWithMetadata() throws Exception {
-        Map<String,String> map = new HashMap<>();
-        map.put("a", "1");
-        map.put("b", "2");
-        Map<String,String> meta = new HashMap<>();
-        map.put("m1", "n1");
-        map.put("m2", "n2");
-        Map<String,PropertyValue> result = PropertyValue.map(map, "source1", meta);
-        assertThat(result).isNotNull();
-        assertThat(result.size()).isEqualTo(map.size());
-        for(Map.Entry<String,String>en:map.entrySet()){
-            PropertyValue val = result.get(en.getKey());
-            assertThat(val).isNotNull();
-            assertThat(en.getKey()).isEqualTo(val.getKey());
-            assertThat(en.getValue()).isEqualTo(val.getValue());
-            assertThat("source1").isEqualTo(val.getSource());
-            assertThat(meta).isEqualTo(val.getMetaEntries());
-        }
-    }
 
     @Test(expected = NullPointerException.class)
     public void testInstantiateNoKey1() throws Exception {
-        PropertyValue.builder(null, "testGetKey").setValue("v").build();
+        PropertyValue.create((String)null);
     }
 
     @Test(expected = NullPointerException.class)
@@ -187,54 +185,219 @@ public class PropertyValueTest {
     }
 
     @Test
-    public void testInstantiateNoValue1() throws Exception {
-        PropertyValue.builder("k", "testGetKey").build();
+    public void testInstantiateNoValue2() throws Exception {
+        PropertyValue.of("k", null, "testGetKey");
     }
 
     @Test
-    public void testInstantiateNoValue2() throws Exception {
-        PropertyValue.of("k", null, "testGetKey");
+    public void testInstantiateNoSource2() throws Exception {
+        PropertyValue.of("k", "v", null);
     }
 
     @Test(expected = NullPointerException.class)
-    public void testInstantiateNoSource1() throws Exception {
-        PropertyValue.builder("k", null).setValue("v").build();
+    public void addMetaEntryRequiresNonNullParameterForKey() {
+        PropertyValue.create("k").setMeta((String)null, "a");
     }
 
     @Test(expected = NullPointerException.class)
-    public void testInstantiateNoSource2() throws Exception {
-        PropertyValue.of("k", "v", null);
+    public void addMetaEntryRequiresNonNullParameterForKeyClass() {
+        PropertyValue.create("k").setMeta((Class)null, "a");
     }
 
     @Test(expected = NullPointerException.class)
-    public void testGetMetaEntry_Null() throws Exception {
-        PropertyValue.of("k", "v", "src").getMetaEntry(null);
+    public void addMetaEntryRequiresNonNullParameterForValue() {
+        PropertyValue.create("k").setMeta("a", null);
     }
 
-    @Test(expected = NullPointerException.class)
-    public void builderMethodThreeParameterVariantRequiresNonNullValueAsKey() {
-        PropertyValue.builder(null, "b", "s");
+    @Test
+    public void setValueRequiresNullParameterForValue() {
+        PropertyValue.create("k").setValue(null);
     }
 
-    @Test(expected = NullPointerException.class)
-    public void builderMethodThreeParameterVariantRequiresNonNullValueAsSource() {
-        PropertyValue.builder("A", "b", null);
+    @Test
+    public void create() {
+        assertNotNull(PropertyValue.create());
+        assertTrue(PropertyValue.create().isRoot());
+        PropertyValue n = PropertyValue.create().getOrCreateChild("child");
+        assertFalse(n.isRoot());
     }
 
-    @Test(expected = NullPointerException.class)
-    public void builderMethodThreeParameterVariantRequiresNonNullValueAsValue() {
-        PropertyValue.builder("A", null, "s");
+    @Test
+    public void create_String() {
+        PropertyValue foo = PropertyValue.create("foo");
+        assertNotNull(foo);
+        assertEquals("foo", foo.getKey());
+        PropertyValue n = PropertyValue.create("bar").getOrCreateChild("child");
+        assertFalse(n.isRoot());
     }
 
+    @Test
+    public void getOrCreateChild() {
+        PropertyValue root = PropertyValue.create("bar");
+        assertTrue(root.getChildren().isEmpty());
+        assertNotNull(root.getOrCreateChild("foo"));
+        assertFalse(root.getChildren().isEmpty());
+        assertFalse(root.getChildren("foo").isEmpty());
+        assertTrue(root.getOrCreateChild("foo") == root.getOrCreateChild("foo"));
+        assertTrue(root.getChildren("bar").isEmpty());
+        assertTrue(root.getOrCreateChild("bar") == root.getOrCreateChild("bar"));
+        assertFalse(root.getChildren("bar").isEmpty());
+    }
 
-    @Test(expected = NullPointerException.class)
-    public void builderMethodTwoParameterVariantRequiresNonNullValueAsSource() {
-        PropertyValue.builder(null, "a");
+    @Test
+    public void getChild() {
+        PropertyValue root = PropertyValue.create("bar");
+        assertNull(root.getChild("foo"));
+        root.getOrCreateChild("foo");
+        assertNotNull(root.getChild("foo"));
     }
 
-    @Test(expected = NullPointerException.class)
-    public void builderMethodTwoParameterVariantRequiresNonNullValueAsValue() {
-        PropertyValue.builder("A", null);
+    @Test
+    public void createChild_Indexed() {
+        PropertyValue root = PropertyValue.create("a");
+        assertNotNull(root.createChild("a", true));
+        List<PropertyValue> nodes = root.getChildren("a");
+        assertEquals(1, nodes.size());
+        assertTrue(root.createChild("a").isIndexed());
+        nodes = root.getChildren("a");
+        assertEquals(2, nodes.size());
+        assertFalse(root.createChild("b").isIndexed());
+        assertTrue(root.createChild("b").isIndexed());
+    }
+
+    @Test
+    public void addMeta() {
+        PropertyValue root = PropertyValue.create();
+        assertNotNull(root.setMeta("a"));
+        root.setMeta("a", Integer.valueOf(3));
+        assertEquals(Integer.valueOf(3), root.getMeta("a"));
+    }
+
+    @Test
+    public void getKey() {
+        PropertyValue root = PropertyValue.create("a");
+        assertEquals("a", root.getKey());
+    }
+
+    @Test
+    public void getQualifiedKey() {
+        PropertyValue root = PropertyValue.create("a");
+        assertEquals("a", root.getQualifiedKey());
+        PropertyValue n = root.createChild("b");
+        assertEquals("a.b", n.getQualifiedKey());
+        PropertyValue added = n.createChild("c");
+        assertEquals("a.b.c", added.getQualifiedKey());
+        added = n.createChild("c");
+        assertEquals("a.b.c[1]", added.getQualifiedKey());
+        assertEquals("a.b.c[0]", n.getChildWithIndex("c",0).getQualifiedKey());
+    }
+
+    @Test
+    public void isIndexed() {
+        PropertyValue n = PropertyValue.create();
+        assertFalse(n.isIndexed());
+        assertFalse(n.createChild("a").isIndexed());
+        assertFalse(n.createChild("b").isIndexed());
+        assertFalse(n.createChild("c").isIndexed());
+        assertTrue(n.createChild("c").isIndexed());
+    }
+
+    @Test
+    public void isLeaf() {
+        PropertyValue n = PropertyValue.create();
+        assertTrue(n.isLeaf());
+        n.createChild("b");
+        assertFalse(n.isLeaf());
+    }
+
+    @Test
+    public void getParent() {
+        PropertyValue n = PropertyValue.create();
+        assertNull(n.getParent());
+        n = n.createChild("b");
+        assertNotNull(n.getParent());
+    }
+
+    @Test
+    public void getChildren_Filtered() {
+        PropertyValue n = PropertyValue.create();
+        n.createChild("a");
+        n.createChild("b");
+        n.createChild("c");
+        n.createChild("c");
+        List<PropertyValue> nodes = n.getChildren("a");
+        assertNotNull(nodes);
+        assertEquals(1, nodes.size());
+        assertEquals("a", nodes.get(0).getKey());
+
+        nodes = n.getChildren("c");
+        assertEquals(2, nodes.size());
+        assertEquals("c", nodes.get(0).getKey());
+        assertEquals("c", nodes.get(1).getKey());
+    }
+
+    @Test
+    public void getChildren() {
+        PropertyValue n = PropertyValue.create();
+        n.createChild("a");
+        n.createChild("b");
+        n.createChild("c");
+        n.createChild("c");
+        List<PropertyValue> nodes = n.getChildren();
+        assertNotNull(nodes);
+        assertEquals(4, nodes.size());
+        assertEquals("a", nodes.get(0).getKey());
+        assertEquals("b", nodes.get(1).getKey());
+        assertEquals("c", nodes.get(2).getKey());
+        assertEquals("c", nodes.get(3).getKey());
+    }
+
+    @Test
+    public void asMap() {
+        PropertyValue n = PropertyValue.create();
+        n.createChild("a", "aVal");
+        n.createChild("b").createChild("b2").createChild("b3", "b3Val");
+        n.createChild("c", "cVal1");
+        n.createChild("c", "cVal2");
+        Map<String,String> map = n.asMap();
+        System.out.println(map);
+        assertEquals(4, map.size());
+        assertEquals("aVal", map.get("a"));
+        assertEquals("b3Val", map.get("b.b2.b3"));
+        assertEquals("cVal1", map.get("c[0]"));
+        assertEquals("cVal2", map.get("c[1]"));
+    }
+
+    @Test
+    public void asString() {
+        PropertyValue n = PropertyValue.create();
+        n.createChild("a", "aVal");
+        n.createChild("b").createChild("b2").createChild("b3", "b3Val");
+        n.createChild("c", "cVal1");
+        n.createChild("c", "cVal2");
+        assertEquals("a = aVal\n" +
+                "b.b2.b3 = b3Val\n" +
+                "c[0] = cVal1\n" +
+                "c[1] = cVal2\n", n.asString());
+    }
+
+    @Test
+    public void equals() {
+        assertEquals(PropertyValue.create(), PropertyValue.create());
+        assertNotEquals(PropertyValue.create("a"), PropertyValue.create());
+        assertEquals(PropertyValue.create("b"), PropertyValue.create("b"));
+        PropertyValue root = PropertyValue.create();
+        assertEquals(root, root);
+    }
+
+    @Test
+    public void testToString() {
+        PropertyValue n = PropertyValue.create();
+        n.createChild("a", "aVal");
+        n.createChild("b").createChild("b2").createChild("b3", "b3Val");
+        n.createChild("c", "cVal1");
+        n.createChild("c", "cVal2");
+        assertEquals("PropertyValue{'', children='4'}", n.toString());
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextManagerTest.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextManagerTest.java b/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextManagerTest.java
index 4fd16d8..90218aa 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextManagerTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextManagerTest.java
@@ -35,16 +35,16 @@ public class ServiceContextManagerTest {
 
     @Test
     public void setGetServiceContext() throws Exception {
-        ServiceContext prev = ServiceContextManager.getServiceContext();
+        ServiceContext prev = ServiceContextManager.getServiceContext(getClass().getClassLoader());
         try {
             MyServiceContext mine = new MyServiceContext();
             ServiceContextManager.set(mine);
-            assertThat(ServiceContextManager.getServiceContext() == mine).isTrue();
+            assertThat(ServiceContextManager.getServiceContext(getClass().getClassLoader()) == mine).isTrue();
             ServiceContextManager.set(mine);
-            assertThat(ServiceContextManager.getServiceContext() == mine).isTrue();
+            assertThat(ServiceContextManager.getServiceContext(getClass().getClassLoader()) == mine).isTrue();
         } finally {
             ServiceContextManager.set(prev);
-            assertThat(ServiceContextManager.getServiceContext() == prev).isTrue();
+            assertThat(ServiceContextManager.getServiceContext(getClass().getClassLoader()) == prev).isTrue();
         }
 
     }
@@ -57,6 +57,16 @@ public class ServiceContextManagerTest {
     private static final class MyServiceContext implements ServiceContext{
 
         @Override
+        public ClassLoader getClassLoader() {
+            return getClass().getClassLoader();
+        }
+
+        @Override
+        public void init(ClassLoader classLoader) {
+
+        }
+
+        @Override
         public int ordinal() {
             return 0;
         }
@@ -77,12 +87,12 @@ public class ServiceContextManagerTest {
         }
 
         @Override
-        public Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException {
+        public Enumeration<URL> getResources(String resource) throws IOException {
             return null;
         }
 
         @Override
-        public URL getResource(String resource, ClassLoader cl) {
+        public URL getResource(String resource) {
             return null;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextTest.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextTest.java b/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextTest.java
index 60aaf51..65db2af 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextTest.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/ServiceContextTest.java
@@ -31,6 +31,16 @@ public class ServiceContextTest {
     private final ServiceContext serviceContext = new ServiceContext(){
 
         @Override
+        public ClassLoader getClassLoader() {
+            return null;
+        }
+
+        @Override
+        public void init(ClassLoader classLoader) {
+
+        }
+
+        @Override
         public int ordinal() {
             return 1;
         }
@@ -59,15 +69,6 @@ public class ServiceContextTest {
             return Collections.emptyList();
         }
 
-        @Override
-        public Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException {
-            return cl.getResources(resource);
-        }
-
-        @Override
-        public URL getResource(String resource, ClassLoader cl) {
-            return cl.getResource(resource);
-        }
     };
 
     @Test
@@ -103,7 +104,7 @@ public class ServiceContextTest {
 
     @Test
     public void testGetInstance() throws Exception {
-        assertThat(ServiceContextManager.getServiceContext()).isNotNull();
+        assertThat(ServiceContextManager.getServiceContext(getClass().getClassLoader())).isNotNull();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/TestLowerOrdinalServiceContext.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/TestLowerOrdinalServiceContext.java b/code/api/src/test/java/org/apache/tamaya/spi/TestLowerOrdinalServiceContext.java
index cfb812f..24f3fe4 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/TestLowerOrdinalServiceContext.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/TestLowerOrdinalServiceContext.java
@@ -32,6 +32,15 @@ public final class TestLowerOrdinalServiceContext implements ServiceContext {
     private final RuntimeException ex = new RuntimeException("Lower ordinal Service Context was used.");
 
     @Override
+    public ClassLoader getClassLoader() {
+        return Thread.currentThread().getContextClassLoader();
+    }
+
+    @Override
+    public void init(ClassLoader classLoader) {
+    }
+
+    @Override
     public int ordinal() {
         return 1;
     }
@@ -52,12 +61,12 @@ public final class TestLowerOrdinalServiceContext implements ServiceContext {
     }
 
     @Override
-    public Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException {
+    public Enumeration<URL> getResources(String resource) throws IOException {
         throw ex;
     }
 
     @Override
-    public URL getResource(String resource, ClassLoader cl) {
+    public URL getResource(String resource) {
         throw ex;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/api/src/test/java/org/apache/tamaya/spi/TestServiceContext.java
----------------------------------------------------------------------
diff --git a/code/api/src/test/java/org/apache/tamaya/spi/TestServiceContext.java b/code/api/src/test/java/org/apache/tamaya/spi/TestServiceContext.java
index e49ae74..805e07c 100644
--- a/code/api/src/test/java/org/apache/tamaya/spi/TestServiceContext.java
+++ b/code/api/src/test/java/org/apache/tamaya/spi/TestServiceContext.java
@@ -30,12 +30,29 @@ import java.util.logging.Logger;
  * {@link java.util.ServiceLoader} to load the services required.
  */
 public final class TestServiceContext implements ServiceContext {
+
+    private ClassLoader classLoader;
+
     /** List current services loaded, per class. */
     private final ConcurrentHashMap<Class<?>, List<Object>> servicesLoaded = new ConcurrentHashMap<>();
 
     private final Map<Class<?>, Object> singletons = new ConcurrentHashMap<>();
 
     @Override
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
+    @Override
+    public void init(ClassLoader classLoader) {
+        if(this.classLoader==null){
+            this.classLoader = classLoader;
+        }else{
+            throw new IllegalStateException("Classloader already setCurrent on this context.");
+        }
+    }
+
+    @Override
     public int ordinal() {
         return 5;
     }
@@ -93,13 +110,13 @@ public final class TestServiceContext implements ServiceContext {
     }
 
     @Override
-    public Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException {
-        return cl.getResources(resource);
+    public Enumeration<URL> getResources(String resource) throws IOException {
+        return classLoader.getResources(resource);
     }
 
     @Override
-    public URL getResource(String resource, ClassLoader cl) {
-        return cl.getResource(resource);
+    public URL getResource(String resource) {
+        return classLoader.getResource(resource);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
index bbc8caf..59a0512 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationBuilder.java
@@ -23,6 +23,7 @@ import org.apache.tamaya.TypeLiteral;
 import org.apache.tamaya.spi.ConfigurationContext;
 import org.apache.tamaya.spi.ConfigurationBuilder;
 import org.apache.tamaya.core.internal.converters.*;
+import org.apache.tamaya.spisupport.DefaultConfiguration;
 import org.apache.tamaya.spisupport.DefaultConfigurationBuilder;
 import org.apache.tamaya.spisupport.DefaultConfigurationContext;
 import org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder;
@@ -86,7 +87,15 @@ public final class CoreConfigurationBuilder extends DefaultConfigurationBuilder
 
     @Override
     public Configuration build() {
-        return new CoreConfiguration(contextBuilder.build());
+        Configuration cfg = new CoreConfiguration(
+                new DefaultConfigurationContext(
+                        serviceContext,
+                        this.combinationPolicy,
+                        this.propertyFilters,
+                        this.propertySources,
+                        this.propertyConverters));
+        built = true;
+        return cfg;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationProvider.java b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationProvider.java
index caf7fbb..2a6108d 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationProvider.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/CoreConfigurationProvider.java
@@ -27,7 +27,10 @@ import org.apache.tamaya.spisupport.DefaultConfiguration;
 import org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder;
 import org.osgi.service.component.annotations.Component;
 
+import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Logger;
 
 /**
  * Implementation of the Configuration API. This class uses the current {@link org.apache.tamaya.spi.ConfigurationContext} to evaluate the
@@ -37,21 +40,34 @@ import java.util.Objects;
 @Component(service = ConfigurationProviderSpi.class)
 public class CoreConfigurationProvider implements ConfigurationProviderSpi {
 
-    private Configuration config = new CoreConfigurationBuilder()
+    private static final Logger LOG = Logger.getLogger(CoreConfigurationProvider.class.getName());
+
+    private final Map<ClassLoader, Configuration> configurations = new ConcurrentHashMap<>();
+
+    public CoreConfigurationProvider(){
+        Configuration defaultConfig = new CoreConfigurationBuilder()
+                .setClassLoader(getClass().getClassLoader())
             .addDefaultPropertyConverters()
             .addDefaultPropertyFilters()
             .addDefaultPropertySources()
             .build();
-    {
-        String bannerConfig = config.getOrDefault("tamaya.banner", "OFF");
-
+        configurations.put(getClass().getClassLoader(), defaultConfig);
+        String bannerConfig = defaultConfig.getOrDefault("tamaya.banner", "OFF");
         BannerManager bm = new BannerManager(bannerConfig);
         bm.outputBanner();
     }
 
+
+
     @Override
-    public Configuration getConfiguration() {
-        return config;
+    public Configuration getConfiguration(ClassLoader classLoader) {
+        return configurations.computeIfAbsent(classLoader, cl -> new CoreConfigurationBuilder()
+                    .setClassLoader(classLoader)
+                    .addDefaultPropertyConverters()
+                    .addDefaultPropertyFilters()
+                    .addDefaultPropertySources()
+                    .build()
+        );
     }
 
     @Override
@@ -70,13 +86,16 @@ public class CoreConfigurationProvider implements ConfigurationProviderSpi {
     }
 
     @Override
-    public void setConfiguration(Configuration config) {
+    public void setConfiguration(Configuration config, ClassLoader classLoader) {
         Objects.requireNonNull(config.getContext());
-        this.config = Objects.requireNonNull(config);
+        Configuration old = this.configurations.put(classLoader, Objects.requireNonNull(config));
+        if(old != null){
+            LOG.warning(String.format("Replaced config %S with %S for classloader %S", old, config, classLoader));
+        }
     }
 
     @Override
-    public boolean isConfigurationSettable() {
+    public boolean isConfigurationSettable(ClassLoader classLoader) {
         return true;
     }
 
@@ -86,7 +105,7 @@ public class CoreConfigurationProvider implements ConfigurationProviderSpi {
     @Deprecated
     @Override
     public ConfigurationContext getConfigurationContext() {
-        return this.config.getContext();
+        return getConfiguration(Thread.currentThread().getContextClassLoader()).getContext();
     }
 
     /**
@@ -95,7 +114,7 @@ public class CoreConfigurationProvider implements ConfigurationProviderSpi {
     @Deprecated
     @Override
     public void setConfigurationContext(ConfigurationContext context){
-        this.config = new CoreConfigurationBuilder(context).build();
+        setConfiguration(new CoreConfigurationBuilder(context).build(), Thread.currentThread().getContextClassLoader());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceContext.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceContext.java b/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceContext.java
index b7328d9..57a4418 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceContext.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceContext.java
@@ -49,6 +49,17 @@ public class OSGIServiceContext implements ServiceContext{
 
 
     @Override
+    public ClassLoader getClassLoader() {
+        return getClass().getClassLoader();
+    }
+
+    @Override
+    public void init(ClassLoader classLoader) {
+        throw new IllegalStateException("Classloader already setCurrent on this context.");
+    }
+
+
+    @Override
     public int ordinal() {
         return 10;
     }
@@ -116,7 +127,7 @@ public class OSGIServiceContext implements ServiceContext{
     }
 
     @Override
-    public Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException{
+    public Enumeration<URL> getResources(String resource) throws IOException{
         LOG.finest("TAMAYA  Loading resources: " + resource);
         List<URL> result = new ArrayList<>();
         URL url = osgiServiceLoader.getBundleContext().getBundle()
@@ -144,7 +155,7 @@ public class OSGIServiceContext implements ServiceContext{
     }
 
     @Override
-    public URL getResource(String resource, ClassLoader cl){
+    public URL getResource(String resource){
         LOG.finest("TAMAYA  Loading resource: " + resource);
         URL url = osgiServiceLoader.getBundleContext().getBundle()
                 .getEntry(resource);

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigDecimalConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigDecimalConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigDecimalConverter.java
index 648f8bc..89370b0 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigDecimalConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigDecimalConverter.java
@@ -39,7 +39,7 @@ import java.util.logging.Logger;
  * </ul>
  */
 @Component(service = PropertyConverter.class)
-public class BigDecimalConverter implements PropertyConverter<BigDecimal>{
+public class BigDecimalConverter implements PropertyConverter<BigDecimal> {
 
     /** The logger. */
     private static final Logger LOG = Logger.getLogger(BigDecimalConverter.class.getName());
@@ -47,15 +47,16 @@ public class BigDecimalConverter implements PropertyConverter<BigDecimal>{
     private final BigIntegerConverter integerConverter = new BigIntegerConverter();
 
     @Override
-    public BigDecimal convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<bigDecimal> -> new BigDecimal(String)");
+    public BigDecimal convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<bigDecimal> -> new BigDecimal(String)"));
 
         String trimmed = Objects.requireNonNull(value).trim();
         try{
             return new BigDecimal(trimmed);
         } catch(Exception e){
             LOG.finest("Parsing BigDecimal failed, trying BigInteger for: " + value);
-            BigInteger bigInt = integerConverter.convert(value, context);
+            BigInteger bigInt = integerConverter.convert(value);
             if(bigInt!=null){
                 return new BigDecimal(bigInt);
             }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigIntegerConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigIntegerConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigIntegerConverter.java
index 724362b..4ca5c2d 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigIntegerConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BigIntegerConverter.java
@@ -39,51 +39,22 @@ import java.util.logging.Logger;
  * </ul>
  */
 @Component(service = PropertyConverter.class)
-public class BigIntegerConverter implements PropertyConverter<BigInteger>{
+public class BigIntegerConverter implements PropertyConverter<BigInteger> {
 
     /** The logger. */
     private static final Logger LOG = Logger.getLogger(BigIntegerConverter.class.getName());
-    /** Converter used to decode hex, octal values. */
-    private final ByteConverter byteConverter = new ByteConverter();
 
     @Override
-    public BigInteger convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "[-]0X.. (hex)", "[-]0x... (hex)", "<bigint> -> new BigInteger(bigint)");
+    public BigInteger convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "[-]0X.. (hex)", "[-]0x... (hex)", "<bigint> -> new BigInteger(bigint)"));
         String trimmed = Objects.requireNonNull(value).trim();
         if(trimmed.startsWith("0x") || trimmed.startsWith("0X")){
             LOG.finest("Parsing Hex value to BigInteger: " + value);
-            trimmed = trimmed.substring(2);
-            StringBuilder decimal = new StringBuilder();
-            for(int offset = 0;offset < trimmed.length();offset+=2){
-                if(offset==trimmed.length()-1){
-                    LOG.finest("Invalid Hex-Byte-String: " + value);
-                    return null;
-                }
-                byte val = byteConverter.convert("0x" + trimmed.substring(offset, offset + 2), context);
-                if(val<10){
-                    decimal.append('0').append(val);
-                } else{
-                    decimal.append(val);
-                }
-            }
-            return new BigInteger(decimal.toString());
+            return new BigInteger(value.substring(2), 16);
         } else if(trimmed.startsWith("-0x") || trimmed.startsWith("-0X")){
             LOG.finest("Parsing Hex value to BigInteger: " + value);
-            trimmed = trimmed.substring(3);
-            StringBuilder decimal = new StringBuilder();
-            for(int offset = 0;offset < trimmed.length();offset+=2){
-                if(offset==trimmed.length()-1){
-                    LOG.finest("Invalid Hex-Byte-String: " + trimmed);
-                    return null;
-                }
-                byte val = byteConverter.convert("0x" + trimmed.substring(offset, offset + 2), context);
-                if(val<10){
-                    decimal.append('0').append(val);
-                } else{
-                    decimal.append(val);
-                }
-            }
-            return new BigInteger('-' + decimal.toString());
+            return new BigInteger('-' + value.substring(3), 16);
         }
         try{
             return new BigInteger(trimmed);

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
index 1f0a128..ce1fed4 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
@@ -35,8 +35,9 @@ public class BooleanConverter implements PropertyConverter<Boolean> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public Boolean convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "yes (ignore case)", "y (ignore case)", "true (ignore case)", "t (ignore case)", "1", "no (ignore case)", "n (ignore case)", "false (ignore case)", "f (ignore case)", "0");
+    public Boolean convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "yes (ignore case)", "y (ignore case)", "true (ignore case)", "t (ignore case)", "1", "no (ignore case)", "n (ignore case)", "false (ignore case)", "f (ignore case)", "0"));
         String ignoreCaseValue = Objects.requireNonNull(value)
                                         .trim()
                                         .toLowerCase(Locale.ENGLISH);

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
index 81d9cc5..0e0e73c 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java
@@ -50,8 +50,9 @@ public class ByteConverter implements PropertyConverter<Byte>{
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public Byte convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(),"<byte>", "MIN_VALUE", "MIN", "MAX_VALUE", "MAX");
+    public Byte convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(),"<byte>", "MIN_VALUE", "MIN", "MAX_VALUE", "MAX"));
         String trimmed = Objects.requireNonNull(value).trim();
         switch(trimmed.toUpperCase(Locale.ENGLISH)){
             case "MIN_VALUE":

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CharConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CharConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CharConverter.java
index b17e959..2011fab 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CharConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CharConverter.java
@@ -41,8 +41,9 @@ public class CharConverter implements PropertyConverter<Character>{
     private static final Logger LOG = Logger.getLogger(CharConverter.class.getName());
 
     @Override
-    public Character convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(),"\\'<char>\\'", "<char>", "<charNum>");
+    public Character convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(),"\\'<char>\\'", "<char>", "<charNum>"));
         String trimmed = Objects.requireNonNull(value).trim();
         if(trimmed.isEmpty()){
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
index 7be9ec2..0f6011c 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java
@@ -39,11 +39,12 @@ public class ClassConverter implements PropertyConverter<Class<?>>{
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public Class<?> convert(String value, ConversionContext context) {
+    public Class<?> convert(String value) {
         if(value==null){
             return null;
         }
-        context.addSupportedFormats(getClass(),"<fullyQualifiedClassName>");
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(),"<fullyQualifiedClassName>"));
         String trimmed = Objects.requireNonNull(value).trim();
         try{
             return Class.forName(trimmed, false, Thread.currentThread().getContextClassLoader());

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ConvertQuery.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ConvertQuery.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ConvertQuery.java
index 6fb31c6..6da3e6b 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ConvertQuery.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ConvertQuery.java
@@ -48,20 +48,25 @@ final class ConvertQuery<T> implements ConfigQuery<T> {
     @Override
     public T query(Configuration config) {
         List<PropertyConverter<T>> converters = config.getContext().getPropertyConverters(type);
-        ConversionContext context = new ConversionContext.Builder(type).setConfigurationContext(config.getContext())
-                .setConfiguration(config).setKey(ConvertQuery.class.getName()).build();
-        for(PropertyConverter<?> conv: converters) {
-            try{
-                if(conv instanceof OptionalConverter){
-                    continue;
+        ConversionContext context = new ConversionContext.Builder(type).setConfiguration(config)
+                .setKey(ConvertQuery.class.getName()).build();
+        try {
+            ConversionContext.set(context);
+            for (PropertyConverter<?> conv : converters) {
+                try {
+                    if (conv instanceof OptionalConverter) {
+                        continue;
+                    }
+                    T result = (T) conv.convert(rawValue);
+                    if (result != null) {
+                        return result;
+                    }
+                } catch (Exception e) {
+                    LOG.log(Level.FINEST, e, () -> "Converter " + conv + " failed to convert to " + type);
                 }
-                T result = (T)conv.convert(rawValue, context);
-                if(result!=null){
-                    return result;
-                }
-            }catch(Exception e){
-                LOG.log(Level.FINEST,  e, () -> "Converter "+ conv +" failed to convert to " + type);
             }
+        }finally{
+            ConversionContext.reset();
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
index 15e10e0..0294d3d 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
@@ -44,8 +44,9 @@ public class CurrencyConverter implements PropertyConverter<Currency> {
     private static final Logger LOG = Logger.getLogger(CurrencyConverter.class.getName());
 
     @Override
-    public Currency convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<currencyCode>, using Locale.ENGLISH", "<numericValue>", "<locale>");
+    public Currency convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<currencyCode>, using Locale.ENGLISH", "<numericValue>", "<locale>"));
         String trimmed = Objects.requireNonNull(value).trim();
         try {
             return Currency.getInstance(trimmed.toUpperCase(Locale.ENGLISH));

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DoubleConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DoubleConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DoubleConverter.java
index 69c00a5..edf46a1 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DoubleConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DoubleConverter.java
@@ -52,8 +52,9 @@ public class DoubleConverter implements PropertyConverter<Double> {
     private final LongConverter integerConverter = new LongConverter();
 
     @Override
-    public Double convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<double>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE", "POSITIVE_INFINITY", "NEGATIVE_INFINITY", "NAN");
+    public Double convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<double>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE", "POSITIVE_INFINITY", "NEGATIVE_INFINITY", "NAN"));
         String trimmed = Objects.requireNonNull(value).trim();
         switch (trimmed.toUpperCase(Locale.ENGLISH)) {
             case "POSITIVE_INFINITY":
@@ -76,7 +77,7 @@ public class DoubleConverter implements PropertyConverter<Double> {
                     LOG.finest("Parsing of double as floating number failed, trying parsing integral" +
                             " number/hex instead...");
                 }
-                Long val = integerConverter.convert(trimmed, context);
+                Long val = integerConverter.convert(trimmed);
                 if(val!=null){
                     return val.doubleValue();
                 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
index 84fb184..cfbae48 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
@@ -37,9 +37,10 @@ public class DurationConverter implements PropertyConverter<Duration> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public Duration convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(),
-                Duration.of(1234, ChronoUnit.SECONDS).toString());
+    public Duration convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(),
+                Duration.of(1234, ChronoUnit.SECONDS).toString()));
         try {
             return Duration.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
index 4d69bff..e64b9d6 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
@@ -36,11 +36,12 @@ public class FileConverter implements PropertyConverter<File> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public File convert(String value, ConversionContext context) {
+    public File convert(String value) {
         if(value==null || value.isEmpty()){
             return null;
         }
-        context.addSupportedFormats(getClass(),"<File>");
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(),"<File>"));
         String trimmed = Objects.requireNonNull(value).trim();
         try {
             return new File(trimmed);

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
index f1c520e..b38d64c 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
@@ -52,8 +52,10 @@ public class FloatConverter implements PropertyConverter<Float> {
     private final IntegerConverter integerConverter = new IntegerConverter();
 
     @Override
-    public Float convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<float>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE", "POSITIVE_INFINITY", "NEGATIVE_INFINITY", "NAN");
+    public Float convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<float>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE",
+                        "POSITIVE_INFINITY", "NEGATIVE_INFINITY", "NAN"));
         String trimmed = Objects.requireNonNull(value).trim();
         switch(trimmed.toUpperCase(Locale.ENGLISH)){
             case "POSITIVE_INFINITY":
@@ -76,7 +78,7 @@ public class FloatConverter implements PropertyConverter<Float> {
                     LOG.finest("Parsing of float as floating number failed, trying parsing integral" +
                             " number/hex instead...");
                 }
-                Integer val = integerConverter.convert(trimmed, context);
+                Integer val = integerConverter.convert(trimmed);
                 if(val!=null) {
                     return val.floatValue();
                 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
index 588fddf..cfa1103 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
@@ -36,8 +36,9 @@ public class InstantConverter implements PropertyConverter<Instant> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public Instant convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), Instant.now().toString());
+    public Instant convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), Instant.now().toString()));
         try{
             return Instant.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
index ea3e6ea..93f5c0b 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
@@ -52,8 +52,9 @@ public class IntegerConverter implements PropertyConverter<Integer>{
     private static final Logger LOG = Logger.getLogger(IntegerConverter.class.getName());
 
     @Override
-    public Integer convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<int>", "MIN_VALUE", "MIN", "MAX_VALUE", "MAX");
+    public Integer convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<int>", "MIN_VALUE", "MIN", "MAX_VALUE", "MAX"));
         String trimmed = Objects.requireNonNull(value).trim();
         switch(trimmed.toUpperCase(Locale.ENGLISH)){
             case "MIN_VALUE":

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
index 4335a4a..1acb83e 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
@@ -36,8 +36,9 @@ public class LocalDateConverter implements PropertyConverter<LocalDate> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public LocalDate convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), LocalDate.now().toString());
+    public LocalDate convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), LocalDate.now().toString()));
         try{
             return LocalDate.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
index cedc121..bc64d6b 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
@@ -36,8 +36,9 @@ public class LocalDateTimeConverter implements PropertyConverter<LocalDateTime>
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public LocalDateTime convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), LocalDateTime.now().toString());
+    public LocalDateTime convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), LocalDateTime.now().toString()));
         try{
             return LocalDateTime.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
index af9ad3e..ab10e04 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
@@ -36,8 +36,9 @@ public class LocalTimeConverter implements PropertyConverter<LocalTime> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public LocalTime convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), LocalTime.now().toString());
+    public LocalTime convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), LocalTime.now().toString()));
         try{
             return LocalTime.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
index 3dbe432..3d42bfc 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
@@ -49,8 +49,9 @@ public class LongConverter implements PropertyConverter<Long>{
     private static final Logger LOGGER = Logger.getLogger(LongConverter.class.getName());
 
     @Override
-    public Long convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<long>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE");
+    public Long convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<long>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE"));
 
         String trimmed = Objects.requireNonNull(value).trim();
             switch (trimmed.toUpperCase(Locale.ENGLISH)) {

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
index 08c8760..c6c8de1 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
@@ -45,9 +45,10 @@ public class NumberConverter implements PropertyConverter<Number>{
     private final LongConverter longConverter = new LongConverter();
 
     @Override
-    public Number convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), "<double>, <long>", "0x (hex)", "0X... (hex)", "POSITIVE_INFINITY",
-                "NEGATIVE_INFINITY", "NAN");
+    public Number convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), "<double>, <long>", "0x (hex)", "0X... (hex)", "POSITIVE_INFINITY",
+                "NEGATIVE_INFINITY", "NAN"));
 
         String trimmed = Objects.requireNonNull(value).trim();
         switch(trimmed.toUpperCase(Locale.ENGLISH)) {
@@ -58,7 +59,7 @@ public class NumberConverter implements PropertyConverter<Number>{
             case "NAN":
                 return Double.NaN;
             default:
-                Long lVal = longConverter.convert(trimmed, context);
+                Long lVal = longConverter.convert(trimmed);
                 if (lVal != null) {
                     return lVal;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
index a0d6d7b..acdd0d5 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
@@ -36,8 +36,9 @@ public class OffsetDateTimeConverter implements PropertyConverter<OffsetDateTime
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public OffsetDateTime convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), OffsetDateTime.now().toString());
+    public OffsetDateTime convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), OffsetDateTime.now().toString()));
         try{
             return OffsetDateTime.parse(value);
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e45effd2/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
index e0e3276..74e9847 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
@@ -36,8 +36,9 @@ public class OffsetTimeConverter implements PropertyConverter<OffsetTime> {
     private final Logger LOG = Logger.getLogger(getClass().getName());
 
     @Override
-    public OffsetTime convert(String value, ConversionContext context) {
-        context.addSupportedFormats(getClass(), OffsetTime.now().toString());
+    public OffsetTime convert(String value) {
+        ConversionContext.doOptional(ctx ->
+                ctx.addSupportedFormats(getClass(), OffsetTime.now().toString()));
         try{
             return OffsetTime.parse(value);
         }catch(Exception e){



Mime
View raw message