From 46bef4bfcc929539f07130cd68ac0222aba75dc2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Nov 2023 19:28:23 +0800 Subject: [PATCH] minor fix --- .../java/org/openapitools/codegen/DefaultGenerator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 7176d8faf023..a8d383fdb199 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -36,7 +36,6 @@ import org.openapitools.codegen.api.TemplateDefinition; import org.openapitools.codegen.api.TemplatePathLocator; import org.openapitools.codegen.api.TemplateProcessor; -import org.openapitools.codegen.config.GeneratorSettings; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.api.TemplateFileType; @@ -64,6 +63,7 @@ import java.io.*; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.nio.file.Path; import java.time.ZonedDateTime; import java.util.*; @@ -785,8 +785,8 @@ private void generateOpenAPIGeneratorIgnoreFile() { "# IMPORTANT: this file is generated with the option `openapiGeneratorIgnoreList` enabled", "# (--openapi-generator-ignore-list in CLI for example) so the entries below are pre-populated based", "# on the input provided by the users and this file will be overwritten every time when the option is", - "# enabled (which is the exact opposite of the default behaviour to not overwrite" + - "# .openapi-generator-ignore if the file exists).", + "# enabled (which is the exact opposite of the default behaviour to not overwrite", + "# .openapi-generator-ignore if the file exists).", "", "# OpenAPI Generator Ignore", "# Generated by openapi-generator https://github.com/openapitools/openapi-generator", @@ -815,7 +815,7 @@ private void generateOpenAPIGeneratorIgnoreFile() { "# The following entries are pre-populated based on the input obtained via", "# the option `openapiGeneratorIgnoreList` (--openapi-generator-ignore-list in CLI for example).", ""); - FileWriter fileWriter = new FileWriter(ignoreFile); + Writer fileWriter = Files.newBufferedWriter(ignoreFile.toPath(), StandardCharsets.UTF_8); fileWriter.write(header); // add entries provided by the users for (String entry: config.getOpenAPIGeneratorIgnoreList()) {