Skip to content

Commit

Permalink
Populate methods now always have 'customization' argument because
Browse files Browse the repository at this point in the history
deserialize-method(s) of nested records may generate another
populate methods that require 'customization' (at least for compilation).

This commits contains the fix.
  • Loading branch information
krisso-rtb committed Apr 29, 2024
1 parent 96cd780 commit ad53cc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
import org.testng.internal.collections.Pair;
Expand Down Expand Up @@ -882,7 +881,6 @@ void deserializeNullableFieldsPreviouslySerializedAsNotNull(boolean useFastSeria
Assert.assertEquals(outerRecord2.toString(), outerRecord1.toString());
}

@Ignore
@Test(groups = {"deserializationTest"})
void deserializeWithSchemaMissingDeeplyNestedRecord() throws IOException {
// duplicates prepare() just in case - .avsc files used here assume FIELDS_PER_POPULATION_METHOD is 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,16 @@ private void processRecord(JVar recordSchemaVar, String recordName, final Schema
popMethod._throws(IOException.class);
if (recordAction.getShouldRead()) {
popMethod.param(recordClass, recordName);
popMethod.param(codeModel.ref(DatumReaderCustomization.class), VAR_NAME_FOR_CUSTOMIZATION);
}
popMethod.param(codeModel.ref(DatumReaderCustomization.class), VAR_NAME_FOR_CUSTOMIZATION);
popMethod.param(Decoder.class, DECODER);
popMethodBody = popMethod.body();

JInvocation invocation = methodBody.invoke(popMethod);
if (recordAction.getShouldRead()) {
invocation.arg(JExpr.direct(recordName));
invocation.arg(customizationSupplier.get());
}
invocation.arg(customizationSupplier.get());
invocation.arg(JExpr.direct(DECODER));
}
FieldAction action = seekFieldAction(recordAction.getShouldRead(), field, actionIterator);
Expand Down

0 comments on commit ad53cc1

Please sign in to comment.