From 9b0950af01f4e4313ac71417f66d6eb6acb8e772 Mon Sep 17 00:00:00 2001 From: Michiel Thomassen Date: Tue, 12 Mar 2024 00:25:51 +0100 Subject: [PATCH] Isolate Avro schema code generation when using multiple schema files Fixes #39344 --- .../io/quarkus/avro/deployment/AvroCodeGenProviderBase.java | 2 -- .../io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java b/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java index b9f29f2a61fb84..a98dab676d44d4 100644 --- a/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java +++ b/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java @@ -26,8 +26,6 @@ public abstract class AvroCodeGenProviderBase implements CodeGenProvider { private static final Logger log = Logger.getLogger(AvroCodeGenProviderBase.class); - public static final String[] EMPTY = new String[0]; - /** * The directory (within the java classpath) that contains the velocity * templates to use for code generation. diff --git a/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java b/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java index 2ceaf8d038dede..e7ac52c12b7e05 100644 --- a/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java +++ b/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java @@ -47,7 +47,7 @@ void compileSingleFile(Path filePath, // allow them to share a single schema so reuse and sharing of schema // is possible. try { - if (options.imports == EMPTY) { + if (options.imports == null || options.imports.length == 0) { schema = new Schema.Parser().parse(file); } else { schema = schemaParser.parse(file);