From c64d775aaa454dfde3a5fd9fd7b627db24ede4f2 Mon Sep 17 00:00:00 2001 From: tangjiangling Date: Sun, 28 Aug 2022 23:36:16 +0800 Subject: [PATCH 1/2] Fix typo in BytecodeUtils --- .../src/main/java/io/trino/sql/gen/BytecodeUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java b/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java index 38a6b7512f5a..5a00625a815f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java +++ b/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java @@ -354,7 +354,7 @@ else if (type == ConnectorSession.class) { lambdaArgumentIndex++; break; default: - throw new UnsupportedOperationException(format("Unsupported argument conventsion type: %s", invocationConvention.getArgumentConvention(realParameterIndex))); + throw new UnsupportedOperationException(format("Unsupported argument convention type: %s", invocationConvention.getArgumentConvention(realParameterIndex))); } realParameterIndex++; } From c5e8917a769086ed5e0af90346988e7fc556ba87 Mon Sep 17 00:00:00 2001 From: tangjiangling Date: Sun, 28 Aug 2022 23:36:40 +0800 Subject: [PATCH 2/2] Remove unused method in BytecodeUtils `BytecodeUtils#boxPrimitiveis` was introduced in commit 654899e0 and then the reference to that method was removed in commit 863d4d88, so we can delete it. --- .../java/io/trino/sql/gen/BytecodeUtils.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java b/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java index 5a00625a815f..e3d10fef72f7 100644 --- a/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java +++ b/core/trino-main/src/main/java/io/trino/sql/gen/BytecodeUtils.java @@ -125,25 +125,6 @@ public static BytecodeNode handleNullValue( .ifTrue(isNull); } - public static BytecodeNode boxPrimitive(Class type) - { - BytecodeBlock block = new BytecodeBlock().comment("box primitive"); - if (type == long.class) { - return block.invokeStatic(Long.class, "valueOf", Long.class, long.class); - } - if (type == double.class) { - return block.invokeStatic(Double.class, "valueOf", Double.class, double.class); - } - if (type == boolean.class) { - return block.invokeStatic(Boolean.class, "valueOf", Boolean.class, boolean.class); - } - if (type.isPrimitive()) { - throw new UnsupportedOperationException("not yet implemented: " + type); - } - - return NOP; - } - public static BytecodeNode unboxPrimitive(Class unboxedType) { BytecodeBlock block = new BytecodeBlock().comment("unbox primitive");