From 4fed2c31aa89002f58cc55f17d39608a6f7ca50a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 2 Aug 2024 14:49:41 +0800 Subject: [PATCH] fix fluent --- .../java/com/azure/autorest/util/ClientModelUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/javagen/src/main/java/com/azure/autorest/util/ClientModelUtil.java b/javagen/src/main/java/com/azure/autorest/util/ClientModelUtil.java index 55d3be4e30..73e1011134 100644 --- a/javagen/src/main/java/com/azure/autorest/util/ClientModelUtil.java +++ b/javagen/src/main/java/com/azure/autorest/util/ClientModelUtil.java @@ -262,12 +262,14 @@ public static String getBuilderSuffix() { public static String getServiceClientBuilderPackageName(ServiceClient serviceClient) { JavaSettings settings = JavaSettings.getInstance(); String builderPackage = serviceClient.getPackage(); - if (serviceClient.getBuilderPackageName() != null) { - builderPackage = serviceClient.getBuilderPackageName(); - } else if (settings.isFluent()) { + if (settings.isFluent()) { builderPackage = settings.getPackage(settings.getImplementationSubpackage()); } else if (settings.isGenerateSyncAsyncClients() || settings.isDataPlaneClient()) { - builderPackage = settings.getPackage(); + if (serviceClient.getBuilderPackageName() != null) { + builderPackage = serviceClient.getBuilderPackageName(); + } else { + builderPackage = settings.getPackage(); + } } return builderPackage; }