Skip to content

Commit

Permalink
Isolate Avro schema code generation when using multiple schema files
Browse files Browse the repository at this point in the history
Fixes #39344
  • Loading branch information
Michiel Thomassen authored and gsmet committed Mar 13, 2024
1 parent f82cb64 commit 9b0950a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b0950a

Please sign in to comment.