From 01ac66a8304b8b63100618869e12f7793cf524db Mon Sep 17 00:00:00 2001 From: leventov Date: Thu, 22 Oct 2015 16:44:05 +0300 Subject: [PATCH] Replace net.openhft.chronicle.hash.function.SerializableFunction usages with the same interface from Chronicle-Core, and delete net.openhft.chronicle.hash.function package --- .../hash/function/SerializableFunction.java | 26 ------------------- .../chronicle/hash/function/package-info.java | 20 -------------- .../chronicle/map/AbstractChronicleMap.java | 2 +- .../openhft/chronicle/map/ChronicleMap.java | 2 +- .../chronicle/map/CHMUseCasesTest.java | 2 +- .../net/openhft/chronicle/map/MarkTest.java | 9 ++++--- .../chronicle/map/ReplicationCheckingMap.java | 2 +- 7 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 src/main/java/net/openhft/chronicle/hash/function/SerializableFunction.java delete mode 100644 src/main/java/net/openhft/chronicle/hash/function/package-info.java diff --git a/src/main/java/net/openhft/chronicle/hash/function/SerializableFunction.java b/src/main/java/net/openhft/chronicle/hash/function/SerializableFunction.java deleted file mode 100644 index db391a401..000000000 --- a/src/main/java/net/openhft/chronicle/hash/function/SerializableFunction.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2015 higherfrequencytrading.com - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package net.openhft.chronicle.hash.function; - -import java.io.Serializable; -import java.util.function.Function; - -/** - * {@link Function} + {@link Serializable} - */ -public interface SerializableFunction extends Function, Serializable { -} diff --git a/src/main/java/net/openhft/chronicle/hash/function/package-info.java b/src/main/java/net/openhft/chronicle/hash/function/package-info.java deleted file mode 100644 index 802fb6b83..000000000 --- a/src/main/java/net/openhft/chronicle/hash/function/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2015 higherfrequencytrading.com - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -/** - * Serializable versions of functions for convenience of anonymous implementation - */ -package net.openhft.chronicle.hash.function; \ No newline at end of file diff --git a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java index 03496c13b..e7c8d5523 100644 --- a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java @@ -16,7 +16,7 @@ package net.openhft.chronicle.map; -import net.openhft.chronicle.hash.function.SerializableFunction; +import net.openhft.chronicle.core.util.SerializableFunction; import net.openhft.chronicle.hash.impl.util.CharSequences; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ChronicleMap.java index 2c6d70bb8..ac52276e4 100755 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMap.java @@ -16,8 +16,8 @@ package net.openhft.chronicle.map; +import net.openhft.chronicle.core.util.SerializableFunction; import net.openhft.chronicle.hash.ChronicleHash; -import net.openhft.chronicle.hash.function.SerializableFunction; import net.openhft.chronicle.hash.serialization.BytesReader; import net.openhft.lang.io.Bytes; import net.openhft.lang.io.serialization.BytesMarshaller; diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index b9ac23b24..3b1a7b8d4 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -17,7 +17,7 @@ package net.openhft.chronicle.map; import com.google.common.primitives.Chars; -import net.openhft.chronicle.hash.function.SerializableFunction; +import net.openhft.chronicle.core.util.SerializableFunction; import net.openhft.chronicle.hash.replication.SingleChronicleHashReplication; import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; import net.openhft.chronicle.map.fromdocs.BondVOInterface; diff --git a/src/test/java/net/openhft/chronicle/map/MarkTest.java b/src/test/java/net/openhft/chronicle/map/MarkTest.java index 8b961c470..61714c44e 100644 --- a/src/test/java/net/openhft/chronicle/map/MarkTest.java +++ b/src/test/java/net/openhft/chronicle/map/MarkTest.java @@ -16,7 +16,6 @@ package net.openhft.chronicle.map; -import net.openhft.chronicle.hash.function.SerializableFunction; import net.openhft.lang.MemoryUnit; import org.junit.Test; @@ -25,6 +24,7 @@ import java.io.IOException; import java.nio.file.Paths; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Function; import static org.junit.Assert.assertTrue; @@ -34,7 +34,7 @@ public class MarkTest { @Test(timeout = 25000) public void inMemoryTest() { - test(builder -> builder.create()); + test(ChronicleMapBuilder::create); } @Test @@ -59,8 +59,9 @@ public class MarkTest { } } - private static void test(SerializableFunction, - ChronicleMap> createMap) { + private static void test( + Function, ChronicleMap> + createMap) { long ms = System.currentTimeMillis(); try (ChronicleMap map = createMap.apply(ChronicleMapBuilder .of(Integer.class, Integer.class) diff --git a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java index 4e53d830c..d5bbafd02 100644 --- a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java +++ b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java @@ -17,7 +17,7 @@ package net.openhft.chronicle.map; import net.openhft.chronicle.core.io.Closeable; -import net.openhft.chronicle.hash.function.SerializableFunction; +import net.openhft.chronicle.core.util.SerializableFunction; import org.jetbrains.annotations.NotNull; import org.junit.Assert;