mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
REVIEW COMMENTS
Remove the recursive call from directly inside the string builder
This commit is contained in:
parent
b8ae03410d
commit
96496fdeb5
@ -23,8 +23,13 @@ open class ArraySerializer(override val type: Type, factory: SerializerFactory)
|
||||
// We *need* to retain knowledge for AMQP deserialisation weather that lowest primitive
|
||||
// was boxed or unboxed so just infer it recursively
|
||||
private fun calcTypeName(type: Type) : String =
|
||||
if (type.componentType().isArray()) "${calcTypeName(type.componentType())}[]"
|
||||
else "${type.componentType().typeName}${if (type.asClass()!!.componentType.isPrimitive) "[p]" else "[]"}"
|
||||
if (type.componentType().isArray()) {
|
||||
val typeName = calcTypeName(type.componentType()); "$typeName[]"
|
||||
}
|
||||
else {
|
||||
val arrayType = if (type.asClass()!!.componentType.isPrimitive) "[p]" else "[]"
|
||||
"${type.componentType().typeName}$arrayType"
|
||||
}
|
||||
|
||||
override val typeDescriptor by lazy { "$DESCRIPTOR_DOMAIN:${fingerprintForType(type, factory)}" }
|
||||
internal val elementType: Type by lazy { type.componentType() }
|
||||
|
Loading…
Reference in New Issue
Block a user