From 9df95c0fc3c5bddefed69d37c0f84624888a3eeb Mon Sep 17 00:00:00 2001 From: Speiger Date: Thu, 15 Dec 2022 16:26:05 +0100 Subject: [PATCH] Supplier now uses javas function name. Tests will still fail. --- .../java/speiger/src/builder/modules/FunctionModule.java | 2 ++ .../java/speiger/src/builder/modules/MapModule.java | 1 - .../collections/templates/functions/Supplier.template | 9 +-------- .../templates/maps/abstracts/AbstractMap.template | 2 +- .../maps/impl/concurrent/ConcurrentOpenHashMap.template | 4 ++-- .../maps/impl/customHash/OpenCustomHashMap.template | 4 ++-- .../templates/maps/impl/hash/OpenHashMap.template | 4 ++-- .../templates/maps/impl/misc/ArrayMap.template | 4 ++-- .../templates/maps/impl/misc/EnumMap.template | 4 ++-- .../templates/maps/impl/tree/AVLTreeMap.template | 4 ++-- .../templates/maps/impl/tree/RBTreeMap.template | 4 ++-- 11 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/builder/java/speiger/src/builder/modules/FunctionModule.java b/src/builder/java/speiger/src/builder/modules/FunctionModule.java index 7ddc456a..8926b6c5 100644 --- a/src/builder/java/speiger/src/builder/modules/FunctionModule.java +++ b/src/builder/java/speiger/src/builder/modules/FunctionModule.java @@ -54,6 +54,8 @@ public class FunctionModule extends BaseModule protected void loadFunctions() { addSimpleMapper("APPLY", keyType.getApply(valueType)); + addSimpleMapper("SUPPLY_GET", keyType.isObject() ? "get" : "getAs"+keyType.getCustomJDKType().getNonFileType()); + addSimpleMapper("VALUE_SUPPLY_GET", valueType.isObject() ? "get" : "getAs"+valueType.getCustomJDKType().getNonFileType()); } @Override diff --git a/src/builder/java/speiger/src/builder/modules/MapModule.java b/src/builder/java/speiger/src/builder/modules/MapModule.java index 5f162d5a..f697d2c9 100644 --- a/src/builder/java/speiger/src/builder/modules/MapModule.java +++ b/src/builder/java/speiger/src/builder/modules/MapModule.java @@ -214,7 +214,6 @@ public class MapModule extends BaseModule addFunctionValueMappers("FIRST_ENTRY_VALUE", "first%sValue"); if(keyType.isObject()) addFunctionValueMapper("GET_VALUE", valueType.isObject() ? "getObject" : "get"); else addSimpleMapper("GET_VALUE", "get"); - addSimpleMapper("GET_JAVA", keyType.isObject() ? "get" : "getAs"+keyType.getCustomJDKType().getNonFileType()); addFunctionMappers("LAST_ENTRY_KEY", "last%sKey"); addFunctionValueMappers("LAST_ENTRY_VALUE", "last%sValue"); addFunctionValueMapper("MERGE", "merge"); diff --git a/src/builder/resources/speiger/assets/collections/templates/functions/Supplier.template b/src/builder/resources/speiger/assets/collections/templates/functions/Supplier.template index c90c528f..22158d67 100644 --- a/src/builder/resources/speiger/assets/collections/templates/functions/Supplier.template +++ b/src/builder/resources/speiger/assets/collections/templates/functions/Supplier.template @@ -15,12 +15,5 @@ public interface SUPPLIER KEY_GENERIC_TYPE /** * @return the supplied value */ - public KEY_TYPE GET_KEY(); -#if JDK_TYPE && PRIMITIVES - - @Override - public default KEY_TYPE GET_JAVA() { - return GET_KEY(); - } -#endif + public KEY_TYPE SUPPLY_GET(); } \ No newline at end of file diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template index 0916c8e5..77300780 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template @@ -233,7 +233,7 @@ public abstract class ABSTRACT_MAP KEY_VALUE_GENERIC_TYPE extends AbstractMap