Skip to content

Commit

Permalink
Merge pull request #983 from dilanSachi/fix-type-desc-hang
Browse files Browse the repository at this point in the history
Fix runtime type desc resolution related to lang change
  • Loading branch information
dilanSachi committed Aug 21, 2023
2 parents e006fdc + 0bfd0f3 commit c1b4fa4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.caching=true
group=io.ballerina.stdlib
version=3.10.0-SNAPSHOT
kafkaVersion=2.8.0
ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796
ballerinaLangVersion=2201.8.0-20230820-223300-6d331d48
ballerinaGradlePluginVersion=2.0.1

puppycrawlCheckstyleVersion=10.12.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.IntersectionType;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BDecimal;
import io.ballerina.runtime.api.values.BError;
Expand Down Expand Up @@ -96,7 +97,7 @@ public static Object pollPayload(Environment env, BObject consumerObject, BDecim
try {
Duration duration = Duration.ofMillis(getMilliSeconds(timeout));
ConsumerRecords recordsRetrieved = kafkaConsumer.poll(duration);
ArrayType arrayType = (ArrayType) bTypedesc.getDescribingType();
ArrayType arrayType = (ArrayType) TypeUtils.getImpliedType(bTypedesc.getDescribingType());
BArray dataArray = ValueCreator.createArrayValue(arrayType);
boolean constraintValidation = (boolean) consumerObject.getMapValue(CONSUMER_CONFIG_FIELD_NAME)
.get(CONSTRAINT_VALIDATION);
Expand All @@ -121,11 +122,12 @@ public static Object pollPayload(Environment env, BObject consumerObject, BDecim
private static RecordType getRecordType(BTypedesc bTypedesc) {
RecordType recordType;
if (bTypedesc.getDescribingType().isReadOnly()) {
recordType = (RecordType) getReferredType(((IntersectionType) getReferredType(((ArrayType) getReferredType(
bTypedesc.getDescribingType())).getElementType())).getConstituentTypes().get(0));
recordType = (RecordType) getReferredType(((IntersectionType) getReferredType(((ArrayType)
TypeUtils.getImpliedType(bTypedesc.getDescribingType())).getElementType()))
.getConstituentTypes().get(0));
} else {
recordType = (RecordType) getReferredType(
((ArrayType) getReferredType(bTypedesc.getDescribingType())).getElementType());
((ArrayType) getReferredType(bTypedesc.getDescribingType())).getElementType());
}
return recordType;
}
Expand Down

0 comments on commit c1b4fa4

Please sign in to comment.