From d22633c06c4148f251b72b112420e4b1dfc144b0 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 b9f29f2a61fb8..a98dab676d44d 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 2ceaf8d038ded..e7ac52c12b7e0 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);