From 16ec8678756bb5a1cf0b35d15ba71d0de1b4b9fa Mon Sep 17 00:00:00 2001 From: yusu Date: Mon, 5 Feb 2024 15:58:51 +0800 Subject: [PATCH] Add support for array type --- .../engine/process/preruntime/generator/code/ClassTarget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/compileflow/engine/process/preruntime/generator/code/ClassTarget.java b/src/main/java/com/alibaba/compileflow/engine/process/preruntime/generator/code/ClassTarget.java index 23eb8dd..a77e4d5 100644 --- a/src/main/java/com/alibaba/compileflow/engine/process/preruntime/generator/code/ClassTarget.java +++ b/src/main/java/com/alibaba/compileflow/engine/process/preruntime/generator/code/ClassTarget.java @@ -217,7 +217,9 @@ public String generateCode() { } private String getImportName(ClassWrapper importType) { - return importType.getPackageName() + "." + importType.getShortRawName(); + int index = importType.getShortRawName().indexOf("[]"); + return index == -1 ? importType.getPackageName() + "." + importType.getShortRawName() + : importType.getPackageName() + "." + importType.getShortRawName().substring(0, index); } private boolean notContainImportedType(ClassWrapper classWrapper) {