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
  • Loading branch information
Michiel Thomassen authored and Michiel Thomassen committed Mar 11, 2024
1 parent 5c25ff5 commit 0aa6ad4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions 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 @@ -7,6 +7,7 @@
import org.apache.avro.Conversions;
import org.apache.avro.Schema;
import org.apache.avro.compiler.specific.SpecificCompiler;
import org.apache.commons.lang3.ArrayUtils;

import io.quarkus.bootstrap.prebuild.CodeGenException;
import io.quarkus.deployment.CodeGenProvider;
Expand Down Expand Up @@ -47,7 +48,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 (ArrayUtils.isEmpty(options.imports)) {
schema = new Schema.Parser().parse(file);
} else {
schema = schemaParser.parse(file);
Expand Down

0 comments on commit 0aa6ad4

Please sign in to comment.