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; }