From 207c30674873c8c153e5b156fe7a41651a5a5c12 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Tue, 5 Dec 2023 14:49:26 +0300 Subject: [PATCH] Incorrect toString for org.jacodb.api.cfg.JcNewArrayExpr #206 --- jacodb-api/src/main/kotlin/org/jacodb/api/cfg/JcInst.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jacodb-api/src/main/kotlin/org/jacodb/api/cfg/JcInst.kt b/jacodb-api/src/main/kotlin/org/jacodb/api/cfg/JcInst.kt index 9ee3c27d7..74bedf74e 100644 --- a/jacodb-api/src/main/kotlin/org/jacodb/api/cfg/JcInst.kt +++ b/jacodb-api/src/main/kotlin/org/jacodb/api/cfg/JcInst.kt @@ -615,9 +615,9 @@ data class JcNewArrayExpr( companion object { private val regexToProcessDimensions = Regex("\\[(.*?)]") - private fun arrayTypeToStringWithDimensions(typeName: String, dimensions: List) { + private fun arrayTypeToStringWithDimensions(typeName: String, dimensions: List): String { var curDim = 0 - regexToProcessDimensions.replace(typeName) { + return regexToProcessDimensions.replace(typeName) { "[${dimensions.getOrNull(curDim++) ?: ""}]" } }