tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject incubator-tamaya git commit: Removed Java8 deps in Java 7 part, fixed maven pom JDK version dep in Java 7 area (thanks to @pmascha).
Date Wed, 29 Apr 2015 18:13:32 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master e464bc593 -> 56c6eb2bf


Removed Java8 deps in Java 7 part, fixed maven pom JDK version dep in Java 7 area (thanks
to @pmascha).


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

Branch: refs/heads/master
Commit: 56c6eb2bf984c02d3c4d845855dc1f76ab9189ce
Parents: e464bc5
Author: anatole <anatole@apache.org>
Authored: Wed Apr 29 20:13:20 2015 +0200
Committer: anatole <anatole@apache.org>
Committed: Wed Apr 29 20:13:20 2015 +0200

----------------------------------------------------------------------
 .../core/internal/PropertyConverterManager.java | 11 +++--
 .../internal/converters/ByteConverterTest.java  |  3 --
 .../internal/converters/CharConverterTest.java  |  4 +-
 .../converters/DoubleConverterTest.java         |  4 +-
 .../internal/converters/FloatConverterTest.java |  4 +-
 java7/pom.xml                                   | 49 +++++++++-----------
 6 files changed, 30 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
----------------------------------------------------------------------
diff --git a/java7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
b/java7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
index 17d2293..7da86f9 100644
--- a/java7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
+++ b/java7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
@@ -30,7 +30,8 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.StampedLock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.logging.Logger;
 
 import org.apache.tamaya.ConfigException;
@@ -49,7 +50,7 @@ public class PropertyConverterManager {
     /** The registered converters. */
     private Map<TypeLiteral<?>, List<PropertyConverter<?>>> converters
= new ConcurrentHashMap<>();
     /** The lock used. */
-    private StampedLock lock = new StampedLock();
+    private ReadWriteLock lock = new ReentrantReadWriteLock();
     /**
      * Constructor.
      */
@@ -82,7 +83,7 @@ public class PropertyConverterManager {
      */
     public <T> void register(TypeLiteral<T> targetType, PropertyConverter<T>
converter) {
         Objects.requireNonNull(converter);
-        Lock writeLock = lock.asWriteLock();
+        Lock writeLock = lock.writeLock();
         try {
             writeLock.lock();
             List<PropertyConverter<T>> converters = List.class.cast(this.converters.get(targetType));
@@ -117,7 +118,7 @@ public class PropertyConverterManager {
      * @see #createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral)
      */
     public Map<TypeLiteral<?>, List<PropertyConverter<?>>> getPropertyConverters()
{
-        Lock readLock = lock.asReadLock();
+        Lock readLock = lock.readLock();
         try {
             readLock.lock();
             return new HashMap<>(this.converters);
@@ -137,7 +138,7 @@ public class PropertyConverterManager {
      * @see #createDefaultPropertyConverter(org.apache.tamaya.TypeLiteral)
      */
     public <T> List<PropertyConverter<T>> getPropertyConverters(TypeLiteral<T>
targetType) {
-        Lock readLock = lock.asReadLock();
+        Lock readLock = lock.readLock();
         List<PropertyConverter<T>> converters;
         try {
             readLock.lock();

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/ByteConverterTest.java
----------------------------------------------------------------------
diff --git a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/ByteConverterTest.java
b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/ByteConverterTest.java
index b0b6cb8..132674d 100644
--- a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/ByteConverterTest.java
+++ b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/ByteConverterTest.java
@@ -22,10 +22,7 @@ import org.apache.tamaya.Configuration;
 import org.apache.tamaya.ConfigurationProvider;
 import org.junit.Test;
 
-import java.util.Optional;
-
 import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Tests the default converter for bytes.

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/CharConverterTest.java
----------------------------------------------------------------------
diff --git a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/CharConverterTest.java
b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/CharConverterTest.java
index 6ae1222..f27a465 100644
--- a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/CharConverterTest.java
+++ b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/CharConverterTest.java
@@ -22,8 +22,6 @@ import org.apache.tamaya.Configuration;
 import org.apache.tamaya.ConfigurationProvider;
 import org.junit.Test;
 
-import java.util.Optional;
-
 import static org.junit.Assert.*;
 
 /**
@@ -85,4 +83,4 @@ public class CharConverterTest {
         Character valueRead = config.get("tests.converter.char.foo", Character.class);
         assertNull(valueRead);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/DoubleConverterTest.java
----------------------------------------------------------------------
diff --git a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/DoubleConverterTest.java
b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/DoubleConverterTest.java
index 9c585f8..ee2f33a 100644
--- a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/DoubleConverterTest.java
+++ b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/DoubleConverterTest.java
@@ -22,8 +22,6 @@ import org.apache.tamaya.Configuration;
 import org.apache.tamaya.ConfigurationProvider;
 import org.junit.Test;
 
-import java.util.Optional;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -174,4 +172,4 @@ public class DoubleConverterTest {
         assertEquals(Double.NEGATIVE_INFINITY, valueRead.doubleValue(),0.0d);
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/FloatConverterTest.java
----------------------------------------------------------------------
diff --git a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/FloatConverterTest.java
b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/FloatConverterTest.java
index b8ae8b5..98ea720 100644
--- a/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/FloatConverterTest.java
+++ b/java7/core/src/test/java/org/apache/tamaya/core/internal/converters/FloatConverterTest.java
@@ -22,8 +22,6 @@ import org.apache.tamaya.Configuration;
 import org.apache.tamaya.ConfigurationProvider;
 import org.junit.Test;
 
-import java.util.Optional;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -175,4 +173,4 @@ public class FloatConverterTest {
         assertEquals(Float.NEGATIVE_INFINITY, valueRead.floatValue(),0.0f);
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56c6eb2b/java7/pom.xml
----------------------------------------------------------------------
diff --git a/java7/pom.xml b/java7/pom.xml
index 740ff1d..52e4fbe 100644
--- a/java7/pom.xml
+++ b/java7/pom.xml
@@ -42,6 +42,27 @@ under the License.
     </modules>
 
     <build>
+        <plugins>
+            <plugin>
+                <!-- use java7 to compile the modules in this tree -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-toolchains-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>toolchain</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <toolchains>
+                        <jdk>
+                            <version>[1.7,1.8)</version>
+                        </jdk>
+                    </toolchains>
+                </configuration>
+            </plugin>
+        </plugins>
         <pluginManagement>
             <plugins>
                 <plugin>
@@ -78,32 +99,4 @@ under the License.
             </plugins>
         </pluginManagement>
     </build>
-    <profiles>
-        <profile>
-            <id>java7</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <!-- use java7 to compile the modules in this tree -->
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-toolchains-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>toolchain</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <toolchains>
-                                <jdk>
-                                    <version>[1.7,)</version>
-                                </jdk>
-                            </toolchains>
-                        </configuration>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
 </project>


Mime
View raw message