From d63d0de61f079feabf44e3c101ecc6465cba670d Mon Sep 17 00:00:00 2001 From: Oscar Westra van Holthe - Kind Date: Wed, 9 Mar 2022 07:41:05 +0100 Subject: [PATCH] AVRO-3403: Fix bug on Travis The build on Travis compiles files in a different order, causing the tested new log lines to appear in the 'wrong' order. This removes these new log lines. --- .../main/java/org/apache/avro/mojo/IDLProtocolMojo.java | 8 +------- .../java/org/apache/avro/mojo/TestIDLProtocolMojo.java | 8 +++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java index 150e03219e9..0543811400d 100644 --- a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java +++ b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java @@ -24,10 +24,8 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; import org.apache.avro.Protocol; -import org.apache.avro.Schema; import org.apache.avro.compiler.specific.SpecificCompiler; import org.apache.avro.generic.GenericData; @@ -91,12 +89,8 @@ protected void doCompile(String filename, File sourceDirectory, File outputDirec for (String warning : idlFile.getWarnings()) { getLog().warn(warning); } - final SpecificCompiler compiler; final Protocol protocol = idlFile.getProtocol(); - getLog().info("Compiling protocol: " + protocol.getNamespace() + "." + protocol.getName()); - getLog().info( - "Schema names: " + protocol.getTypes().stream().map(Schema::getFullName).collect(Collectors.joining(", "))); - compiler = new SpecificCompiler(protocol); + final SpecificCompiler compiler = new SpecificCompiler(protocol); compiler.setStringType(GenericData.StringType.valueOf(stringType)); compiler.setTemplateDir(templateDirectory); compiler.setFieldVisibility(getFieldVisibility()); diff --git a/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLProtocolMojo.java b/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLProtocolMojo.java index acdecf5a3ac..168f4065232 100644 --- a/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLProtocolMojo.java +++ b/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLProtocolMojo.java @@ -21,6 +21,7 @@ import org.junit.Test; import java.io.File; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -52,11 +53,8 @@ public void testIdlProtocolMojo() throws Exception { final String idlUserContent = FileUtils.fileRead(new File(outputDir, "IdlUser.java")); assertTrue(idlUserContent.contains("java.time.Instant")); - assertEquals(asList("[INFO] Compiling protocol: test.IdlTest", "[INFO] Schema names: test.IdlPrivacy, test.IdlUser", - "[WARN] Line 22, char 5: Ignoring out-of-place documentation comment.\n" - + "Did you mean to use a multiline comment ( /* ... */ ) instead?", - "[INFO] Compiling protocol: test.IdlClasspathImportTest", - "[INFO] Schema names: test.IdlPrivacy, test.IdlUser, test.IdlUserWrapper"), log.getLogEntries()); + assertEquals(Collections.singletonList("[WARN] Line 22, char 5: Ignoring out-of-place documentation comment.\n" + + "Did you mean to use a multiline comment ( /* ... */ ) instead?"), log.getLogEntries()); } @Test