From c379624399eb2a7054e2f3267de278754a4005b6 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Mon, 5 Aug 2024 21:38:13 +0300 Subject: [PATCH 1/9] Update code to match ArkAnalyzer upstream Remove fields initializers (moved into special init method). Make Method's body nullable since it might be absent. Bump ArkAnalyzer, switch to using a special neo-branch in the fork. Update JSON dumps of ArkIR for samples. Use kotlin("test") for Kotlin-style assertions in tests. --- .github/workflows/build-and-test.yml | 16 +- buildSrc/src/main/kotlin/Tests.kt | 2 + jacodb-ets/build.gradle.kts | 1 + .../main/kotlin/org/jacodb/ets/base/EtsRef.kt | 2 +- .../main/kotlin/org/jacodb/ets/dto/Convert.kt | 82 +- .../main/kotlin/org/jacodb/ets/dto/Model.kt | 3 +- .../org/jacodb/ets/utils/EtsFileDtoToDot.kt | 114 +- .../kotlin/org/jacodb/ets/test/EtsFileTest.kt | 132 +- .../org/jacodb/ets/test/EtsFromJsonTest.kt | 9 +- .../kotlin/org/jacodb/ets/test/utils/Dot.kt | 14 +- .../org/jacodb/ets/test/utils/LoadEts.kt | 4 +- .../etsir/samples/DataFlowSecurity.ts.json | 25 +- .../etsir/samples/DefaultConstructor.ts.json | 117 - .../etsir/samples/MethodCollision.ts.json | 318 +- .../etsir/samples/StaticField.ts.json | 183 - .../etsir/samples/TypeMismatch.ts.json | 2 +- .../etsir/samples/binary/Bitwise.ts.json | 179 +- .../etsir/samples/binary/Division.ts.json | 42 +- .../etsir/samples/binary/Subtraction.ts.json | 42 +- .../etsir/samples/cases/case1.ts.json | 107 +- .../etsir/samples/cases/case2.ts.json | 1191 ++- .../etsir/samples/cases/case3.ts.json | 340 +- .../etsir/samples/catch/TryCatch.ts.json | 150 +- .../samples/catch/TryCatchFinally.ts.json | 201 +- .../samples/catch/TryCatchMultiple.ts.json | 278 +- .../samples/catch/TryCatchNested.ts.json | 178 +- .../etsir/samples/catch/TryFinally.ts.json | 178 +- .../samples/classes/AbstractClass.ts.json | 315 +- .../samples/classes/AccessModifiers.ts.json | 186 +- .../samples/classes/ConstructorClass.ts.json | 180 +- .../samples/classes/GenericClass.ts.json | 204 +- .../samples/classes/InheritanceClass.ts.json | 307 +- .../classes/InterfaceImplementation.ts.json | 214 +- .../etsir/samples/classes/SimpleClass.ts.json | 220 +- .../samples/classes/SingletonClass.ts.json | 226 +- .../etsir/samples/classes/StaticClass.ts.json | 266 +- .../resources/etsir/samples/enums.ts.json | 2026 ----- ...itializer.ts.json => initializers.ts.json} | 218 +- .../samples/loop/BreadthFirstSearch.ts.json | 1280 +++- .../samples/loop/DepthFirstSearch.ts.json | 1759 ++++- .../samples/loop/DijkstrasAlgorithm.ts.json | 864 ++- .../etsir/samples/loop/DoWhileLoop.ts.json | 56 +- .../etsir/samples/loop/ForInLoop.ts.json | 575 +- .../samples/loop/MatrixMultiplication.ts.json | 1027 ++- .../etsir/samples/loop/NestedLoops.ts.json | 718 +- .../etsir/samples/loop/WhileLoop.ts.json | 35 +- .../resources/etsir/samples/object.ts.json | 545 +- .../etsir/samples/{ => save}/basic.ts.json | 6530 ++++++++++++----- .../etsir/samples/save/enums.ts.json | 2144 ++++++ .../resources/etsir/samples/taint.ts.json | 25 +- .../resources/samples/DefaultConstructor.ts | 3 - .../resources/samples/PrependInitializer.ts | 18 - .../src/test/resources/samples/StaticField.ts | 6 - .../src/test/resources/samples/enums.ts | 104 - .../test/resources/samples/initializers.ts | 19 + .../resources/samples/{ => save}/basic.ts | 1 + .../src/test/resources/samples/save/enums.ts | 45 + .../src/test/resources/samples/taint.ts | 16 +- jacodb-ets/src/test/resources/structure.txt | 38 + 59 files changed, 15765 insertions(+), 8315 deletions(-) delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/enums.ts.json rename jacodb-ets/src/test/resources/etsir/samples/{PrependInitializer.ts.json => initializers.ts.json} (69%) rename jacodb-ets/src/test/resources/etsir/samples/{ => save}/basic.ts.json (66%) create mode 100644 jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json delete mode 100644 jacodb-ets/src/test/resources/samples/DefaultConstructor.ts delete mode 100644 jacodb-ets/src/test/resources/samples/PrependInitializer.ts delete mode 100644 jacodb-ets/src/test/resources/samples/StaticField.ts delete mode 100644 jacodb-ets/src/test/resources/samples/enums.ts create mode 100644 jacodb-ets/src/test/resources/samples/initializers.ts rename jacodb-ets/src/test/resources/samples/{ => save}/basic.ts (99%) create mode 100644 jacodb-ets/src/test/resources/samples/save/enums.ts create mode 100644 jacodb-ets/src/test/resources/structure.txt diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ebd4a2a9f..287115102 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -57,13 +57,14 @@ jobs: - name: Set up ArkAnalyzer run: | - REPO_URL="https://gitee.com/openharmony-sig/arkanalyzer.git" + REPO_URL="https://gitee.com/Lipenx/arkanalyzer.git" DEST_DIR="arkanalyzer" MAX_RETRIES=10 RETRY_DELAY=3 # Delay between retries in seconds + BRANCH="neo/2024-08-06" for ((i=1; i<=MAX_RETRIES; i++)); do - git clone --depth=1 $REPO_URL $DEST_DIR && break + git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break echo "Clone failed, retrying in $RETRY_DELAY seconds..." sleep "$RETRY_DELAY" done @@ -78,17 +79,6 @@ jobs: echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV cd $DEST_DIR - # checkout master on 2024-07-17 - rev=a9d9fd6070fce5896d8e760ed7fd175b62b16605 - - for ((i=1; i<=MAX_RETRIES; i++)); do - git fetch --depth=1 origin $rev && break - echo "Fetch failed, retrying in $RETRY_DELAY seconds..." - sleep "$RETRY_DELAY" - done - - git switch --detach $rev - npm install npm run build diff --git a/buildSrc/src/main/kotlin/Tests.kt b/buildSrc/src/main/kotlin/Tests.kt index 109b15574..0c913b952 100644 --- a/buildSrc/src/main/kotlin/Tests.kt +++ b/buildSrc/src/main/kotlin/Tests.kt @@ -1,5 +1,6 @@ import org.gradle.api.tasks.TaskProvider import org.gradle.api.tasks.testing.Test +import org.gradle.api.tasks.testing.logging.TestExceptionFormat import java.util.* object Tests { @@ -10,6 +11,7 @@ object Tests { fun Test.setup(jacocoTestReport: TaskProvider<*>) { testLogging { events("passed", "skipped", "failed") + exceptionFormat = TestExceptionFormat.FULL } finalizedBy(jacocoTestReport) // report is always generated after tests run val majorJavaVersion = diff --git a/jacodb-ets/build.gradle.kts b/jacodb-ets/build.gradle.kts index 951e7dd33..7d63f4162 100644 --- a/jacodb-ets/build.gradle.kts +++ b/jacodb-ets/build.gradle.kts @@ -13,6 +13,7 @@ dependencies { implementation(Libs.kotlinx_serialization_json) implementation(Libs.jdot) + testImplementation(kotlin("test")) testImplementation(project(":jacodb-analysis")) testImplementation(testFixtures(project(":jacodb-core"))) testImplementation(Libs.mockk) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt index bba2641be..72a98493a 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt @@ -67,7 +67,7 @@ interface EtsFieldRef : EtsRef, EtsLValue { } data class EtsInstanceFieldRef( - val instance: EtsEntity, // Local + val instance: EtsLocal, override val field: EtsFieldSignature, ) : EtsFieldRef { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index e4b701aef..ca469a61d 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -339,6 +339,11 @@ class EtsMethodBuilder( // so we just *unsafely* extract the type name from the "pseudo-local" here: "instanceof" -> EtsInstanceOfExpr(left, (right as EtsLocal).name) + // TODO: Currently, ArkIR treats "in" operation just as BinopExpr. + // Ideally, it would be represented as a separate `ArkInExpr`, + // or at least as `ArkConditionExpr`, since it inherently has a boolean type. + Ops.IN -> EtsInExpr(left, right) // Note: `type` is ignored here! + else -> error("Unknown binop: ${value.op}") } } @@ -356,7 +361,10 @@ class EtsMethodBuilder( Ops.LT_EQ -> EtsLtEqExpr(left, right) Ops.GT -> EtsGtExpr(left, right) Ops.GT_EQ -> EtsGtEqExpr(left, right) - Ops.IN -> EtsInExpr(left, right) + + // TODO: see above + // Ops.IN -> EtsInExpr(left, right) + else -> error("Unknown relop: ${value.op}") } } @@ -401,7 +409,7 @@ class EtsMethodBuilder( val field = convertToEtsFieldSignature(fieldRef.field) return when (fieldRef) { is InstanceFieldRefDto -> EtsInstanceFieldRef( - instance = convertToEtsEntity(fieldRef.instance), // as Local + instance = convertToEtsEntity(fieldRef.instance) as EtsLocal, // safe cast field = field, ) @@ -470,7 +478,7 @@ fun convertToEtsClass(classDto: ClassDto): EtsClass { successors = emptyList(), predecessors = emptyList(), stmts = listOf( - ReturnStmtDto(arg = ThisRefDto(type = ClassTypeDto(classSignatureDto))) + ReturnVoidStmtDto ) ) val cfg = CfgDto(blocks = listOf(zeroBlock)) @@ -489,69 +497,34 @@ fun convertToEtsClass(classDto: ClassDto): EtsClass { ) } - fun isStaticField(field: FieldDto): Boolean { - val modifiers = field.modifiers ?: return false - return modifiers.contains(ModifierDto.StringItem("StaticKeyword")) - } - val signature = EtsClassSignature( name = classDto.signature.name, namespace = null, // TODO file = null, // TODO ) - - val superclassSignature = classDto.superClassName?.takeIf { it != "" }?.let { spName -> + val superClassSignature = classDto.superClassName?.takeIf { it != "" }?.let { name -> EtsClassSignature( - name = spName, + name = name, namespace = null, // TODO file = null, // TODO ) } + val fields = classDto.fields.map { convertToEtsField(it) } + val (methodDtos, ctorDtos) = classDto.methods.partition { it.signature.name != "constructor" } check(ctorDtos.size <= 1) { "Class should not have multiple constructors" } - val ctorDto = ctorDtos.singleOrNull() ?: defaultConstructorDto(classDto.signature) + val ctorDto = ctorDtos.firstOrNull() ?: defaultConstructorDto(classDto.signature) - val fields = classDto.fields.map { convertToEtsField(it) } val methods = methodDtos.map { convertToEtsMethod(it) } - - val initializers = classDto.fields.mapNotNull { - if (it.initializer != null && !isStaticField(it)) { - AssignStmtDto( - left = InstanceFieldRefDto( - instance = ThisRefDto(ClassTypeDto(classDto.signature)), - field = it.signature, - ), - right = it.initializer, - ) - } else null - } - - val ctorBlocks = ctorDto.body.cfg.blocks - val ctorStartingBlock = ctorBlocks.single { it.id == 0 } - - check(ctorStartingBlock.predecessors.isEmpty()) { - "Starting block should not have predecessors, or else the (prepended) initializers will be evaluated multiple times" - } - - val newStartingBlock = ctorStartingBlock.copy( - stmts = initializers + ctorStartingBlock.stmts - ) - val ctorWithInitializersDto = ctorDto.copy( - body = ctorDto.body.copy( - cfg = CfgDto( - blocks = ctorBlocks - ctorStartingBlock + newStartingBlock - ) - ) - ) - val ctor = convertToEtsMethod(ctorWithInitializersDto) + val ctor = convertToEtsMethod(ctorDto) return EtsClassImpl( signature = signature, fields = fields, methods = methods, ctor = ctor, - superClass = superclassSignature + superClass = superClassSignature, ) } @@ -691,17 +664,20 @@ fun convertToEtsMethodSignature(method: MethodSignatureDto): EtsMethodSignature fun convertToEtsMethod(method: MethodDto): EtsMethod { val signature = convertToEtsMethodSignature(method.signature) - // Note: locals are not used in the current implementation - // val locals = method.body.locals.map { - // convertToEtsEntity(it) as EtsLocal // safe cast - // } - val localsCount = method.body.locals.size val modifiers = method.modifiers .filterIsInstance() .map { it.modifier } - val builder = EtsMethodBuilder(signature, localsCount, modifiers) - val etsMethod = builder.build(method.body.cfg) - return etsMethod + if (method.body != null) { + // Note: locals are not used in the current implementation + // val locals = method.body.locals.map { + // convertToEtsEntity(it) as EtsLocal // safe cast + // } + val localsCount = method.body.locals.size + val builder = EtsMethodBuilder(signature, localsCount, modifiers) + return builder.build(method.body.cfg) + } else { + return EtsMethodImpl(signature, modifiers = modifiers) + } } fun convertToEtsField(field: FieldDto): EtsField { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt index a8a7eebf4..f3de099be 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt @@ -72,7 +72,6 @@ data class FieldDto( val modifiers: List? = null, @SerialName("questionToken") val isOptional: Boolean = false, // '?' @SerialName("exclamationToken") val isDefinitelyAssigned: Boolean = false, // '!' - val initializer: ValueDto? = null, ) @Serializable(with = ModifierSerializer::class) @@ -93,7 +92,7 @@ data class MethodDto( val signature: MethodSignatureDto, val modifiers: List, val typeParameters: List, - val body: BodyDto, + val body: BodyDto? = null, ) @Serializable diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt index d692b9867..841fdbb41 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt @@ -105,72 +105,74 @@ fun EtsFileDto.toDot(useLR: Boolean = false): String { // Link class to method: lines += """ "$c" -> "$m" [dir=none];""" - // Link method to its first basic block: - if (method.body.cfg.blocks.isNotEmpty()) { - val b = blockId(clazz, method, method.body.cfg.blocks.first().id) - lines += """ "$m" -> "${b}.0" [lhead="$b"];""" - } - - // Basic blocks with instructions: - method.body.cfg.blocks.forEach { bb -> - // BLOCK - val b = blockId(clazz, method, bb.id) - val blabel = blockLabel(bb) - lines += "" - lines += """ subgraph "$b" {""" - lines += """ cluster=true;""" - lines += """ label="$blabel";""" - - // Empty block: - if (bb.stmts.isEmpty()) { - lines += """ "${b}.0" [shape=box, label="NOP"];""" - } - - // Instructions inside basic block: - bb.stmts.forEachIndexed { i, inst -> - val label = statementLabel(inst) - lines += """ "${b}.${i}" [shape=box, label="$label"];""" + if (method.body != null) { + // Link method to its first basic block: + if (method.body.cfg.blocks.isNotEmpty()) { + val b = blockId(clazz, method, method.body.cfg.blocks.first().id) + lines += """ "$m" -> "${b}.0" [lhead="$b"];""" } - // Instructions chain: - if (bb.stmts.isNotEmpty()) { - val ids = List(bb.stmts.size) { i -> - "${b}.${i}" + // Basic blocks with instructions: + method.body.cfg.blocks.forEach { bb -> + // BLOCK + val b = blockId(clazz, method, bb.id) + val blabel = blockLabel(bb) + lines += "" + lines += """ subgraph "$b" {""" + lines += """ cluster=true;""" + lines += """ label="$blabel";""" + + // Empty block: + if (bb.stmts.isEmpty()) { + lines += """ "${b}.0" [shape=box, label="NOP"];""" } - lines += " ${ids.joinToString(" -> ") { "\"$it\"" }};" - } - lines += " }" - } + // Instructions inside basic block: + bb.stmts.forEachIndexed { i, inst -> + val label = statementLabel(inst) + lines += """ "${b}.${i}" [shape=box, label="$label"];""" + } - // Links to successor blocks: - method.body.cfg.blocks.forEach { bb -> - val last = bb.stmts.lastOrNull() - val i = if (bb.stmts.isNotEmpty()) bb.stmts.lastIndex else 0 - when (last ?: NopStmtDto) { - is IfStmtDto -> { - for ((j, succ) in bb.successors.withIndex()) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - val label = if (j == 0) "true" else "false" - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs", label="$label"];""" + // Instructions chain: + if (bb.stmts.isNotEmpty()) { + val ids = List(bb.stmts.size) { i -> + "${b}.${i}" } + lines += " ${ids.joinToString(" -> ") { "\"$it\"" }};" } - is SwitchStmtDto -> { - for ((j, succ) in bb.successors.withIndex()) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - val label = if (j == 0) "default" else "case ${j - 1}" - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$b", label="$label"];""" + lines += " }" + } + + // Links to successor blocks: + method.body.cfg.blocks.forEach { bb -> + val last = bb.stmts.lastOrNull() + val i = if (bb.stmts.isNotEmpty()) bb.stmts.lastIndex else 0 + when (last ?: NopStmtDto) { + is IfStmtDto -> { + for ((j, succ) in bb.successors.withIndex()) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + val label = if (j == 0) "true" else "false" + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs", label="$label"];""" + } + } + + is SwitchStmtDto -> { + for ((j, succ) in bb.successors.withIndex()) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + val label = if (j == 0) "default" else "case ${j - 1}" + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$b", label="$label"];""" + } } - } - else -> { - for (succ in bb.successors) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs"];""" + else -> { + for (succ in bb.successors) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs"];""" + } } } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt index 5e7d26c21..7b48910db 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt @@ -18,11 +18,15 @@ package org.jacodb.ets.test import org.jacodb.ets.base.EtsAssignStmt import org.jacodb.ets.base.EtsInstanceFieldRef +import org.jacodb.ets.base.EtsLocal +import org.jacodb.ets.base.EtsNumberConstant +import org.jacodb.ets.base.EtsReturnStmt import org.jacodb.ets.base.EtsThis import org.jacodb.ets.model.EtsFile import org.jacodb.ets.test.utils.loadEtsFileFromResource -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertIs private val logger = mu.KotlinLogging.logger {} @@ -50,17 +54,17 @@ class EtsFileTest { } @Test - fun `test etsFile on TypeMismatch`() { + fun `test sample TypeMismatch`() { val etsFile = load("etsir/samples/TypeMismatch") etsFile.classes.forEach { cls -> cls.methods.forEach { method -> when (method.name) { "add" -> { - Assertions.assertEquals(11, method.cfg.instructions.size) + assertEquals(11, method.cfg.instructions.size) } "main" -> { - Assertions.assertEquals(5, method.cfg.instructions.size) + assertEquals(5, method.cfg.instructions.size) } } } @@ -68,31 +72,103 @@ class EtsFileTest { } @Test - fun `test initializers prepended to class constructor`() { - val etsFile = load("etsir/samples/PrependInitializer") - val cls = etsFile.classes.single { it.name == "Foo" } - val ctorBegin = cls.ctor.cfg.instructions.first() as EtsAssignStmt - val fieldRef = ctorBegin.lhv as EtsInstanceFieldRef - Assertions.assertTrue(fieldRef.instance is EtsThis) - Assertions.assertEquals("x", fieldRef.field.name) - } + fun `test sample initializers`() { + val etsFile = load("etsir/samples/initializers") - @Test - fun `test static field should not be initialized in constructor`() { - val etsFile = load("etsir/samples/StaticField") val cls = etsFile.classes.single { it.name == "Foo" } - Assertions.assertFalse(cls.ctor.cfg.stmts.any { - it is EtsAssignStmt && it.lhv is EtsInstanceFieldRef - }) - } - @Test - fun `test default constructor should be synthesized`() { - val etsFile = load("etsir/samples/DefaultConstructor") - val cls = etsFile.classes.single { it.name == "Foo" } - val fieldInit = cls.ctor.cfg.instructions.first() as EtsAssignStmt - val fieldRef = fieldInit.lhv as EtsInstanceFieldRef - Assertions.assertTrue(fieldRef.instance is EtsThis) - Assertions.assertEquals("x", fieldRef.field.name) + // instance initializer + run { + val method = cls.methods.single { it.name == "@instance_init" } + assertEquals(3, method.cfg.instructions.size) + + // Local("this") := ThisRef + run { + val stmt = method.cfg.instructions[0] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + assertEquals("this", lhv.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals("Foo", rhv.type.typeName) + } + + // Local("this").x := 99 + run { + val stmt = method.cfg.instructions[1] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + + val instance = lhv.instance + assertIs(instance) + assertEquals("this", instance.name) + + val field = lhv.field + assertEquals("x", field.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals(99.0, rhv.value) + } + + // return + run { + val stmt = method.cfg.instructions[2] + assertIs(stmt) + assertEquals(null, stmt.returnValue) + } + } + + // static initializer + run { + val method = cls.methods.single { it.name == "@static_init" } + assertEquals(3, method.cfg.instructions.size) + + // Local("this") := ThisRef + run { + val stmt = method.cfg.instructions[0] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + assertEquals("this", lhv.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals("Foo", rhv.type.typeName) + } + + // Local("this").y := 111 + run { + val stmt = method.cfg.instructions[1] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + + val instance = lhv.instance + assertIs(instance) + assertEquals("this", instance.name) + + val field = lhv.field + assertEquals("y", field.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals(111.0, rhv.value) + } + + // return + run { + val stmt = method.cfg.instructions[2] + assertIs(stmt) + assertEquals(null, stmt.returnValue) + } + } } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt index 9cf77e3e7..2cfe495e3 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt @@ -26,7 +26,6 @@ import org.jacodb.ets.base.EtsReturnStmt import org.jacodb.ets.base.EtsUnknownType import org.jacodb.ets.dto.AnyTypeDto import org.jacodb.ets.dto.ClassSignatureDto -import org.jacodb.ets.dto.ConstantDto import org.jacodb.ets.dto.EtsMethodBuilder import org.jacodb.ets.dto.FieldDto import org.jacodb.ets.dto.FieldSignatureDto @@ -46,10 +45,6 @@ import org.junit.jupiter.api.Test class EtsFromJsonTest { - companion object { - private const val BASE_PATH = "etsir/samples" - } - private val json = Json { // classDiscriminator = "_" prettyPrint = true @@ -64,7 +59,8 @@ class EtsFromJsonTest { @Test fun testLoadEtsFileFromJson() { - val etsDto = loadEtsFileDtoFromResource("/$BASE_PATH/basic.ts.json") + val path = "etsir/samples/save/basic.ts.json" + val etsDto = loadEtsFileDtoFromResource("/$path") println("etsDto = $etsDto") val ets = convertToEtsFile(etsDto) println("ets = $ets") @@ -112,7 +108,6 @@ class EtsFromJsonTest { typeParameters = emptyList(), isOptional = true, isDefinitelyAssigned = false, - initializer = ConstantDto("0", NumberTypeDto), ) println("field = $field") diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/Dot.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/Dot.kt index cf6d764e6..d310f5593 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/Dot.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/Dot.kt @@ -50,13 +50,15 @@ object DumpEtsFileDtoToDot { println(" methods: ${clazz.methods.size}") clazz.methods.forEach { method -> println(" - METHOD '${method.signature}':") - println(" locals = ${method.body.locals}") + println(" locals = ${method.body?.locals}") println(" typeParameters = ${method.typeParameters}") - println(" blocks: ${method.body.cfg.blocks.size}") - method.body.cfg.blocks.forEach { block -> - println(" - BLOCK ${block.id} with ${block.stmts.size} statements:") - block.stmts.forEachIndexed { i, inst -> - println(" ${i + 1}. $inst") + method.body?.let { body -> + println(" blocks: ${body.cfg.blocks.size}") + body.cfg.blocks.forEach { block -> + println(" - BLOCK ${block.id} with ${block.stmts.size} statements:") + block.stmts.forEachIndexed { i, inst -> + println(" ${i + 1}. $inst") + } } } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt index c0226b457..da0991fcd 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt @@ -21,9 +21,9 @@ import org.jacodb.ets.dto.convertToEtsFile import org.jacodb.ets.model.EtsFile fun loadEtsFileDtoFromResource(jsonPath: String): EtsFileDto { - val sampleFilePath = object {}::class.java.getResourceAsStream(jsonPath) + val stream = object {}::class.java.getResourceAsStream(jsonPath) ?: error("Resource not found: $jsonPath") - return EtsFileDto.loadFromJson(sampleFilePath) + return EtsFileDto.loadFromJson(stream) } fun loadEtsFileFromResource(jsonPath: String): EtsFile { diff --git a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json index 7c34410f7..6f793165a 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json @@ -354,7 +354,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -458,7 +458,8 @@ { "id": 0, "successors": [ - 1 + 1, + 2 ], "predecessors": [], "stmts": [ @@ -521,7 +522,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -530,6 +531,21 @@ { "id": 1, "successors": [], + "predecessors": [ + 0, + 2 + ], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 2, + "successors": [ + 1 + ], "predecessors": [ 0 ], @@ -603,9 +619,6 @@ } } } - }, - { - "_": "ReturnVoidStmt" } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json deleted file mode 100644 index eeb72b5bd..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "name": "DefaultConstructor.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Foo" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "99", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json index 746f7430c..0f26ca797 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json @@ -234,7 +234,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -717,7 +717,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } }, @@ -1000,11 +1000,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -1052,7 +1151,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } } ], @@ -1140,7 +1239,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -1167,10 +1266,60 @@ "arg": { "_": "Local", "name": "$temp1", + "type": { + "_": "BooleanType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -1202,11 +1351,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -1254,7 +1502,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } } ], @@ -1342,7 +1590,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -1369,10 +1617,60 @@ "arg": { "_": "Local", "name": "$temp1", + "type": { + "_": "BooleanType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } } + }, + { + "_": "ReturnVoidStmt" } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json b/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json deleted file mode 100644 index 03cb7938f..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "name": "StaticField.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Foo" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "y", - "type": { - "_": "NumberType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "109", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "constructor", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json index b6faff907..88e994a76 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json @@ -234,7 +234,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json index dfea01dd0..36a88238e 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json @@ -10,184 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "a", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "b", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "andResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "orResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "xorResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "notResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "leftShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "rightShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "unsignedRightShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "c", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "unsignedRightShiftNegativeResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json index 5b927ad80..c99f4881f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json @@ -116,7 +116,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -172,7 +172,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -200,7 +200,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -251,7 +251,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -307,7 +307,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -335,7 +335,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -399,7 +399,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -472,7 +472,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -500,7 +500,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -564,7 +564,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -637,7 +637,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -665,7 +665,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -716,7 +716,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -772,7 +772,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -800,7 +800,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -851,7 +851,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -907,7 +907,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -935,7 +935,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -1011,7 +1011,7 @@ { "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1126,7 +1126,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1154,7 +1154,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json index 67fc9b7f4..9ed3373c5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json @@ -116,7 +116,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -172,7 +172,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -200,7 +200,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -251,7 +251,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -307,7 +307,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -335,7 +335,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -399,7 +399,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -472,7 +472,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -500,7 +500,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -564,7 +564,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -637,7 +637,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -665,7 +665,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -716,7 +716,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -772,7 +772,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -800,7 +800,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -851,7 +851,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -907,7 +907,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -935,7 +935,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -1005,7 +1005,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1099,7 +1099,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1127,7 +1127,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json index 79bfb760f..2c367be89 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json @@ -10,24 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "RESULT", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -373,20 +356,7 @@ } ] } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -403,7 +373,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [ + 0, + 3 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -424,35 +407,7 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } @@ -517,6 +472,34 @@ } ] } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json index ea7afb1cb..8c219b189 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json @@ -301,18 +301,50 @@ }, "modifiers": [], "typeParameters": [], + "body": null + }, + { + "signature": { + "enclosingClass": { + "name": "Message" + }, + "name": "readBoolean", + "parameters": [], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "PixelMap" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -326,10 +358,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } + "_": "UnknownType" } }, "right": { @@ -337,7 +366,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } } @@ -354,28 +383,18 @@ { "signature": { "enclosingClass": { - "name": "Message" + "name": "PixelMap" }, - "name": "readBoolean", + "name": "@static_init", "parameters": [], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -388,19 +407,66 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } } @@ -416,17 +482,6 @@ } ] }, - { - "signature": { - "name": "PixelMap" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [] - }, { "signature": { "name": "Size" @@ -449,8 +504,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -465,146 +519,39 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "Request" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], "methods": [ { "signature": { "enclosingClass": { - "name": "Request" + "name": "Size" }, - "name": "onRemoteMessageRequest", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnclearReferenceType", - "name": "Message" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Request" - } - } - }, - { - "name": "data", - "type": { - "_": "UnclearReferenceType", - "name": "Message" - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - { - "name": "height", - "type": { - "_": "UnknownType" - } - }, - { - "name": "width", - "type": { - "_": "UnknownType" - } - }, - { - "name": "bytesNumber", - "type": { - "_": "UnknownType" - } - }, - { - "name": "pixelMap", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp1", - "type": { - "_": "ClassType", - "signature": { - "name": "ArrayBuffer" - } - } - }, - { - "name": "createPixelMap", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { "id": 0, - "successors": [ - 1 - ], + "successors": [], "predecessors": [], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnclearReferenceType", - "name": "Message" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnclearReferenceType", - "name": "Message" - } - } - }, { "_": "AssignStmt", "left": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Request" - } + "_": "UnknownType" } }, "right": { @@ -612,29 +559,794 @@ "type": { "_": "ClassType", "signature": { - "name": "Request" + "name": "Size" } } } + }, + { + "_": "ReturnVoidStmt" } ] - }, - { - "id": 1, - "successors": [], - "predecessors": [ - 0 - ], - "stmts": [ - { + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Size" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Size" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Size" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Size" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Request" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "onRemoteMessageRequest", + "parameters": [ + { + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + }, + "isOptional": false + } + ], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + }, + { + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + { + "name": "height", + "type": { + "_": "UnknownType" + } + }, + { + "name": "width", + "type": { + "_": "UnknownType" + } + }, + { + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + }, + { + "name": "pixelMap", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + { + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + { + "name": "createPixelMap", + "type": { + "_": "UnknownType" + } + }, + { + "name": "e", + "type": { + "_": "UnknownType" + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [ + 1, + 3 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readBoolean", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 1, + "successors": [ + 2 + ], + "predecessors": [ + 0, + 3 + ], + "stmts": [ + { + "_": "ReturnStmt", + "arg": { + "_": "Constant", + "value": "true", + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 2, + "successors": [], + "predecessors": [ + 1 + ], + "stmts": [ + { "_": "ReturnStmt", "arg": { "_": "Constant", "value": "false", "type": { - "_": "BooleanType" + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 3, + "successors": [ + 1 + ], + "predecessors": [ + 0 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "height", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "width", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + "method": { + "enclosingClass": { + "name": "ArrayBuffer" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "pixelMap", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "" + }, + "name": "createPixelMap", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + ] + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } } } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -646,7 +1358,7 @@ }, { "signature": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "modifiers": [], "typeParameters": [], @@ -656,7 +1368,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "name": "height", "type": { @@ -666,19 +1378,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "height", - "type": { - "_": "UnknownType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "name": "width", "type": { @@ -688,17 +1393,125 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "width", - "type": { + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "height", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "height", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "width", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "width", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json index 3bab770f8..d0c7fd4c5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json @@ -97,81 +97,7 @@ }, "modifiers": [], "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "err", - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "err", - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } + "body": null }, { "signature": { @@ -432,8 +358,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -448,8 +373,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -464,8 +388,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -480,8 +403,7 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] @@ -511,17 +433,143 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + }, + "field": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "publish", + "type": { + "_": "UnclearReferenceType", + "name": "String" + } + } + }, + "right": { + "_": "Constant", + "value": "", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -839,13 +887,13 @@ { "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -857,13 +905,13 @@ { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -875,13 +923,13 @@ { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -893,7 +941,7 @@ { "name": "$temp11", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -903,7 +951,7 @@ "id": 0, "successors": [ 1, - 2 + 3 ], "predecessors": [], "stmts": [ @@ -995,7 +1043,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1003,7 +1051,9 @@ }, { "id": 1, - "successors": [], + "successors": [ + 2 + ], "predecessors": [ 0 ], @@ -1045,6 +1095,21 @@ { "id": 2, "successors": [], + "predecessors": [ + 1, + 3 + ], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 3, + "successors": [ + 2 + ], "predecessors": [ 0 ], @@ -1084,7 +1149,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1112,7 +1177,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1122,7 +1187,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1169,7 +1234,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1179,7 +1244,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1197,7 +1262,7 @@ "_": "Local", "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1207,7 +1272,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1254,7 +1319,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1264,7 +1329,7 @@ "_": "Local", "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1282,7 +1347,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1292,7 +1357,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1339,7 +1404,7 @@ "_": "Local", "name": "$temp11", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1349,7 +1414,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1388,9 +1453,56 @@ "right": { "_": "Local", "name": "$temp11", + "type": { + "_": "StringType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } } }, { diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json index 2e82605a8..58ee94026 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -111,6 +62,18 @@ "type": { "_": "UnknownType" } + }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -160,6 +123,93 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json index 082dacc1f..4a5545afa 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,6 +57,18 @@ } } }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, { "name": "console", "type": { @@ -160,15 +123,151 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, - "successors": [], + "successors": [ + 2 + ], "predecessors": [ 0 ], + "stmts": [] + }, + { + "id": 2, + "successors": [ + 3 + ], + "predecessors": [ + 1 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": " Finally block executed.", + "type": { + "_": "StringType" + } + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [ + 2 + ], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json index c30fa1ed7..217c2bdea 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json @@ -10,88 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result1", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result2", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message1", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message2", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -164,6 +83,24 @@ "type": { "_": "UnknownType" } + }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp3", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -230,6 +167,93 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message1", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in try block 1!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message1", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, @@ -241,7 +265,95 @@ "predecessors": [ 0 ], - "stmts": [] + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message2", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in try block 2!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message2", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + } + ] }, { "id": 2, diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json index 679eeb5d1..5833b1e64 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json @@ -10,72 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "outerResult", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "innerResult", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "innerMessage", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -133,6 +68,30 @@ "type": { "_": "UnknownType" } + }, + { + "name": "innerError", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + { + "name": "outerError", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -199,6 +158,93 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "innerMessage", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in inner try block!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "innerMessage", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json index 17b2cec3f..7f1c8f180 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -160,15 +111,140 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, - "successors": [], + "successors": [ + 2 + ], "predecessors": [ 0 ], + "stmts": [] + }, + { + "id": 2, + "successors": [ + 3 + ], + "predecessors": [ + 1 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "Finally block executed.", + "type": { + "_": "StringType" + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [ + 2 + ], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json index c74eb153d..6359013d9 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "rectangle", - "type": { - "_": "ClassType", - "signature": { - "name": "Rectangle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Rectangle" - } + "_": "UnknownType" } }, "args": [ @@ -228,7 +189,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -245,12 +206,12 @@ }, "method": { "enclosingClass": { - "name": "Rectangle" + "name": "" }, "name": "getArea", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -282,7 +243,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -316,28 +277,66 @@ "enclosingClass": { "name": "Shape" }, - "name": "getArea", + "name": "@instance_init", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, - "modifiers": [ - "AbstractKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Shape" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] } - } - ], + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], "cfg": { "blocks": [ { @@ -350,12 +349,76 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { "name": "Shape" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "getArea", + "parameters": [], + "returnType": { + "_": "NumberType" + } + }, + "modifiers": [ + "AbstractKeyword" + ], + "typeParameters": [], + "body": null + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", @@ -400,8 +463,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -416,11 +478,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Rectangle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Rectangle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -480,6 +641,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json index 2eae18fd8..cd3631785 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "user", - "type": { - "_": "ClassType", - "signature": { - "name": "User" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "User" - } + "_": "UnknownType" } }, "args": [ @@ -235,7 +196,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -252,11 +213,11 @@ }, "field": { "enclosingClass": { - "name": "User" + "name": "" }, "name": "name", "type": { - "_": "StringType" + "_": "UnknownType" } } } @@ -287,7 +248,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -328,8 +289,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -346,8 +306,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -364,11 +323,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "User" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "User" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "User" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "User" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -441,6 +499,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "User" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json index 4f976cd95..6a086583d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "constructorObj", - "type": { - "_": "ClassType", - "signature": { - "name": "ConstructorClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "ConstructorClass" - } + "_": "UnknownType" } }, "args": [ @@ -221,7 +182,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -238,12 +199,12 @@ }, "method": { "enclosingClass": { - "name": "ConstructorClass" + "name": "" }, "name": "getName", "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "args": [] @@ -275,7 +236,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -317,11 +278,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ConstructorClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ConstructorClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -368,6 +428,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json index c8465bd41..dba309813 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json @@ -10,62 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "stringObj", - "type": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "numberObj", - "type": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -218,10 +163,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } + "_": "UnknownType" } }, "args": [ @@ -281,13 +223,12 @@ }, "method": { "enclosingClass": { - "name": "GenericClass" + "name": "" }, "name": "getData", "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "T" + "_": "UnknownType" } }, "args": [] @@ -368,10 +309,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } + "_": "UnknownType" } }, "args": [ @@ -431,13 +369,12 @@ }, "method": { "enclosingClass": { - "name": "GenericClass" + "name": "" }, "name": "getData", "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "T" + "_": "UnknownType" } }, "args": [] @@ -517,11 +454,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "GenericClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "GenericClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -570,6 +606,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json index 92e46df40..f97f61133 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "childObj", - "type": { - "_": "ClassType", - "signature": { - "name": "ChildClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -105,7 +69,7 @@ { "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } } ], @@ -181,10 +145,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "ChildClass" - } + "_": "UnknownType" } }, "args": [ @@ -300,7 +261,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -317,12 +278,12 @@ }, "method": { "enclosingClass": { - "name": "ChildClass" + "name": "" }, "name": "getAge", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -354,7 +315,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -395,11 +356,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ParentClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ParentClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -446,6 +506,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -661,11 +745,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ChildClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ChildClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -725,6 +908,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json index 6b4081054..3cd0fc1d2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "circle", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Circle" - } + "_": "UnknownType" } }, "args": [ @@ -221,7 +182,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -238,12 +199,12 @@ }, "method": { "enclosingClass": { - "name": "Circle" + "name": "" }, "name": "getArea", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -282,7 +243,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -322,18 +283,56 @@ }, "modifiers": [], "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "Circle" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [ + "Shape" + ], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "Circle" + }, + "name": "radius", + "type": { + "_": "NumberType" + } + }, + "modifiers": [ + "PrivateKeyword", + "ReadonlyKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Circle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -347,10 +346,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } + "_": "UnknownType" } }, "right": { @@ -358,7 +354,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Shape" + "name": "Circle" } } } @@ -371,41 +367,57 @@ ] } } - } - ] - }, - { - "signature": { - "name": "Circle" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [ - "Shape" - ], - "fields": [ + }, { "signature": { "enclosingClass": { "name": "Circle" }, - "name": "radius", - "type": { - "_": "NumberType" + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" } }, - "modifiers": [ - "PrivateKeyword", - "ReadonlyKeyword" - ], + "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Circle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -452,6 +464,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Circle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json index 9cf15f262..3a5c99558 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "simpleObj", - "type": { - "_": "ClassType", - "signature": { - "name": "SimpleClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "SimpleClass" - } + "_": "UnknownType" } }, "args": [] @@ -223,20 +184,12 @@ }, "method": { "enclosingClass": { - "name": "SimpleClass" + "name": "" }, "name": "setName", - "parameters": [ - { - "name": "name", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [ @@ -256,7 +209,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -273,12 +226,12 @@ }, "method": { "enclosingClass": { - "name": "SimpleClass" + "name": "" }, "name": "getName", "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "args": [] @@ -310,7 +263,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -351,11 +304,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -589,6 +641,56 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json index b7257e240..09105ef04 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json @@ -10,46 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "logger", - "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Logger", - "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -78,19 +39,13 @@ { "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, { "name": "Logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } } ], @@ -129,25 +84,26 @@ "_": "Local", "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "right": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "Logger", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "Logger" + "name": "" }, "name": "getInstance", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "args": [] @@ -161,28 +117,17 @@ "_": "Local", "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "Logger" + "name": "" }, "name": "log", - "parameters": [ - { - "name": "message", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [ @@ -233,11 +178,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Logger" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Logger" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -294,6 +338,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -445,10 +513,8 @@ "name": "getInstance", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnclearReferenceType", + "name": "Logger" } }, "modifiers": [ @@ -603,7 +669,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json index d0e912a92..9cd9d2c90 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "StaticClass", - "type": { - "_": "ClassType", - "signature": { - "name": "StaticClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -75,16 +39,13 @@ { "name": "StaticClass", "type": { - "_": "ClassType", - "signature": { - "name": "StaticClass" - } + "_": "UnknownType" } }, { "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -126,15 +87,22 @@ { "_": "CallStmt", "expr": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "StaticClass", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "StaticClass" + "name": "" }, "name": "incrementCount", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [] @@ -146,19 +114,26 @@ "_": "Local", "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "StaticClass", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "StaticClass" + "name": "" }, "name": "getCount", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -190,7 +165,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -231,17 +206,192 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + }, + "field": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "count", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json deleted file mode 100644 index b40cb20b9..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json +++ /dev/null @@ -1,2026 +0,0 @@ -{ - "name": "enums.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Response1", - "type": { - "_": "ClassType", - "signature": { - "name": "Response1" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "E", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Directions", - "type": { - "_": "ClassType", - "signature": { - "name": "Directions" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - { - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - { - "name": "a2", - "type": { - "_": "AnyType" - } - }, - { - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - { - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - { - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - { - "name": "Response1", - "type": { - "_": "ClassType", - "signature": { - "name": "Response1" - } - } - }, - { - "name": "respond", - "type": { - "_": "UnknownType" - } - }, - { - "name": "", - "type": { - "_": "UnknownType" - } - }, - { - "name": "E", - "type": { - "_": "UnknownType" - } - }, - { - "name": "f", - "type": { - "_": "UnknownType" - } - }, - { - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - { - "name": "Directions", - "type": { - "_": "ClassType", - "signature": { - "name": "Directions" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Response1" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "parameters": [ - { - "name": "recipient", - "type": { - "_": "StringType" - }, - "isOptional": false - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - }, - "isOptional": false - } - ], - "returnType": { - "_": "VoidType" - } - }, - "args": [ - { - "_": "Constant", - "value": "Princess Caroline", - "type": { - "_": "StringType" - } - }, - { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - ] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "right": { - "_": "Local", - "name": "", - "type": { - "_": "UnknownType" - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "parameters": [ - { - "name": "obj", - "type": { - "_": "AnyType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "E", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Enum" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - "field": { - "enclosingClass": { - "name": "Enum" - }, - "name": "a2", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "NewArrayExpr", - "elementType": { - "_": "AnyType" - }, - "size": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "parameters": [ - { - "name": "recipient", - "type": { - "_": "StringType" - }, - "isOptional": false - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - }, - "isOptional": false - } - ], - "returnType": { - "_": "VoidType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "recipient", - "type": { - "_": "StringType" - } - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "recipient", - "type": { - "_": "StringType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "StringType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - }, - "right": { - "_": "ParameterRef", - "index": 1, - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "parameters": [ - { - "name": "obj", - "type": { - "_": "AnyType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "obj", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "obj", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "AnyType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "obj", - "type": { - "_": "AnyType" - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Direction1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Direction2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "name": "No", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "Y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "Z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "B", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "C", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "FileAccess" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "None", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "Read", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "Write", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "ReadWrite", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "G", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Response1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Response1" - }, - "name": "No", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Response1" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "ShapeKind" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "ShapeKind" - }, - "name": "Circle", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "ShapeKind" - }, - "name": "Square", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Circle" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Circle" - }, - "name": "kind", - "type": { - "_": "UnclearReferenceType", - "name": "ShapeKind.Circle" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Circle" - }, - "name": "radius", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Square" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Square" - }, - "name": "kind", - "type": { - "_": "UnclearReferenceType", - "name": "ShapeKind.Square" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Square" - }, - "name": "sideLength", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "Y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "Z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Enum" - }, - "modifiers": [ - "DeclareKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Enum" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Directions" - }, - "modifiers": [ - "ConstKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json similarity index 69% rename from jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json index ecc1dbb7b..15e105a20 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json @@ -1,5 +1,5 @@ { - "name": "PrependInitializer.ts", + "name": "initializers.ts", "namespaces": [], "classes": [ { @@ -99,14 +99,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "99", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { @@ -123,17 +116,174 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "109", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "field": { + "enclosingClass": { + "name": "Foo" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "99", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "field": { + "enclosingClass": { + "name": "Foo" + }, + "name": "y", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "111", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -194,6 +344,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "CallStmt", "expr": { @@ -218,7 +392,7 @@ "args": [ { "_": "Constant", - "value": "new Foo", + "value": "inside Foo::constructor", "type": { "_": "StringType" } @@ -324,7 +498,7 @@ }, "right": { "_": "Constant", - "value": "112", + "value": "222", "type": { "_": "NumberType" } @@ -354,7 +528,7 @@ "args": [ { "_": "Constant", - "value": "print-foo", + "value": "inside Foo::foo", "type": { "_": "StringType" } @@ -459,7 +633,7 @@ }, "right": { "_": "Constant", - "value": "111", + "value": "333", "type": { "_": "NumberType" } @@ -489,7 +663,7 @@ "args": [ { "_": "Constant", - "value": "print-bar", + "value": "inside Foo::bar", "type": { "_": "StringType" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json index 9b964cf5c..e065e7a56 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json @@ -10,75 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "graph", - "type": { - "_": "ClassType", - "signature": { - "name": "Graph" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "visitOrder", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "bfs", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,10 +38,17 @@ }, { "name": "graph", + "type": { + "_": "UnclearReferenceType", + "name": "Graph" + } + }, + { + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Graph" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, @@ -165,23 +104,68 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "graph", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Graph" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "graph", + "type": { + "_": "UnclearReferenceType", + "name": "Graph" + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -199,29 +183,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "bfs", - "parameters": [ - { - "name": "graph", - "type": { - "_": "UnclearReferenceType", - "name": "Graph" - }, - "isOptional": false - }, - { - "name": "startNode", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -229,10 +196,8 @@ "_": "Local", "name": "graph", "type": { - "_": "ClassType", - "signature": { - "name": "Graph" - } + "_": "UnclearReferenceType", + "name": "Graph" } }, { @@ -317,8 +282,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -418,31 +386,49 @@ } }, { - "name": "neighbour", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, { - "name": "$temp5", + "name": "$temp6", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "$temp6", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, { - "name": "$temp7", + "name": "$temp8", "type": { "_": "UnknownType" } }, { - "name": "$temp8", + "name": "neighbour", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp10", "type": { "_": "UnknownType" } @@ -658,13 +644,23 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], "predecessors": [ - 0, + 0 + ], + "stmts": [] + }, + { + "id": 2, + "successors": [ 3, - 5 + 4 + ], + "predecessors": [ + 1, + 4, + 6 ], "stmts": [ { @@ -720,17 +716,17 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -750,13 +746,13 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 + 2, + 5 ], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -878,19 +874,19 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 4, + "id": 5, "successors": [ - 5 + 6 ], "predecessors": [ - 3 + 4 ], "stmts": [ { @@ -958,126 +954,195 @@ } } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "neighbours", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } } ] }, { - "id": 5, + "id": 6, "successors": [ - 1, - 6 + 2, + 7 ], "predecessors": [ - 4, - 6, - 7 + 5, + 7, + 8 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "neighbour", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "neighbours", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { "_": "UnknownType" } } } }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp6", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "==", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Local", - "name": "$temp5", + "_": "Constant", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 7, + "successors": [ + 6, + 8 + ], + "predecessors": [ + 6 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "neighbour", + "name": "$temp8", "type": { "_": "UnknownType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "neighbours", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { - "_": "Local", - "name": "$temp6", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "UnknownType" } } }, @@ -1085,47 +1150,30 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "neighbour", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { + "_": "CastExpr", + "arg": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { - "_": "NumberType" + "_": "UnknownType" } }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "type": { + "_": "UnknownType" } } - } - ] - }, - { - "id": 6, - "successors": [ - 5, - 7 - ], - "predecessors": [ - 5 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { "_": "UnknownType" } @@ -1168,7 +1216,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "UnknownType" } @@ -1178,7 +1226,7 @@ "op": "!", "arg": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { "_": "UnknownType" } @@ -1192,7 +1240,7 @@ "op": "==", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "UnknownType" } @@ -1205,19 +1253,19 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 7, + "id": 8, "successors": [ - 5 + 6 ], "predecessors": [ - 6 + 7 ], "stmts": [ { @@ -1280,22 +1328,24 @@ }, "name": "IndexSignature-Graph-0", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -1305,7 +1355,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "a", "type": { @@ -1315,42 +1365,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'b'", - "type": { - "_": "StringType" - } - }, - { - "_": "Constant", - "value": "'c'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - }, - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "b", "type": { @@ -1360,32 +1380,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'d'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "c", "type": { @@ -1395,32 +1395,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'e'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "d", "type": { @@ -1430,32 +1410,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'f'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "e", "type": { @@ -1465,20 +1425,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [], - "type": { - "_": "UnionType", - "types": [] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "f", "type": { @@ -1488,18 +1440,670 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [], - "type": { - "_": "UnionType", - "types": [] - } - } + "exclamationToken": false } ], - "methods": [] + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "b", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "c", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "d", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "b", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "e", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "c", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "f", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "d", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "AnyType" + }, + "size": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "e", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "AnyType" + }, + "size": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "f", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json index a00ff49d2..f81a941b6 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json @@ -10,75 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "tree", - "type": { - "_": "ClassType", - "signature": { - "name": "TreeNode" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "traversalResult", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "iterativeDFS", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,10 +38,17 @@ }, { "name": "tree", + "type": { + "_": "UnclearReferenceType", + "name": "TreeNode" + } + }, + { + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "TreeNode" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, @@ -165,23 +104,68 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "tree", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "TreeNode" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "tree", + "type": { + "_": "UnclearReferenceType", + "name": "TreeNode" + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -199,30 +183,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "iterativeDFS", - "parameters": [ - { - "name": "root", - "type": { - "_": "UnionType", - "types": [ - { - "_": "UnclearReferenceType", - "name": "TreeNode" - }, - { - "_": "UndefinedType" - } - ] - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -230,10 +196,8 @@ "_": "Local", "name": "tree", "type": { - "_": "ClassType", - "signature": { - "name": "TreeNode" - } + "_": "UnclearReferenceType", + "name": "TreeNode" } } ] @@ -312,8 +276,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -597,7 +564,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -875,7 +842,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -970,7 +937,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1100,7 +1067,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1166,7 +1133,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1406,8 +1373,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -1423,8 +1389,7 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -1440,15 +1405,14 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] }, { "signature": { - "name": "AnonymousClass-2" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, "modifiers": [], "typeParameters": [], @@ -1458,7 +1422,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-2" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, "name": "value", "type": { @@ -1468,55 +1432,97 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "4", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-3" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-3" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, - "name": "value", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "5", - "type": { - "_": "NumberType" + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-1" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, "modifiers": [], "typeParameters": [], @@ -1526,7 +1532,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-1" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, "name": "value", "type": { @@ -1536,143 +1542,97 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "2", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-1" - }, - "name": "left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-2" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-2" - } - } - } - }, + "exclamationToken": false + } + ], + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-1" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, - "name": "right", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-3" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-3" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-5" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-5" - }, - "name": "value", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "6", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-6" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-6" - }, - "name": "value", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "7", - "type": { - "_": "NumberType" + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "5", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "modifiers": [], "typeParameters": [], @@ -1682,7 +1642,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "value", "type": { @@ -1692,19 +1652,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "3", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "left", "type": { @@ -1714,24 +1667,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-5" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-5" - } - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "right", "type": { @@ -1741,110 +1682,1154 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-6" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-6" - } - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "name": "value", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "name": "left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-1" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-1" - } - } - } - }, + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, - "name": "right", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-4" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-4" + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } } - } - } - } - ], - "methods": [] + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "6", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "7", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json index 012de868f..4cbc8214e 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json @@ -10,90 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "graph", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "dijkstra", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -985,7 +902,37 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1486,29 +1433,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "dijkstra", - "parameters": [ - { - "name": "graph", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - }, - { - "name": "startVertex", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -1621,8 +1551,15 @@ { "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false }, @@ -1635,8 +1572,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -1655,8 +1595,15 @@ { "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { @@ -1774,13 +1721,13 @@ { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1804,25 +1751,29 @@ { "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1834,19 +1785,23 @@ { "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1858,13 +1813,13 @@ { "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1876,19 +1831,23 @@ { "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1907,16 +1866,30 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1983,8 +1956,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2104,8 +2084,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2172,12 +2159,10 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], "predecessors": [ - 0, - 6 + 0 ], "stmts": [ { @@ -2196,7 +2181,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [ + 1, + 7 + ], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2212,8 +2210,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2275,70 +2280,42 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [ + 2 + ], + "stmts": [ { - "_": "AssignStmt", - "left": { + "_": "ReturnStmt", + "arg": { "_": "Local", - "name": "i", + "name": "distances", "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } } ] }, { - "id": 2, - "successors": [], - "predecessors": [ - 1 - ], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "distances", - "type": { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - } - } - ] - }, - { - "id": 3, + "id": 4, "successors": [ - 4 + 5 ], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -2378,21 +2355,7 @@ } } } - } - ] - }, - { - "id": 4, - "successors": [ - 5, - 9 - ], - "predecessors": [ - 3, - 9, - 10 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -2409,7 +2372,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 5, + "successors": [ + 6, + 11 + ], + "predecessors": [ + 4, + 12 + ], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2425,8 +2401,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2460,47 +2443,19 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 5, + "id": 6, "successors": [ - 6 + 7 ], "predecessors": [ - 4 + 5 ], "stmts": [ { @@ -2536,21 +2491,7 @@ "_": "BooleanType" } } - } - ] - }, - { - "id": 6, - "successors": [ - 1, - 7 - ], - "predecessors": [ - 5, - 7, - 8 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -2567,7 +2508,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 7, + "successors": [ + 2, + 8 + ], + "predecessors": [ + 6, + 9 + ], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2583,8 +2537,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2618,48 +2579,20 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 7, + "id": 8, "successors": [ - 6, - 8 + 9, + 10 ], "predecessors": [ - 6 + 7 ], "stmts": [ { @@ -2723,27 +2656,43 @@ "_": "Local", "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2753,26 +2702,31 @@ "_": "Local", "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2782,7 +2736,7 @@ "_": "Local", "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -2792,7 +2746,7 @@ "_": "Local", "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2810,7 +2764,7 @@ "_": "Local", "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -2827,7 +2781,7 @@ "_": "Local", "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -2872,27 +2826,43 @@ "_": "Local", "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "right": { - "_": "InstanceFieldRef", - "instance": { + "right": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2902,26 +2872,31 @@ "_": "Local", "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2931,7 +2906,7 @@ "_": "Local", "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2948,7 +2923,7 @@ "_": "Local", "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -2993,7 +2968,7 @@ "_": "Local", "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3003,7 +2978,7 @@ "_": "Local", "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -3021,7 +2996,7 @@ "_": "Local", "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3031,14 +3006,14 @@ "_": "Local", "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { "_": "Local", "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -3052,7 +3027,7 @@ "_": "Local", "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3063,19 +3038,87 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 8, + "id": 9, "successors": [ - 6 + 7 ], "predecessors": [ - 7 + 8, + 10 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + } + ] + }, + { + "id": 10, + "successors": [ + 9 + ], + "predecessors": [ + 8 ], "stmts": [ { @@ -3118,27 +3161,43 @@ "_": "Local", "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -3148,26 +3207,31 @@ "_": "Local", "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -3177,7 +3241,7 @@ "_": "Local", "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -3194,7 +3258,7 @@ "_": "Local", "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -3229,20 +3293,20 @@ "_": "Local", "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } } } ] }, { - "id": 9, + "id": 11, "successors": [ - 4, - 10 + 12, + 13 ], "predecessors": [ - 4 + 5 ], "stmts": [ { @@ -3340,7 +3404,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3368,7 +3432,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3385,7 +3449,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -3399,7 +3463,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3410,19 +3474,59 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 10, + "id": 12, "successors": [ - 4 + 5 ], "predecessors": [ - 9 + 11, + 13 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + } + ] + }, + { + "id": 13, + "successors": [ + 12 + ], + "predecessors": [ + 11 ], "stmts": [ { diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json index ff4df00a8..fe2522f5b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json @@ -10,40 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "count", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -147,11 +114,12 @@ { "id": 1, "successors": [ + 1, 2 ], "predecessors": [ 0, - 2 + 1 ], "stmts": [ { @@ -269,19 +237,7 @@ } } } - } - ] - }, - { - "id": 2, - "successors": [ - 1, - 3 - ], - "predecessors": [ - 1 - ], - "stmts": [ + }, { "_": "IfStmt", "condition": { @@ -309,10 +265,10 @@ ] }, { - "id": 3, + "id": 2, "successors": [], "predecessors": [ - 2 + 1 ], "stmts": [ { diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json index 7bbbd89d5..d787bd1fa 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json @@ -10,59 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "person", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "key", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,48 +41,75 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, { - "name": "key", + "name": "$temp0", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, { - "name": "$temp0", + "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, { - "name": "$temp1", + "name": "$temp2", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "$temp2", + "name": "$temp3", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + { + "name": "key", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp5", "type": { "_": "StringType" } }, { - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } }, { - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } }, { - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -181,54 +156,71 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "person", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "key", + "name": "person", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, "right": { - "_": "Constant", - "value": "undefined", + "_": "Local", + "name": "$temp0", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } } }, @@ -236,124 +228,148 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "person", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } - } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [ + 0, + 3 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp2", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": ">=", - "left": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, - "right": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "type": { - "_": "BooleanType" - } + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "key", + "name": "$temp3", "type": { - "_": "UndefinedType" + "_": "BooleanType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "person", + "name": "$temp2", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "IteratorResult" } } }, - "index": { - "_": "Local", - "name": "$temp1", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "UnknownType" } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp3", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { "_": "Constant", - "value": "1", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } + }, + "type": { + "_": "BooleanType" } } } @@ -384,7 +400,62 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "key", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "CastExpr", + "arg": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", "type": { "_": "StringType" } @@ -403,7 +474,7 @@ "_": "Local", "name": "key", "type": { - "_": "UndefinedType" + "_": "UnknownType" } } } @@ -412,7 +483,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } @@ -422,7 +493,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp5", "type": { "_": "StringType" } @@ -440,7 +511,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } @@ -450,7 +521,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } @@ -463,13 +534,13 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "field": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "" }, "name": "key", "type": { @@ -483,7 +554,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -493,7 +564,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } @@ -531,7 +602,7 @@ "args": [ { "_": "Local", - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -549,7 +620,7 @@ }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -559,7 +630,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "firstName", "type": { @@ -569,19 +640,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"John\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "lastName", "type": { @@ -591,19 +655,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"Doe\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "age", "type": { @@ -613,17 +670,157 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "30", - "type": { - "_": "NumberType" + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "firstName", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "John", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "lastName", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "Doe", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "age", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "30", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json index 713beda96..4cde657df 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json @@ -10,128 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "A", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "B", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "product", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "multiplyMatrices", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -571,7 +450,23 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1001,7 +896,23 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1222,30 +1133,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "multiplyMatrices", - "parameters": [ - { - "name": "A", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - }, - { - "name": "B", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -1364,23 +1257,44 @@ { "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false }, { "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "modifiers": [], @@ -1399,15 +1313,29 @@ { "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { @@ -1425,7 +1353,11 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { @@ -1443,7 +1375,11 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { @@ -1452,6 +1388,15 @@ "_": "UnknownType" } }, + { + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, { "name": "AnonymousMethod-multiplyMatrices-0", "type": { @@ -1475,7 +1420,7 @@ } }, { - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -1501,12 +1446,6 @@ "_": "NumberType" } }, - { - "name": "$temp3", - "type": { - "_": "UnknownType" - } - }, { "name": "$temp4", "type": { @@ -1516,25 +1455,39 @@ { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" + } + }, + { + "name": "$temp9", + "type": { + "_": "NumberType" } } ], @@ -1544,7 +1497,7 @@ "id": 0, "successors": [ 1, - 6 + 9 ], "predecessors": [], "stmts": [ @@ -1554,16 +1507,30 @@ "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1573,16 +1540,30 @@ "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - } - }, - "right": { - "_": "ParameterRef", + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 + } + }, + "right": { + "_": "ParameterRef", "index": 1, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1623,8 +1604,15 @@ "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -1644,27 +1632,43 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "0", + "index": { + "_": "Constant", + "value": "0", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -1683,7 +1687,11 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "field": { @@ -1712,8 +1720,15 @@ "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -1733,27 +1748,43 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "0", + "index": { + "_": "Constant", + "value": "0", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -1772,7 +1803,11 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "field": { @@ -1786,6 +1821,55 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -1816,14 +1900,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-multiplyMatrices-0" - }, + "_": "Local", + "name": "$temp2", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" } } }, @@ -1867,7 +1949,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1876,13 +1958,11 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], "predecessors": [ 0, - 3, - 6 + 9 ], "stmts": [ { @@ -1901,7 +1981,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [ + 1, + 5 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -1922,45 +2015,17 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -1976,14 +2041,12 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 + 5 ], "predecessors": [ - 1, - 4 + 2 ], "stmts": [ { @@ -2002,7 +2065,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 5, + "successors": [ + 2, + 6 + ], + "predecessors": [ + 4, + 7 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -2023,68 +2099,51 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 6, + "successors": [ + 7 + ], + "predecessors": [ + 5 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "j", + "name": "k", "type": { "_": "NumberType" } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" } } } ] }, { - "id": 4, + "id": 7, "successors": [ - 3, - 5 + 5, + 8 ], "predecessors": [ - 3, - 5 + 6, + 8 ], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, { "_": "IfStmt", "condition": { @@ -2105,54 +2164,26 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 5, + "id": 8, "successors": [ - 4 + 7 ], "predecessors": [ - 4 + 7 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2181,29 +2212,45 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "i", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2211,28 +2258,33 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "k", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2240,29 +2292,45 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "k", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2270,28 +2338,33 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "j", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2299,9 +2372,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2309,16 +2382,16 @@ "op": "*", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -2329,7 +2402,7 @@ "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2351,7 +2424,7 @@ "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2368,9 +2441,93 @@ }, "right": { "_": "Local", - "name": "$temp8", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" } } } @@ -2378,7 +2535,7 @@ ] }, { - "id": 6, + "id": 9, "successors": [ 1 ], @@ -2390,7 +2547,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2414,7 +2571,7 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2447,7 +2604,7 @@ "_": "ThrowStmt", "arg": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2529,7 +2686,7 @@ }, { "signature": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" }, "modifiers": [], "typeParameters": [], @@ -2539,7 +2696,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" }, "name": "length", "type": { @@ -2549,17 +2706,93 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "rowsA", - "type": { + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "length", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "rowsA", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json index 2929b6235..91fe63049 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json @@ -10,116 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "colors", - "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "sizes", - "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "combinations", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "color", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "size", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -205,40 +96,85 @@ "dimensions": 1 } }, + { + "name": "$temp3", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + { + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + { + "name": "$temp5", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp6", + "type": { + "_": "UnknownType" + } + }, { "name": "color", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, { - "name": "$temp3", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, { - "name": "$temp4", + "name": "$temp8", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "size", + "name": "$temp9", "type": { - "_": "UndefinedType" + "_": "BooleanType" } }, { - "name": "$temp5", + "name": "$temp10", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { - "name": "$temp6", + "name": "size", "type": { - "_": "NumberType" + "_": "UnknownType" + } + }, + { + "name": "$temp11", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, { @@ -644,43 +580,27 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], "predecessors": [ - 0, - 3 + 0 ], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "color", - "type": { - "_": "UndefinedType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, { "_": "AssignStmt", "left": { "_": "Local", "name": "$temp3", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "colors", "type": { @@ -690,119 +610,139 @@ }, "dimensions": 1 } - } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [ + 1, + 5 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", "name": "$temp4", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": ">=", - "left": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", - "name": "$temp4", + "name": "$temp3", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, - "right": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "type": { - "_": "BooleanType" - } + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "color", + "name": "$temp5", "type": { - "_": "UndefinedType" + "_": "BooleanType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "colors", + "name": "$temp4", "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { - "_": "Local", - "name": "$temp4", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "StringType" } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { "_": "Constant", - "value": "1", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } + }, + "type": { + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -854,30 +794,43 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 + 5 ], "predecessors": [ - 1, - 4 + 2 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "size", + "name": "$temp6", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } } } }, @@ -885,14 +838,40 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "color", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "LengthExpr", + "_": "CastExpr", "arg": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "sizes", "type": { @@ -902,23 +881,105 @@ }, "dimensions": 1 } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } + } + ] + }, + { + "id": 5, + "successors": [ + 2, + 6 + ], + "predecessors": [ + 4, + 6 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp9", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", + "type": { + "_": "UnknownType" + } } } }, @@ -926,57 +987,89 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "==", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp9", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Local", - "name": "$temp5", + "_": "Constant", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "type": { "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 6, + "successors": [ + 5 + ], + "predecessors": [ + 5 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "size", + "name": "$temp10", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "sizes", + "name": "$temp8", "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "size", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "CastExpr", + "arg": { "_": "Local", - "name": "$temp6", + "name": "$temp10", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "type": { - "_": "StringType" + "_": "UnknownType" } } }, @@ -984,41 +1077,51 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp11", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", - "name": "$temp6", + "name": "$temp11", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" } - } + }, + "args": [] } - } - ] - }, - { - "id": 4, - "successors": [ - 3 - ], - "predecessors": [ - 3 - ], - "stmts": [ + }, { "_": "CallStmt", "expr": { @@ -1046,14 +1149,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, + "_": "Local", + "name": "$temp11", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -1070,7 +1171,7 @@ }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -1080,7 +1181,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "color", "type": { @@ -1090,13 +1191,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "size", "type": { @@ -1106,11 +1206,61 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], - "methods": [] + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json index af9b429a5..1c5be7dc2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json @@ -10,40 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "counter", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json index e1d1812a5..d67fbe2aa 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json @@ -10,24 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "main", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -95,7 +78,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "main", "parameters": [], @@ -150,7 +133,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" } } }, @@ -159,7 +151,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -170,13 +171,13 @@ } }, { - "name": "$temp0", + "name": "$temp2", "type": { "_": "UnknownType" } }, { - "name": "$temp1", + "name": "$temp3", "type": { "_": "UnknownType" } @@ -232,23 +233,70 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "c", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-main-0" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "c", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" } } } @@ -257,23 +305,70 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "obj", + "name": "$temp1", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-main-1" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } @@ -306,7 +401,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } @@ -323,7 +418,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -344,7 +439,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp2", "type": { "_": "UnknownType" } @@ -357,7 +452,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -396,7 +491,7 @@ "args": [ { "_": "Local", - "name": "$temp0", + "name": "$temp2", "type": { "_": "UnknownType" } @@ -414,7 +509,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -440,7 +535,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp3", "type": { "_": "UnknownType" } @@ -453,7 +548,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -492,7 +587,7 @@ "args": [ { "_": "Local", - "name": "$temp1", + "name": "$temp3", "type": { "_": "UnknownType" } @@ -513,7 +608,7 @@ }, { "signature": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" }, "modifiers": [], "typeParameters": [], @@ -523,7 +618,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" }, "name": "c1", "type": { @@ -533,19 +628,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "3", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" }, "name": "c2", "type": { @@ -555,21 +643,129 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "4", - "type": { - "_": "NumberType" + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c1", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c2", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "modifiers": [], "typeParameters": [], @@ -579,7 +775,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "a", "type": { @@ -589,19 +785,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "b", "type": { @@ -611,13 +800,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "", "type": { @@ -627,19 +815,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "c", - "type": { - "_": "UnknownType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "_value", "type": { @@ -649,21 +830,128 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "_value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "method", "parameters": [], @@ -680,7 +968,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -706,7 +994,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -715,7 +1003,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } @@ -764,7 +1052,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "Get-accessor", "parameters": [], @@ -781,7 +1069,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } @@ -801,7 +1089,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -810,7 +1098,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } @@ -834,7 +1122,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" }, "name": "Set-accessor", "parameters": [ @@ -859,7 +1147,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -868,6 +1156,12 @@ "type": { "_": "UnknownType" } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -902,7 +1196,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } }, @@ -911,11 +1205,50 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" } } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "setter", + "type": { + "_": "StringType" + } + }, + { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + } + ] + } + }, { "_": "ReturnVoidStmt" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/basic.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json similarity index 66% rename from jacodb-ets/src/test/resources/etsir/samples/basic.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json index e025c1465..44035fdbf 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/basic.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json @@ -1,5 +1,5 @@ { - "name": "basic.ts", + "name": "save/basic.ts", "namespaces": [], "classes": [ { @@ -10,161 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "logger", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "someClass", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "m", - "type": { - "_": "ClassType", - "signature": { - "name": "someClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "soo", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "forLoopTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "controlTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "deleteTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -190,6 +36,15 @@ } } }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, { "name": "configure", "type": { @@ -213,16 +68,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, @@ -236,7 +91,7 @@ } }, { - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -304,6 +159,55 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "CallStmt", "expr": { @@ -320,14 +224,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" - }, + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" } } } @@ -366,17 +268,17 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, "right": { "_": "Local", - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } } @@ -385,7 +287,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -409,7 +311,7 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -424,10 +326,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "someClass" - } + "_": "UnknownType" } }, "args": [ @@ -455,7 +354,7 @@ }, "right": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -504,7 +403,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "forLoopTest", "parameters": [], @@ -521,7 +420,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "controlTest", "parameters": [], @@ -538,7 +437,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "deleteTest", "parameters": [], @@ -735,20 +634,7 @@ } } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -765,7 +651,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [ + 0, + 3 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -786,47 +685,19 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - } - ] - }, - { - "id": 2, - "successors": [], - "predecessors": [ - 1 - ], - "stmts": [ + } + ] + }, + { + "id": 2, + "successors": [], + "predecessors": [ + 1 + ], + "stmts": [ { "_": "ReturnVoidStmt" } @@ -932,6 +803,34 @@ } ] } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } @@ -1004,19 +903,19 @@ { "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -1028,13 +927,13 @@ { "name": "$temp6", "type": { - "_": "NumberType" + "_": "StringType" } }, { "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -1046,7 +945,7 @@ { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1058,7 +957,7 @@ { "name": "$temp11", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1069,12 +968,6 @@ }, { "name": "$temp13", - "type": { - "_": "UnknownType" - } - }, - { - "name": "count", "type": { "_": "NumberType" } @@ -1088,103 +981,109 @@ { "name": "$temp15", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp16", "type": { - "_": "UnknownType" - } - }, - { - "name": "j", - "type": { - "_": "NumberType" + "_": "StringType" } }, { "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "k", + "name": "$temp19", "type": { - "_": "NumberType" + "_": "StringType" } }, { - "name": "$temp19", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "$temp20", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "$temp21", + "name": "count", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp22", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp23", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" + } + }, + { + "name": "j", + "type": { + "_": "NumberType" } }, { "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" + } + }, + { + "name": "k", + "type": { + "_": "NumberType" } }, { "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -1446,12 +1345,10 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], "predecessors": [ - 0, - 10 + 0 ], "stmts": [ { @@ -1470,7 +1367,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [ + 1, + 14 + ], + "stmts": [ { "_": "AssignStmt", "left": { @@ -1524,45 +1434,17 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -1571,13 +1453,13 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 4, - 20 + 5, + 23 ], "predecessors": [ - 1 + 2 ], "stmts": [ { @@ -1620,7 +1502,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1651,7 +1533,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1662,28 +1544,28 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 4, + "id": 5, "successors": [ - 5 + 6 ], "predecessors": [ - 3 + 4 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp28", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1726,9 +1608,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp29", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1736,9 +1618,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp28", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1774,9 +1656,9 @@ "args": [ { "_": "Local", - "name": "$temp29", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -1785,23 +1667,23 @@ ] }, { - "id": 5, + "id": 6, "successors": [ - 6, - 17, - 18, - 19 + 7, + 20, + 21, + 22 ], "predecessors": [ - 4, - 20 + 5, + 23 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { "_": "NumberType" } @@ -1835,9 +1717,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1845,7 +1727,7 @@ "op": "%", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { "_": "NumberType" } @@ -1863,7 +1745,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "NumberType" } @@ -1897,16 +1779,16 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp9", + "name": "$temp11", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } }, @@ -1914,7 +1796,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp10", + "name": "$temp12", "type": { "_": "NumberType" } @@ -1948,16 +1830,16 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp11", + "name": "$temp13", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } }, @@ -1965,7 +1847,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp12", + "name": "$temp14", "type": { "_": "NumberType" } @@ -1999,28 +1881,28 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp13", + "name": "$temp15", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } } ] }, { - "id": 6, + "id": 7, "successors": [ - 7 + 8 ], "predecessors": [ - 5 + 6 ], "stmts": [ { @@ -2058,12 +1940,15 @@ ] }, { - "id": 7, + "id": 8, "successors": [ - 8 + 9 ], "predecessors": [ - 6 + 7, + 20, + 21, + 22 ], "stmts": [ { @@ -2086,21 +1971,21 @@ ] }, { - "id": 8, + "id": 9, "successors": [ - 9, - 16 + 10, + 19 ], "predecessors": [ - 7, - 16 + 8, + 19 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp14", + "name": "$temp22", "type": { "_": "NumberType" } @@ -2144,28 +2029,25 @@ }, "right": { "_": "Local", - "name": "$temp14", + "name": "$temp22", "type": { "_": "NumberType" } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 9, + "id": 10, "successors": [ - 10, - 13 + 11 ], "predecessors": [ - 8, - 14, - 15 + 9 ], "stmts": [ { @@ -2184,7 +2066,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 11, + "successors": [ + 12, + 16 + ], + "predecessors": [ + 10, + 18 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -2205,48 +2100,18 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 10, + "id": 12, "successors": [ - 1, - 11 + 13 ], "predecessors": [ - 9, 11 ], "stmts": [ @@ -2266,7 +2131,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 13, + "successors": [ + 14, + 15 + ], + "predecessors": [ + 12, + 15 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -2287,15 +2165,27 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 14, + "successors": [ + 2 + ], + "predecessors": [ + 13, + 15 + ], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "k", + "name": "i", "type": { "_": "NumberType" } @@ -2305,7 +2195,7 @@ "op": "+", "left": { "_": "Local", - "name": "k", + "name": "i", "type": { "_": "NumberType" } @@ -2322,22 +2212,22 @@ ] }, { - "id": 11, + "id": 15, "successors": [ - 10, - 12 + 13, + 14 ], "predecessors": [ - 10 + 13 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp19", + "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2363,9 +2253,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp20", + "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2373,9 +2263,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp19", + "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2411,9 +2301,9 @@ "args": [ { "_": "Local", - "name": "$temp20", + "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2423,9 +2313,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp21", + "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2471,9 +2361,9 @@ "args": [ { "_": "Local", - "name": "$temp21", + "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2499,32 +2389,48 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - } - ] - }, - { - "id": 12, - "successors": [], - "predecessors": [ - 11 - ], - "stmts": [ + }, { - "_": "GotoStmt" + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] }, { - "id": 13, + "id": 16, "successors": [ - 14, - 15 + 17, + 18 ], "predecessors": [ - 9 + 11 ], "stmts": [ { @@ -2547,28 +2453,28 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 14, + "id": 17, "successors": [ - 9 + 18 ], "predecessors": [ - 13 + 16 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp17", + "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2594,9 +2500,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp18", + "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2604,9 +2510,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp17", + "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2642,9 +2548,9 @@ "args": [ { "_": "Local", - "name": "$temp18", + "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2653,35 +2559,61 @@ ] }, { - "id": 15, + "id": 18, "successors": [ - 9 + 11 ], "predecessors": [ - 13 + 16, + 17 ], "stmts": [ { - "_": "GotoStmt" + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] }, { - "id": 16, + "id": 19, "successors": [ - 8 + 9 ], "predecessors": [ - 8 + 9 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp15", + "name": "$temp23", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2707,9 +2639,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp16", + "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2717,9 +2649,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp15", + "name": "$temp23", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2755,9 +2687,9 @@ "args": [ { "_": "Local", - "name": "$temp16", + "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2794,19 +2726,21 @@ ] }, { - "id": 17, - "successors": [], + "id": 20, + "successors": [ + 8 + ], "predecessors": [ - 5 + 6 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp22", + "name": "$temp16", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2849,9 +2783,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp23", + "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2859,9 +2793,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp22", + "name": "$temp16", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2897,33 +2831,32 @@ "args": [ { "_": "Local", - "name": "$temp23", + "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 18, - "successors": [], + "id": 21, + "successors": [ + 8 + ], "predecessors": [ - 5 + 6 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp24", + "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2966,9 +2899,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp25", + "name": "$temp19", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2976,9 +2909,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp24", + "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3014,33 +2947,32 @@ "args": [ { "_": "Local", - "name": "$temp25", + "name": "$temp19", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 19, - "successors": [], + "id": 22, + "successors": [ + 8 + ], "predecessors": [ - 5 + 6 ], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp26", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3083,9 +3015,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp27", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3093,9 +3025,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp26", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3131,26 +3063,23 @@ "args": [ { "_": "Local", - "name": "$temp27", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 20, + "id": 23, "successors": [ - 5 + 6 ], "predecessors": [ - 3 + 4 ], "stmts": [ { @@ -3159,7 +3088,7 @@ "_": "Local", "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3204,7 +3133,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3214,7 +3143,7 @@ "_": "Local", "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3252,7 +3181,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -3855,20 +3784,7 @@ "_": "NumberType" } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -3885,7 +3801,20 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [ + 0, + 3 + ], + "stmts": [ { "_": "IfStmt", "condition": { @@ -3906,35 +3835,7 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } @@ -3995,6 +3896,34 @@ } } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } @@ -4070,6 +3999,15 @@ "type": { "_": "StringType" } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } } ], "cfg": { @@ -4152,17 +4090,64 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnStmt", "arg": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-listParameters-8" - }, + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-listParameters-8" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" } } } @@ -4202,7 +4187,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, @@ -4217,13 +4211,13 @@ } }, { - "name": "$temp0", + "name": "$temp1", "type": { "_": "BooleanType" } }, { - "name": "$temp1", + "name": "$temp2", "type": { "_": "BooleanType" } @@ -4235,7 +4229,7 @@ } }, { - "name": "$temp2", + "name": "$temp3", "type": { "_": "BooleanType" } @@ -4274,68 +4268,115 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "x", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-deleteTest-9" - }, - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "bbb", - "type": { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "InstanceFieldRef", + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "x", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, - "field": { + "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "b", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } - } + }, + "args": [] } }, { "_": "AssignStmt", "left": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "right": { "_": "Local", "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "bbb", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "b", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", "type": { "_": "BooleanType" } @@ -4350,7 +4391,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, @@ -4370,7 +4411,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp2", "type": { "_": "BooleanType" } @@ -4431,7 +4472,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } @@ -4442,7 +4483,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "BooleanType" } @@ -4455,7 +4496,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } @@ -4494,14 +4535,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { @@ -4516,21 +4550,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "Person" - }, - "name": "AnonymousMethod-0", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } + "exclamationToken": false } ], "methods": [ @@ -4539,16 +4559,8 @@ "enclosingClass": { "name": "Person" }, - "name": "constructor", - "parameters": [ - { - "name": "age", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -4556,23 +4568,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } - } - }, - { - "name": "age", - "type": { - "_": "NumberType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -4584,37 +4580,91 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "age", + "name": "this", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Person" + } } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "field": { + "enclosingClass": { + "name": "Person" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", "type": { - "_": "ClassType", - "signature": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "field": { + "enclosingClass": { "name": "Person" + }, + "name": "growOld", + "type": { + "_": "UnknownType" } } }, "right": { - "_": "ThisRef", + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "ClassType", + "_": "CallableType", "signature": { - "name": "Person" + "enclosingClass": { + "name": "Person" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [], + "returnType": { + "_": "UnknownType" + } } } } @@ -4633,7 +4683,7 @@ "enclosingClass": { "name": "Person" }, - "name": "AnonymousMethod-0", + "name": "@static_init", "parameters": [], "returnType": { "_": "UnknownType" @@ -4642,23 +4692,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -4672,10 +4706,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } + "_": "UnknownType" } }, "right": { @@ -4688,66 +4719,6 @@ } } }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "age", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - }, { "_": "ReturnVoidStmt" } @@ -4762,9 +4733,256 @@ "enclosingClass": { "name": "Person" }, - "name": "getAge", - "parameters": [], - "returnType": { + "name": "constructor", + "parameters": [ + { + "name": "age", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + { + "name": "age", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Person" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "age", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Person" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "age", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Person" + }, + "name": "getAge", + "parameters": [], + "returnType": { "_": "UnknownType" } }, @@ -4995,18 +5213,62 @@ }, "modifiers": [], "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Alarm" - } - } - } - ], + "body": null + } + ] + }, + { + "signature": { + "name": "Alarm2" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Alarm2" + }, + "name": "alert2", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "Door" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Door" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], "cfg": { "blocks": [ { @@ -5020,10 +5282,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Alarm" - } + "_": "UnknownType" } }, "right": { @@ -5031,7 +5290,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Alarm" + "name": "Door" } } } @@ -5044,44 +5303,22 @@ ] } } - } - ] - }, - { - "signature": { - "name": "Alarm2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ + }, { "signature": { "enclosingClass": { - "name": "Alarm2" + "name": "Door" }, - "name": "alert2", + "name": "@static_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Alarm2" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5094,19 +5331,66 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Alarm2" + "name": "Door" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Door" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Alarm2" + "name": "Door" } } } @@ -5122,17 +5406,6 @@ } ] }, - { - "signature": { - "name": "Door" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [] - }, { "signature": { "name": "Adder" @@ -5155,37 +5428,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "Adder" - }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "StringType" - } - }, - "args": [ - { - "_": "Local", - "name": "b", - "type": { - "_": "UnknownType" - } - } - ] - } + "exclamationToken": false } ], "methods": [ @@ -5194,16 +5437,8 @@ "enclosingClass": { "name": "Adder" }, - "name": "constructor", - "parameters": [ - { - "name": "a", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -5211,23 +5446,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Adder" - } - } - }, - { - "name": "a", - "type": { - "_": "NumberType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5239,37 +5458,67 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "a", + "name": "this", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Adder" + } } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + "field": { + "enclosingClass": { "name": "Adder" + }, + "name": "add", + "type": { + "_": "UnknownType" } } }, "right": { - "_": "ThisRef", + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "ClassType", + "_": "CallableType", "signature": { - "name": "Adder" + "enclosingClass": { + "name": "Adder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } } } } @@ -5288,40 +5537,208 @@ "enclosingClass": { "name": "Adder" }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "@static_init", + "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Adder" - } - } - }, - { - "name": "b", - "type": { - "_": "StringType" - } - }, - { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Adder" + }, + "name": "constructor", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + { + "name": "a", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Adder" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "a", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Adder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + { + "name": "b", + "type": { + "_": "StringType" + } + }, + { "name": "$temp0", "type": { "_": "UnknownType" @@ -5330,7 +5747,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -5418,7 +5835,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -5446,7 +5863,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } } } @@ -5482,28 +5899,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "InstanceFieldRef", - "instance": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "add", - "type": { - "_": "UnknownType" - } - } - } + "exclamationToken": false }, { "signature": { @@ -5518,37 +5914,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "ExtendedAdder" - }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "StringType" - } - }, - "args": [ - { - "_": "Local", - "name": "b", - "type": { - "_": "UnknownType" - } - } - ] - } + "exclamationToken": false } ], "methods": [ @@ -5557,46 +5923,16 @@ "enclosingClass": { "name": "ExtendedAdder" }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } - } - }, - { - "name": "b", - "type": { - "_": "StringType" - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5608,9 +5944,236 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "b", + "name": "this", "type": { - "_": "StringType" + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "superAdd", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "add", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "add", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", + "type": { + "_": "CallableType", + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + { + "name": "b", + "type": { + "_": "StringType" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "b", + "type": { + "_": "StringType" } }, "right": { @@ -5700,87 +6263,120 @@ ] } } - } - ] - }, - { - "signature": { - "name": "AnonymousClass-0" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-0" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-0" + "name": "ExtendedAdder" }, - "name": "y", - "type": { - "_": "NumberType" + "name": "constructor", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-0" - }, - "name": "z", - "type": { - "_": "StringType" + "body": { + "locals": [ + { + "name": "a", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "super", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "a", + "type": { + "_": "NumberType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null + } } - ], - "methods": [] + ] }, { "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-0" }, - "modifiers": [ - "ExportKeyword" - ], + "modifiers": [], "typeParameters": [], - "superClassName": "Door", - "implementedInterfaceNames": [ - "Alarm", - "Alarm2" - ], + "superClassName": "", + "implementedInterfaceNames": [], "fields": [ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-0" }, "name": "x", "type": { @@ -5790,94 +6386,66 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-0" }, "name": "y", "type": { - "_": "StringType" + "_": "NumberType" } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "''", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-0" }, - "name": "Members", + "name": "z", "type": { - "_": "UnknownType" + "_": "StringType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "", - "type": { - "_": "UnknownType" - } - } + "exclamationToken": false } ], + "methods": [] + }, + { + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], "methods": [ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-SecurityDoor-@instance_init-1" }, - "name": "alert", + "name": "@instance_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } - } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5891,10 +6459,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } + "_": "UnknownType" } }, "right": { @@ -5902,43 +6467,11 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-SecurityDoor-@instance_init-1" } } } }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "logger", - "type": { - "_": "UnknownType" - } - }, - "method": { - "enclosingClass": { - "name": "" - }, - "name": "info", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Constant", - "value": "SecurityDoor alert", - "type": { - "_": "StringType" - } - } - ] - } - }, { "_": "ReturnVoidStmt" } @@ -5951,34 +6484,18 @@ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-SecurityDoor-@instance_init-1" }, - "name": "alert2", + "name": "@static_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } - } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5992,10 +6509,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } + "_": "UnknownType" } }, "right": { @@ -6003,43 +6517,11 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-SecurityDoor-@instance_init-1" } } } }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "logger", - "type": { - "_": "UnknownType" - } - }, - "method": { - "enclosingClass": { - "name": "" - }, - "name": "info", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Constant", - "value": "SecurityDoor alert2", - "type": { - "_": "StringType" - } - } - ] - } - }, { "_": "ReturnVoidStmt" } @@ -6052,34 +6534,157 @@ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-SecurityDoor-@instance_init-1" }, - "name": "fooo", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "SecurityDoor" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "Door", + "implementedInterfaceNames": [ + "Alarm", + "Alarm2" + ], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "x", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "y", + "type": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "z", + "type": { + "_": "UnclearReferenceType", + "name": "Person" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "Members", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" ], "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "Person" } } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } } ], "cfg": { @@ -6094,53 +6699,2030 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { "name": "SecurityDoor" } } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "y", + "type": { + "_": "StringType" + } + } + }, + "right": { + "_": "Constant", + "value": "", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "method": { + "enclosingClass": { + "name": "Person" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "10", + "type": { + "_": "NumberType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "z", + "type": { + "_": "UnclearReferenceType", + "name": "Person" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "Members", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "AnonymousClass-SecurityDoor-@instance_init-1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "alert", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SecurityDoor alert", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "alert2", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SecurityDoor alert2", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "fooo", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "This is fooo!", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "constructor", + "parameters": [ + { + "name": "x", + "type": { + "_": "NumberType" + }, + "isOptional": false + }, + { + "name": "y", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "x", + "type": { + "_": "NumberType" + } + }, + { + "name": "y", + "type": { + "_": "StringType" + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "x", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "y", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 1, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "" + }, + "name": "super", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "y", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "y", + "type": { + "_": "StringType" + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "This is a constrctor!", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Animal" + }, + "modifiers": [ + "AbstractKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "name", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "constructor", + "parameters": [ + { + "name": "name", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + { + "name": "name", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "name", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "sayHi", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [ + "PublicKeyword", + "AbstractKeyword" + ], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "StringValidator" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "color", + "type": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": true, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "width", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": true, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "isAcceptable", + "parameters": [ + { + "name": "s", + "type": { + "_": "StringType" + }, + "isOptional": true + } + ], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "pattern", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "pattern", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "pattern", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "[%d] [%p] [%z] [ArkAnalyzer] - %m", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "layout", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "console", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "layout", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "console", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "appenders", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "level", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "enableCallStack", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "console", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "appenders", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "level", + "type": { + "_": "UnknownType" + } + } }, "right": { - "_": "ThisRef", + "_": "Constant", + "value": "info", "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } + "_": "StringType" } } }, { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "logger", + "name": "this", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } } }, - "method": { + "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "info", - "parameters": [], - "returnType": { + "name": "enableCallStack", + "type": { "_": "UnknownType" } - }, - "args": [ - { - "_": "Constant", - "value": "This is fooo!", - "type": { - "_": "StringType" - } - } - ] + } + }, + "right": { + "_": "Constant", + "value": "false", + "type": { + "_": "BooleanType" + } } }, { @@ -6151,29 +8733,42 @@ ] } } - }, + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" }, - "name": "constructor", - "parameters": [ - { - "name": "x", - "type": { - "_": "NumberType" - }, - "isOptional": false - }, - { - "name": "y", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "default", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -6183,31 +8778,13 @@ "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } - }, - { - "name": "x", - "type": { - "_": "NumberType" - } - }, - { - "name": "y", - "type": { - "_": "StringType" - } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } } ], "cfg": { @@ -6221,33 +8798,18 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "x", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "NumberType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "y", + "name": "this", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 1, + "_": "ThisRef", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } } } }, @@ -6255,20 +8817,20 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } }, "right": { - "_": "ThisRef", - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } } @@ -6276,50 +8838,28 @@ { "_": "CallStmt", "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "super", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "InstanceFieldRef", + "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } }, - "field": { + "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "x", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } - } - }, - "right": { - "_": "Local", - "name": "x", - "type": { - "_": "NumberType" - } + }, + "args": [] } }, { @@ -6332,15 +8872,15 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" }, - "name": "y", + "name": "default", "type": { "_": "UnknownType" } @@ -6348,42 +8888,13 @@ }, "right": { "_": "Local", - "name": "y", + "name": "$temp0", "type": { - "_": "StringType" - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "logger", - "type": { - "_": "UnknownType" - } - }, - "method": { - "enclosingClass": { - "name": "" - }, - "name": "info", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Constant", - "value": "This is a constrctor!", - "type": { - "_": "StringType" - } + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } - ] + } } }, { @@ -6399,11 +8910,9 @@ }, { "signature": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "modifiers": [ - "AbstractKeyword" - ], + "modifiers": [], "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], @@ -6411,61 +8920,66 @@ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "name", + "name": "appenders", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "categories", "type": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "constructor", - "parameters": [ - { - "name": "name", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" } } }, { - "name": "name", + "name": "$temp1", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } } } ], @@ -6480,16 +8994,18 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "name", + "name": "this", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } } } }, @@ -6497,24 +9013,135 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" } } }, "right": { - "_": "ThisRef", + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "appenders", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" } } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -6525,15 +9152,15 @@ "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "name", + "name": "categories", "type": { "_": "UnknownType" } @@ -6541,9 +9168,12 @@ }, "right": { "_": "Local", - "name": "name", + "name": "$temp1", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } } } }, @@ -6555,35 +9185,56 @@ ] } } - }, + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + }, + "modifiers": [], + "typeParameters": [ + { + "_": "UNKNOWN_TYPE", + "type": "Type" + } + ], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "sayHi", + "name": "content", + "type": { + "_": "UnclearReferenceType", + "name": "Type" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + }, + "name": "@instance_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword", - "AbstractKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -6597,10 +9248,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } + "_": "UnknownType" } }, "right": { @@ -6608,7 +9256,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } } @@ -6621,71 +9269,75 @@ ] } } - } - ] - }, - { - "signature": { - "name": "StringValidator" - }, - "modifiers": [ - "ExportKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + }, { "signature": { "enclosingClass": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "color", - "type": { - "_": "StringType" + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": true, - "exclamationToken": false, - "initializer": null + } }, { "signature": { "enclosingClass": { - "name": "StringValidator" - }, - "name": "width", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": true, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "isAcceptable", + "name": "constructor", "parameters": [ { - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" }, - "isOptional": true + "isOptional": false } ], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], @@ -6697,14 +9349,15 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, { - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } } ], @@ -6715,20 +9368,46 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } } }, @@ -6740,7 +9419,7 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, @@ -6749,9 +9428,42 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "content", + "type": { + "_": "UnknownType" } } + }, + "right": { + "_": "Local", + "name": "value", + "type": { + "_": "UnclearReferenceType", + "name": "Type" + } } }, { @@ -6767,163 +9479,7 @@ }, { "signature": { - "name": "AnonymousClass-4" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-4" - }, - "name": "type", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'pattern'", - "type": { - "_": "StringType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-4" - }, - "name": "pattern", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'[%d] [%p] [%z] [ArkAnalyzer] - %m'", - "type": { - "_": "StringType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-3" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-3" - }, - "name": "type", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'console'", - "type": { - "_": "StringType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-3" - }, - "name": "layout", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-4" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-4" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-2" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-3" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-3" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, "modifiers": [], "typeParameters": [], @@ -6933,44 +9489,24 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "appenders", + "name": "x", "type": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'console'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "questionToken": false, + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "level", + "name": "y", "type": { "_": "UnknownType" } @@ -6978,21 +9514,14 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'info'", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "enableCallStack", + "name": "z", "type": { "_": "UnknownType" } @@ -7000,60 +9529,161 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "false", - "type": { - "_": "BooleanType" - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-5" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-5" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "default", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-6" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-6" - } + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "u", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "y", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "v", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "z", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "w", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, "modifiers": [], "typeParameters": [], @@ -7063,9 +9693,9 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "appenders", + "name": "a", "type": { "_": "UnknownType" } @@ -7073,26 +9703,14 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-2" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-2" - } - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "categories", + "name": "b", "type": { "_": "UnknownType" } @@ -7100,72 +9718,17 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-5" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-5" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - }, - "modifiers": [], - "typeParameters": [ - { - "_": "UNKNOWN_TYPE", - "type": "Type" - } - ], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - }, - "name": "content", - "type": { - "_": "UnclearReferenceType", - "name": "Type" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "constructor", - "parameters": [ - { - "name": "value", - "type": { - "_": "UnclearReferenceType", - "name": "Type" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -7175,19 +9738,13 @@ "body": { "locals": [ { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - { - "name": "value", + "name": "$temp0", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } ], @@ -7202,40 +9759,145 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "value", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "42", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "NewArrayExpr", + "elementType": { + "_": "NumberType" + }, + "size": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } }, "right": { - "_": "ThisRef", + "_": "Constant", + "value": "5", "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" } + }, + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "100", + "type": { + "_": "NumberType" } } }, @@ -7249,15 +9911,15 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "content", + "name": "b", "type": { "_": "UnknownType" } @@ -7265,10 +9927,13 @@ }, "right": { "_": "Local", - "name": "value", + "name": "$temp0", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -7282,163 +9947,6 @@ } } ] - }, - { - "signature": { - "name": "AnonymousClass-listParameters-8" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-listParameters-8" - }, - "name": "x", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "u", - "type": { - "_": "UnknownType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-listParameters-8" - }, - "name": "y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "v", - "type": { - "_": "UnknownType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-listParameters-8" - }, - "name": "z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "w", - "type": { - "_": "UnknownType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-deleteTest-9" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-deleteTest-9" - }, - "name": "a", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "42", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-deleteTest-9" - }, - "name": "b", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "5", - "type": { - "_": "NumberType" - } - }, - { - "_": "Constant", - "value": "100", - "type": { - "_": "NumberType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "NumberType" - }, - { - "_": "NumberType" - } - ] - } - } - } - ], - "methods": [] } ], "importInfos": [ @@ -7467,7 +9975,6 @@ { "exportClauseName": "classMethodTest", "exportClauseType": 2, - "nameBeforeAs": "classMethodTest", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7480,7 +9987,6 @@ { "exportClauseName": "foo", "exportClauseType": 2, - "nameBeforeAs": "foo", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7493,7 +9999,6 @@ { "exportClauseName": "listParameters", "exportClauseType": 2, - "nameBeforeAs": "listParameters", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7506,7 +10011,6 @@ { "exportClauseName": "SecurityDoor", "exportClauseType": 1, - "nameBeforeAs": "SecurityDoor", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7524,7 +10028,7 @@ "DefaultKeyword" ], "originTsPosition": { - "line": 199, + "line": 200, "col": 1 } }, @@ -7536,7 +10040,7 @@ "ExportKeyword" ], "originTsPosition": { - "line": 200, + "line": 201, "col": 1 } }, @@ -7548,44 +10052,40 @@ "ExportKeyword" ], "originTsPosition": { - "line": 201, + "line": 202, "col": 1 } }, { "exportClauseName": "StringValidator", "exportClauseType": 1, - "nameBeforeAs": "StringValidator", "isDefault": false, "modifiers": [ "ExportKeyword" ], "originTsPosition": { - "line": 202, + "line": 203, "col": 1 } }, { "exportClauseName": "ExtAdder", "exportClauseType": 4, - "exportFrom": "", "nameBeforeAs": "ExtendedAdder", "isDefault": false, "modifiers": [], "originTsPosition": { - "line": 207, + "line": 208, "col": 1 } }, { "exportClauseName": "ExtendedAdder", "exportClauseType": 4, - "exportFrom": "", - "nameBeforeAs": "ExtendedAdder", "isDefault": false, "modifiers": [], "originTsPosition": { - "line": 207, + "line": 208, "col": 1 } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json new file mode 100644 index 000000000..0deaa861b --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json @@ -0,0 +1,2144 @@ +{ + "name": "save/enums.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "ALL_BUILD_STAGE", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + }, + { + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + { + "name": "nameOfsystemComponent", + "type": { + "_": "UnknownType" + } + }, + { + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + { + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + { + "name": "Object", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + { + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + { + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "key", + "type": { + "_": "UnknownType" + } + }, + { + "name": "value", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp11", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp13", + "type": { + "_": "BooleanType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [ + 1 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "UnknownType" + }, + "size": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "ALL_BUILD_STAGE", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "SystemComponent", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "nameOfsystemComponent", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "right": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "Object", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "entries", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 5 + ], + "predecessors": [ + 0, + 5 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "Constant", + "value": "true", + "type": { + "_": "BooleanType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [ + 1 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp11", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "hasOwnProperty", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SystemComponent", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "UnopExpr", + "op": "!", + "arg": { + "_": "Local", + "name": "$temp11", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", + "left": { + "_": "Local", + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [ + 2, + 4 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp13", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "DeleteExpr", + "arg": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "'x'", + "type": { + "_": "UnknownType" + } + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 4, + "successors": [ + 3 + ], + "predecessors": [ + 2 + ], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "error", + "type": { + "_": "StringType" + } + } + ] + } + } + ] + }, + { + "id": 5, + "successors": [ + 1 + ], + "predecessors": [ + 1 + ], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "CastExpr", + "arg": { + "_": "Local", + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "key", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "key", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "SceneBuildStage" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "ALL", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "<<", + "left": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "<<", + "left": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "|", + "left": { + "_": "Local", + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "all", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "ALL", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "StringType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "length", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ValueTag" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ValueTag" + }, + "name": "TAINT", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ValueTag" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ValueTag" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ExportType" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "NAME_SPACE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "CLASS", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "METHOD", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "LOCAL", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "UNKNOWN", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "NAME_SPACE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "CLASS", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "METHOD", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "LOCAL", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "UNKNOWN", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ViewTreeNodeType" + }, + "modifiers": [ + "DeclareKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "SystemComponent", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "CustomComponent", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "Builder", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "BuilderParam", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ViewTreeNodeType" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [ + { + "exportClauseName": "ValueTag", + "exportClauseType": 1, + "isDefault": false, + "modifiers": [ + "ExportKeyword" + ], + "originTsPosition": { + "line": 14, + "col": 1 + } + }, + { + "exportClauseName": "ExportType", + "exportClauseType": 1, + "isDefault": false, + "modifiers": [ + "ExportKeyword" + ], + "originTsPosition": { + "line": 18, + "col": 1 + } + } + ] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json index 3933ebc94..bd8c5bbe1 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json @@ -450,7 +450,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -578,7 +578,8 @@ { "id": 0, "successors": [ - 1 + 1, + 2 ], "predecessors": [], "stmts": [ @@ -665,7 +666,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -674,6 +675,21 @@ { "id": 1, "successors": [], + "predecessors": [ + 0, + 2 + ], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 2, + "successors": [ + 1 + ], "predecessors": [ 0 ], @@ -747,9 +763,6 @@ } } } - }, - { - "_": "ReturnVoidStmt" } ] } diff --git a/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts b/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts deleted file mode 100644 index 4146eab96..000000000 --- a/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - x: number = 99 -} diff --git a/jacodb-ets/src/test/resources/samples/PrependInitializer.ts b/jacodb-ets/src/test/resources/samples/PrependInitializer.ts deleted file mode 100644 index e2dbaddeb..000000000 --- a/jacodb-ets/src/test/resources/samples/PrependInitializer.ts +++ /dev/null @@ -1,18 +0,0 @@ -class Foo { - constructor() { - console.log("new Foo"); - } - - foo() { - Foo.y = 112; - console.log('print-foo'); - } - - static bar() { - this.y = 111; - console.log('print-bar') - } - - x: number = 99 - static y: number = 109 -} diff --git a/jacodb-ets/src/test/resources/samples/StaticField.ts b/jacodb-ets/src/test/resources/samples/StaticField.ts deleted file mode 100644 index beeb26ce0..000000000 --- a/jacodb-ets/src/test/resources/samples/StaticField.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor() { - } - - static y: number = 109 -} diff --git a/jacodb-ets/src/test/resources/samples/enums.ts b/jacodb-ets/src/test/resources/samples/enums.ts deleted file mode 100644 index 32910152b..000000000 --- a/jacodb-ets/src/test/resources/samples/enums.ts +++ /dev/null @@ -1,104 +0,0 @@ -let $temp0: any; -let c: Circle; -let a2: any; -let nameOfA: any; -let directions: (any)[]; -let $temp1: any; -let $temp2: any; -let $temp3: any; -let $temp4: any; -let $temp5: (any)[]; - -$temp0 = Response1.Yes; -respond('Princess Caroline',$temp0); -c = @save/enums: AnonymousClass-enums.ts-1; -f(E); -a2 = Enum.A; -nameOfA = Enum.a2; -$temp1 = Directions.Up; -$temp2 = Directions.Down; -$temp3 = Directions.Left; -$temp4 = Directions.Right; -$temp5 = new Array(1); -directions = $temp5; -return; -enum Direction1{ - Up, - Down, - Left, - Right, -} -enum Direction2{ - Up, - Down, - Left, - Right, -} -enum BooleanLikeHeterogeneousEnum{ - No, - Yes, -} -enum E1{ - X, - Y, - Z, -} -enum E2{ - A, - B, - C, -} -enum FileAccess{ - None, - Read, - Write, - ReadWrite, - G, -} -enum Response1{ - No, - Yes, -} -function respond(recipient: string,message: Response1): void { - - - - return; -} -enum ShapeKind{ - Circle, - Square, -} -interface Circle{ - kind:ShapeKind.Circle; - radius:number; -} -interface Square{ - kind:ShapeKind.Square; - sideLength:number; -} -object AnonymousClass-enums.ts-1{ - kind; - radius; -} -enum E{ - X, - Y, - Z, -} -function f(obj: any){ - let $temp0: any; - - - $temp0 = obj.X; - return $temp0; -} -declare enum Enum{ - A, -} -const enum Directions{ - Up, - Down, - Left, - Right, -} diff --git a/jacodb-ets/src/test/resources/samples/initializers.ts b/jacodb-ets/src/test/resources/samples/initializers.ts new file mode 100644 index 000000000..b85051440 --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/initializers.ts @@ -0,0 +1,19 @@ +class Foo { + x: number = 99 + + static y: number = 111 + + constructor() { + console.log("inside Foo::constructor"); + } + + foo() { + Foo.y = 222; + console.log('inside Foo::foo'); + } + + static bar() { + this.y = 333; + console.log('inside Foo::bar') + } +} diff --git a/jacodb-ets/src/test/resources/samples/basic.ts b/jacodb-ets/src/test/resources/samples/save/basic.ts similarity index 99% rename from jacodb-ets/src/test/resources/samples/basic.ts rename to jacodb-ets/src/test/resources/samples/save/basic.ts index c152b5911..09bf3ea36 100644 --- a/jacodb-ets/src/test/resources/samples/basic.ts +++ b/jacodb-ets/src/test/resources/samples/save/basic.ts @@ -151,6 +151,7 @@ export function listParameters(u: number, v: number, w: string): { x: number, y: export class SecurityDoor extends Door implements Alarm, Alarm2 { x: number = 0; y: string = ''; + z: Person = new Person(10); alert(): void { logger.info("SecurityDoor alert"); } diff --git a/jacodb-ets/src/test/resources/samples/save/enums.ts b/jacodb-ets/src/test/resources/samples/save/enums.ts new file mode 100644 index 000000000..375202b3d --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/save/enums.ts @@ -0,0 +1,45 @@ +enum SceneBuildStage { + BUILD_INIT = 1 << 1, + CLASS_DONE = 1 << 2, + METHOD_DONE = BUILD_INIT | CLASS_DONE, + ALL = 'all'.length, +} + +const ALL_BUILD_STAGE = [ + SceneBuildStage.BUILD_INIT, + SceneBuildStage.CLASS_DONE, + SceneBuildStage.METHOD_DONE, +]; + +export enum ValueTag { + TAINT, +} + +export enum ExportType { + NAME_SPACE = 0, + CLASS = 1, + METHOD = 2, + LOCAL = 3, + UNKNOWN = 4, +} + +declare enum ViewTreeNodeType { + SystemComponent, + CustomComponent, + Builder, + BuilderParam, +} + +let systemComponent = ViewTreeNodeType.SystemComponent; +let nameOfsystemComponent = ViewTreeNodeType[systemComponent]; + +let obj: Object = { x: 1 }; +for (const [key, value] of Object.entries(ViewTreeNodeType)) { + obj[key] = value; +} + +if (!obj.hasOwnProperty('SystemComponent')) { + console.log('error'); +} + +delete obj['x']; diff --git a/jacodb-ets/src/test/resources/samples/taint.ts b/jacodb-ets/src/test/resources/samples/taint.ts index 7b245f285..ea6ee035b 100644 --- a/jacodb-ets/src/test/resources/samples/taint.ts +++ b/jacodb-ets/src/test/resources/samples/taint.ts @@ -1,26 +1,30 @@ -function source(): number|null { +function source(): number | null { return null; } -function pass(data: number|null): number|null { + +function pass(data: number | null): number | null { return data; } -function validate(data: number|null): number { + +function validate(data: number | null): number { if (data == null) { return 0; } return data; } -function sink(data: number|null) { + +function sink(data: number | null) { if (data == null) { - new Error('Error!'); - throw $temp0 + throw new Error("Error!"); } } + function bad() { let data = source(); data = pass(data); sink(data); } + function good() { let data = source(); data = validate(data); diff --git a/jacodb-ets/src/test/resources/structure.txt b/jacodb-ets/src/test/resources/structure.txt new file mode 100644 index 000000000..fff9e895f --- /dev/null +++ b/jacodb-ets/src/test/resources/structure.txt @@ -0,0 +1,38 @@ +resources/ # +├── source/ # Sample source (TS/ETS) files +│ ├── *.ts # +│ └── *.ets # +├── etsir/ # EtsIR (JSON dump of ArkIR for ETS sources) for samples +│ └── *.ts.json # +├── abc/ # Compiled samples (ABC) +│ └── *.abc # +├── abcir/ # AbcIR (JSON dump of ArkIR for ABC inputs) for samples +│ └── *.abc.json # +├── dot/ # DOT files for visualizing IRs +│ ├── *.ts.json.dot # +│ └── *.abc.json.dot # +├── pdf/ # Rendered PDFs from DOT files +│ └── *.ts.json.pdf # +│ └── *.abc.json.pdf # +│ # +└── projects/ # Directory for individual projects + ├── projects.txt # List of projects and their URLs + ├── / # Some individual project + │ ├── README.md # + │ ├── source/ # TS/ETS files for the project + │ │ ├── *.ts # (note: can be an actual git repo) + │ │ └── *.ets # (note: typically, deeply nested) + │ ├── etsir/ # JSON dump of ArkIR for TS files in the project + │ │ └── *.ts.json # + │ ├── hap/ # HAP files for the project + │ │ └── *.hap # + │ ├── abc/ # Compiled ABC files (or extracted from HAP) for the project + │ │ └── *.abc # + │ ├── abcir/ # IR for ABC files for the project + │ │ └── *.abc.json # + │ ├── dot/ # DOT files for visualizing IRs for the project + │ │ └── *.dot # + │ └── pdf/ # Rendered PDFs from DOT files for the project + │ └── *.pdf # + ├── / # + ... From 460d2251d299a0ea33b64c73430bf9d728819bef Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Tue, 6 Aug 2024 16:27:31 +0300 Subject: [PATCH 2/9] Use LocalDto type for instance --- jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt index d0e220ce3..22adf1be7 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt @@ -386,7 +386,7 @@ sealed interface FieldRefDto : RefDto { @Serializable @SerialName("InstanceFieldRef") data class InstanceFieldRefDto( - val instance: ValueDto, + val instance: LocalDto, override val field: FieldSignatureDto, ) : FieldRefDto { override fun toString(): String { From 34297303780363b13edba96d832266a913d895a0 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Tue, 6 Aug 2024 16:29:53 +0300 Subject: [PATCH 3/9] Update ArkIR --- .../etsir/samples/MethodCollision.ts.json | 51 +- .../etsir/samples/cases/case2.ts.json | 148 +++- .../etsir/samples/cases/case3.ts.json | 32 +- .../samples/classes/AbstractClass.ts.json | 28 +- .../samples/classes/AccessModifiers.ts.json | 4 - .../samples/classes/ConstructorClass.ts.json | 2 - .../samples/classes/GenericClass.ts.json | 2 - .../samples/classes/InheritanceClass.ts.json | 4 - .../classes/InterfaceImplementation.ts.json | 3 - .../etsir/samples/classes/SimpleClass.ts.json | 26 +- .../samples/classes/SingletonClass.ts.json | 3 - .../etsir/samples/classes/StaticClass.ts.json | 27 +- .../etsir/samples/initializers.ts.json | 4 - .../samples/loop/BreadthFirstSearch.ts.json | 84 +- .../samples/loop/DepthFirstSearch.ts.json | 687 ++++++++++++++--- .../samples/loop/DijkstrasAlgorithm.ts.json | 5 - .../etsir/samples/loop/ForInLoop.ts.json | 80 +- .../samples/loop/MatrixMultiplication.ts.json | 82 +- .../etsir/samples/loop/NestedLoops.ts.json | 78 +- .../resources/etsir/samples/object.ts.json | 155 +++- .../etsir/samples/save/basic.ts.json | 722 ++++++++++++++++-- .../etsir/samples/save/enums.ts.json | 94 ++- 22 files changed, 2075 insertions(+), 246 deletions(-) diff --git a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json index 0f26ca797..eec2a12e6 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json @@ -795,7 +795,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "a", "type": { "_": "ClassType", @@ -1213,7 +1212,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1318,6 +1316,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -1564,7 +1586,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1669,6 +1690,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json index 8c219b189..5f414f349 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json @@ -471,6 +471,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -664,6 +688,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Size" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -1345,6 +1393,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Request" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -1443,7 +1515,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1475,7 +1546,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1510,6 +1580,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json index d0c7fd4c5..4ad98e72c 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json @@ -483,7 +483,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1006,7 +1005,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1063,7 +1061,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1126,7 +1123,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1211,7 +1207,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1296,7 +1291,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1381,7 +1375,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1431,7 +1424,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1505,6 +1497,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json index 6359013d9..26805c1ba 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json @@ -430,6 +430,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Shape" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -743,7 +767,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -775,7 +798,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -895,7 +917,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -927,7 +948,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json index cd3631785..72843a374 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json @@ -202,7 +202,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "user", "type": { "_": "ClassType", @@ -601,7 +600,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -633,7 +631,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -665,7 +662,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json index 6a086583d..e06531ed6 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json @@ -496,7 +496,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -604,7 +603,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json index dba309813..7abd9f00f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json @@ -676,7 +676,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -786,7 +785,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json index f97f61133..89441695c 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json @@ -574,7 +574,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -682,7 +681,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1018,7 +1016,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1126,7 +1123,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json index 3cd0fc1d2..f60451e8f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json @@ -532,7 +532,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -664,7 +663,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "Math", "type": { "_": "UnknownType" @@ -693,7 +691,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json index 3a5c99558..08b536c72 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json @@ -498,7 +498,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -606,7 +605,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -683,6 +681,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json index 09105ef04..a6a7cd5f9 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json @@ -611,7 +611,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -695,7 +694,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -787,7 +785,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "Logger", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json index 9cd9d2c90..b299f7879 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json @@ -306,7 +306,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -383,6 +382,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -466,7 +489,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -597,7 +619,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json index 15e105a20..134b9533d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json @@ -166,7 +166,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -248,7 +247,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -480,7 +478,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "Foo", "type": { "_": "UnknownType" @@ -612,7 +609,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json index e065e7a56..1eaa2ab3b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json @@ -675,7 +675,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -937,7 +936,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "UnclearReferenceType", @@ -1058,7 +1056,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -1126,7 +1123,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -1646,7 +1642,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1743,7 +1738,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1840,7 +1834,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1937,7 +1930,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2000,7 +1992,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2063,7 +2054,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2102,6 +2092,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json index f81a941b6..c735e9161 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json @@ -800,7 +800,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -965,7 +964,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1030,7 +1028,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1096,7 +1093,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1160,7 +1156,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1237,7 +1232,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1482,7 +1476,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1517,6 +1510,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -1592,7 +1659,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1627,6 +1693,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -1751,7 +1891,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1832,7 +1971,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1916,7 +2054,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1954,41 +2091,13 @@ ] } } - } - ] - }, - { - "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" - }, - "name": "value", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false - } - ], - "methods": [ + }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, - "name": "@instance_init", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" @@ -2019,41 +2128,33 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" } } } }, { - "_": "AssignStmt", - "left": { - "_": "InstanceFieldRef", + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", "instance": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" - } + "_": "UnknownType" } }, - "field": { + "method": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, - "name": "value", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } - } - }, - "right": { - "_": "Constant", - "value": "6", - "type": { - "_": "NumberType" - } + }, + "args": [] } }, { @@ -2069,7 +2170,7 @@ }, { "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" }, "modifiers": [], "typeParameters": [], @@ -2079,7 +2180,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" }, "name": "value", "type": { @@ -2096,7 +2197,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" }, "name": "@instance_init", "parameters": [], @@ -2129,7 +2230,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" } } } @@ -2139,18 +2240,17 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" } } }, "field": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" }, "name": "value", "type": { @@ -2160,7 +2260,7 @@ }, "right": { "_": "Constant", - "value": "7", + "value": "6", "type": { "_": "NumberType" } @@ -2174,33 +2274,290 @@ ] } } - } - ] - }, - { - "signature": { - "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" }, - "name": "value", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false - }, + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "7", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, { "signature": { "enclosingClass": { @@ -2298,7 +2655,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2379,7 +2735,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2463,7 +2818,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2501,6 +2855,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -2625,7 +3053,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2706,7 +3133,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2790,7 +3216,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2828,6 +3253,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json index 4cbc8214e..9954c2aa7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json @@ -1953,7 +1953,6 @@ "size": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2081,7 +2080,6 @@ "size": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2207,7 +2205,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2398,7 +2395,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2534,7 +2530,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "graph", "type": { "_": "ArrayType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json index d787bd1fa..f8f90313f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json @@ -329,7 +329,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -408,7 +407,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -529,7 +527,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "person", "type": { "_": "ClassType", @@ -720,7 +717,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -752,7 +748,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -784,7 +779,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -819,6 +813,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json index 4cde657df..cc374740a 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json @@ -1601,7 +1601,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "A", "type": { "_": "ArrayType", @@ -1684,7 +1683,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ArrayType", @@ -1717,7 +1715,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "B", "type": { "_": "ArrayType", @@ -1800,7 +1797,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ArrayType", @@ -2191,7 +2187,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "result", "type": { "_": "UnknownType" @@ -2401,7 +2396,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp4", "type": { "_": "UnknownType" @@ -2423,7 +2417,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp4", "type": { "_": "UnknownType" @@ -2756,7 +2749,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2791,6 +2783,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json index 91fe63049..7f4a90e3b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json @@ -692,7 +692,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -814,7 +813,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -963,7 +961,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp8", "type": { "_": "ClassType", @@ -1030,7 +1027,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp8", "type": { "_": "ClassType", @@ -1259,6 +1255,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json index d67fbe2aa..aaee68b7c 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json @@ -447,7 +447,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -504,7 +503,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -543,7 +541,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -693,7 +690,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -725,7 +721,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -760,6 +755,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -880,7 +949,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -912,7 +980,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1257,6 +1324,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json index 44035fdbf..a0e969906 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json @@ -724,7 +724,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "myPerson", "type": { "_": "ClassType", @@ -1393,7 +1392,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "sampleData", "type": { "_": "ArrayType", @@ -3587,7 +3585,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "notPerson", "type": { "_": "ClassType", @@ -4352,7 +4349,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "x", "type": { "_": "ClassType", @@ -4386,7 +4382,6 @@ "arg": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "x", "type": { "_": "ClassType", @@ -4600,7 +4595,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -4632,7 +4626,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -4918,7 +4911,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5049,7 +5041,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5395,6 +5386,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Door" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -5478,7 +5493,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5809,7 +5823,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5964,7 +5977,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5986,7 +5998,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6011,7 +6022,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6320,6 +6330,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "CallStmt", "expr": { @@ -6572,6 +6606,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -6718,7 +6776,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6750,7 +6807,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6839,7 +6895,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6875,7 +6930,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7436,7 +7490,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7468,7 +7521,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7784,7 +7836,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7995,7 +8046,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8027,7 +8077,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8062,6 +8111,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -8162,7 +8285,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8243,7 +8365,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8281,6 +8402,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -8415,7 +8610,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8453,16 +8647,90 @@ ] } } - } - ] - }, - { - "signature": { - "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", "implementedInterfaceNames": [], "fields": [ { @@ -8630,7 +8898,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8666,7 +8933,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8698,7 +8964,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8733,6 +8998,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -8867,7 +9206,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8905,6 +9243,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -9063,7 +9475,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9147,7 +9558,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9185,6 +9595,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -9438,7 +9922,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9579,7 +10062,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9611,7 +10093,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9643,7 +10124,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9678,6 +10158,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] }, @@ -9779,7 +10333,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9906,7 +10459,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9945,6 +10497,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json index 0deaa861b..91e0ca7d7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json @@ -246,7 +246,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -275,7 +274,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -304,7 +302,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -487,7 +484,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "ViewTreeNodeType", "type": { "_": "UnknownType" @@ -516,7 +512,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "ViewTreeNodeType", "type": { "_": "UnknownType" @@ -744,7 +739,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -909,7 +903,6 @@ "arg": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -997,7 +990,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -1117,7 +1109,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -1282,7 +1273,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1325,7 +1315,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1368,7 +1357,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1428,7 +1416,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1450,7 +1437,6 @@ "right": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "StringType" @@ -1704,7 +1690,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1736,7 +1721,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1768,7 +1752,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1800,7 +1783,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1832,7 +1814,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2075,7 +2056,6 @@ "left": { "_": "InstanceFieldRef", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2110,6 +2090,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } From d0c9f3c3ab1578aa2b05b0962c0e9ac8ddd49fca Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Tue, 6 Aug 2024 16:40:13 +0300 Subject: [PATCH 4/9] Use LocalDto --- jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt | 2 +- jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt | 2 +- jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt index 309a667ee..f87e872c4 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt @@ -730,7 +730,7 @@ interface EtsCallExpr : EtsExpr, CommonCallExpr { } data class EtsInstanceCallExpr( - val instance: EtsEntity, + val instance: EtsLocal, override val method: EtsMethodSignature, override val args: List, ) : EtsCallExpr { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index ca469a61d..6333be197 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -370,7 +370,7 @@ class EtsMethodBuilder( } is InstanceCallExprDto -> EtsInstanceCallExpr( - instance = convertToEtsEntity(value.instance), + instance = convertToEtsEntity(value.instance) as EtsLocal, // safe cast method = convertToEtsMethodSignature(value.method), args = value.args.map { ensureOneAddress(convertToEtsEntity(it)) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt index 22adf1be7..f8a8ccc71 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt @@ -319,7 +319,7 @@ sealed interface CallExprDto : ExprDto { @Serializable @SerialName("InstanceCallExpr") data class InstanceCallExprDto( - val instance: ValueDto, // Local + val instance: LocalDto, override val method: MethodSignatureDto, override val args: List, ) : CallExprDto { From 8d602b48cd1c910fb0107baf7b374c0e6e81c714 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Tue, 6 Aug 2024 16:40:35 +0300 Subject: [PATCH 5/9] Update ArkIR --- .../org/jacodb/ets/test/utils/LoadEts.kt | 4 ++ .../etsir/samples/DataFlowSecurity.ts.json | 1 - .../etsir/samples/MethodCollision.ts.json | 9 ---- .../etsir/samples/TypeMismatch.ts.json | 2 - .../etsir/samples/cases/case1.ts.json | 1 - .../etsir/samples/cases/case2.ts.json | 11 ---- .../etsir/samples/cases/case3.ts.json | 2 - .../etsir/samples/catch/TryCatch.ts.json | 2 - .../samples/catch/TryCatchFinally.ts.json | 2 - .../samples/catch/TryCatchMultiple.ts.json | 4 -- .../samples/catch/TryCatchNested.ts.json | 3 -- .../etsir/samples/catch/TryFinally.ts.json | 2 - .../samples/classes/AbstractClass.ts.json | 5 -- .../samples/classes/AccessModifiers.ts.json | 3 -- .../samples/classes/ConstructorClass.ts.json | 4 -- .../samples/classes/GenericClass.ts.json | 7 --- .../samples/classes/InheritanceClass.ts.json | 7 --- .../classes/InterfaceImplementation.ts.json | 4 -- .../etsir/samples/classes/SimpleClass.ts.json | 5 -- .../samples/classes/SingletonClass.ts.json | 5 -- .../etsir/samples/classes/StaticClass.ts.json | 4 -- .../etsir/samples/initializers.ts.json | 4 -- .../samples/loop/BreadthFirstSearch.ts.json | 10 ---- .../samples/loop/DepthFirstSearch.ts.json | 19 ------- .../samples/loop/DijkstrasAlgorithm.ts.json | 3 -- .../etsir/samples/loop/DoWhileLoop.ts.json | 1 - .../etsir/samples/loop/ForInLoop.ts.json | 5 -- .../samples/loop/MatrixMultiplication.ts.json | 5 -- .../etsir/samples/loop/NestedLoops.ts.json | 8 --- .../etsir/samples/loop/WhileLoop.ts.json | 1 - .../resources/etsir/samples/object.ts.json | 10 ---- .../etsir/samples/save/basic.ts.json | 50 ------------------- .../etsir/samples/save/enums.ts.json | 7 --- .../resources/etsir/samples/taint.ts.json | 1 - 34 files changed, 4 insertions(+), 207 deletions(-) diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt index da0991fcd..831233186 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt @@ -16,11 +16,15 @@ package org.jacodb.ets.test.utils +import mu.KotlinLogging import org.jacodb.ets.dto.EtsFileDto import org.jacodb.ets.dto.convertToEtsFile import org.jacodb.ets.model.EtsFile +private val logger = KotlinLogging.logger {} + fun loadEtsFileDtoFromResource(jsonPath: String): EtsFileDto { + logger.debug { "Loading EtsIR from resource: '$jsonPath'" } val stream = object {}::class.java.getResourceAsStream(jsonPath) ?: error("Resource not found: $jsonPath") return EtsFileDto.loadFromJson(stream) diff --git a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json index 6f793165a..9b9026b67 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json @@ -577,7 +577,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json index eec2a12e6..978dadbc2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json @@ -324,7 +324,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -538,7 +537,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -610,7 +608,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -667,7 +664,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "a", "type": { "_": "ClassType", @@ -865,7 +861,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -904,7 +899,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "c", "type": { "_": "ClassType", @@ -939,7 +933,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1321,7 +1314,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1695,7 +1687,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json index 88e994a76..8aac2f9e7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json @@ -324,7 +324,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -489,7 +488,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json index 2c367be89..446ba8dc8 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json @@ -446,7 +446,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json index 5f414f349..6be7670f1 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json @@ -235,7 +235,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -476,7 +475,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -693,7 +691,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1003,7 +1000,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1111,7 +1107,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1143,7 +1138,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1175,7 +1169,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1222,7 +1215,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -1279,7 +1271,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -1398,7 +1389,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1627,7 +1617,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json index 4ad98e72c..db4eaf090 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json @@ -745,7 +745,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1502,7 +1501,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json index 58ee94026..a5dff3578 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json @@ -168,7 +168,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -225,7 +224,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json index 4a5545afa..e8db79607 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json @@ -168,7 +168,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -274,7 +273,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json index 217c2bdea..865b3fe89 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json @@ -212,7 +212,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -310,7 +309,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -367,7 +365,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -399,7 +396,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json index 5833b1e64..57528459c 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json @@ -203,7 +203,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -260,7 +259,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -292,7 +290,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json index 7f1c8f180..f4859ec29 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json @@ -156,7 +156,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -251,7 +250,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json index 26805c1ba..122a34b7b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json @@ -123,7 +123,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -195,7 +194,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "rectangle", "type": { "_": "ClassType", @@ -222,7 +220,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -435,7 +432,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -670,7 +666,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json index 72843a374..9acfc8f11 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json @@ -123,7 +123,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -226,7 +225,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -503,7 +501,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json index e06531ed6..ae14f6f24 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json @@ -123,7 +123,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -188,7 +187,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "constructorObj", "type": { "_": "ClassType", @@ -215,7 +213,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -433,7 +430,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json index 7abd9f00f..4277ddcf2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json @@ -147,7 +147,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -212,7 +211,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "stringObj", "type": { "_": "ClassType", @@ -239,7 +237,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -293,7 +290,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -358,7 +354,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "numberObj", "type": { "_": "ClassType", @@ -385,7 +380,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -611,7 +605,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json index 89441695c..c611e2141 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json @@ -129,7 +129,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -201,7 +200,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "childObj", "type": { "_": "ClassType", @@ -228,7 +226,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -267,7 +264,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "childObj", "type": { "_": "ClassType", @@ -294,7 +290,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -511,7 +506,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -911,7 +905,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json index f60451e8f..b59052e5b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json @@ -123,7 +123,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -188,7 +187,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "circle", "type": { "_": "ClassType", @@ -215,7 +213,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -469,7 +466,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json index 08b536c72..26c5a58de 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json @@ -123,7 +123,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -173,7 +172,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "simpleObj", "type": { "_": "ClassType", @@ -215,7 +213,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "simpleObj", "type": { "_": "ClassType", @@ -242,7 +239,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -686,7 +682,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json index a6a7cd5f9..d41517f4f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json @@ -90,7 +90,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -114,7 +113,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -343,7 +341,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -469,7 +466,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -758,7 +754,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json index b299f7879..668cbe5ea 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json @@ -89,7 +89,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "StaticClass", "type": { "_": "UnknownType" @@ -120,7 +119,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "StaticClass", "type": { "_": "UnknownType" @@ -144,7 +142,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -387,7 +384,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json index 134b9533d..a00b476e5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json @@ -347,7 +347,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -371,7 +370,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -506,7 +504,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -640,7 +637,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json index 1eaa2ab3b..3ccfa4781 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json @@ -127,7 +127,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -215,7 +214,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -766,7 +764,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -801,7 +798,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -893,7 +889,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -968,7 +963,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "neighbours", "type": { "_": "UnknownType" @@ -1019,7 +1013,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp5", "type": { "_": "ClassType", @@ -1177,7 +1170,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -1269,7 +1261,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -2139,7 +2130,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json index c735e9161..b3754dab7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json @@ -127,7 +127,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -208,7 +207,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -892,7 +890,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -985,7 +982,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "result", "type": { "_": "ArrayType", @@ -1177,7 +1173,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -1253,7 +1248,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -1557,7 +1551,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1740,7 +1733,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1944,7 +1936,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -2027,7 +2018,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -2138,7 +2128,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2321,7 +2310,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2504,7 +2492,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2708,7 +2695,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -2791,7 +2777,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -2902,7 +2887,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -3106,7 +3090,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -3189,7 +3172,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -3300,7 +3282,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json index 9954c2aa7..a17b2fcc1 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json @@ -1498,7 +1498,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1994,7 +1993,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ArrayType", @@ -2121,7 +2119,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ArrayType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json index fe2522f5b..78dc0bb37 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json @@ -183,7 +183,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json index f8f90313f..2c5a5a73f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json @@ -179,7 +179,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -239,7 +238,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "person", "type": { "_": "ClassType", @@ -292,7 +290,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -580,7 +577,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -860,7 +856,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json index cc374740a..74bf11642 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json @@ -1204,7 +1204,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1844,7 +1843,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -1878,7 +1876,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "Array", "type": { "_": "UnknownType" @@ -2563,7 +2560,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp3", "type": { "_": "ClassType", @@ -2830,7 +2826,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json index 7f4a90e3b..ec427fe56 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json @@ -601,7 +601,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "colors", "type": { "_": "ArrayType", @@ -655,7 +654,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp3", "type": { "_": "ClassType", @@ -749,7 +747,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -870,7 +867,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "sizes", "type": { "_": "ArrayType", @@ -924,7 +920,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -1096,7 +1091,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp11", "type": { "_": "ClassType", @@ -1123,7 +1117,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "combinations", "type": { "_": "ArrayType", @@ -1302,7 +1295,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json index 1c5be7dc2..e0c11f0c0 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json @@ -230,7 +230,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json index aaee68b7c..03c070e1d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json @@ -256,7 +256,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -328,7 +327,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -378,7 +376,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -413,7 +410,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -471,7 +467,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -565,7 +560,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -802,7 +796,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1080,7 +1073,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1282,7 +1274,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1371,7 +1362,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json index a0e969906..174c2918f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json @@ -186,7 +186,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -310,7 +309,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -582,7 +580,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -776,7 +773,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -1635,7 +1631,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -1908,7 +1903,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2280,7 +2274,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2340,7 +2333,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2527,7 +2519,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2666,7 +2657,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2810,7 +2800,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2926,7 +2915,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -3042,7 +3030,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -3158,7 +3145,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -3352,7 +3338,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -3432,7 +3417,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -3504,7 +3488,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -3609,7 +3592,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "notPerson", "type": { "_": "ClassType", @@ -3636,7 +3618,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "Person", "type": { "_": "UnknownType" @@ -4114,7 +4095,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -4288,7 +4268,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -4444,7 +4423,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -4772,7 +4750,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -5143,7 +5120,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -5391,7 +5367,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -5647,7 +5622,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -6228,7 +6202,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6335,7 +6308,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -6611,7 +6583,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -6860,7 +6831,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -7083,7 +7053,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7184,7 +7153,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7287,7 +7255,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7393,7 +7360,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -7552,7 +7518,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7773,7 +7738,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8158,7 +8122,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8338,7 +8301,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -8449,7 +8411,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8583,7 +8544,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -8694,7 +8654,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9045,7 +9004,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9179,7 +9137,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -9290,7 +9247,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9448,7 +9404,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -9531,7 +9486,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -9642,7 +9596,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9857,7 +9810,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -10205,7 +10157,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -10544,7 +10495,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json index 91e0ca7d7..c9ec77b5b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json @@ -555,7 +555,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -610,7 +609,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "Object", "type": { "_": "UnknownType" @@ -652,7 +650,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp5", "type": { "_": "UnknownType" @@ -702,7 +699,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -806,7 +802,6 @@ "right": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -940,7 +935,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -2137,7 +2131,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json index bd8c5bbe1..9c67f751c 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json @@ -721,7 +721,6 @@ "expr": { "_": "InstanceCallExpr", "instance": { - "_": "Local", "name": "$temp0", "type": { "_": "ClassType", From dcd23b05107eccfdce77fecf7175226b70fa74c5 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Thu, 8 Aug 2024 11:09:56 +0300 Subject: [PATCH 6/9] Update for new ArkAnalyzer Support AwaitExpr and YieldExpr. Add JsonElement inside UnknownValueDto. Add empty CFG. Rename CallableType to FunctionType. --- .github/workflows/build-and-test.yml | 2 +- .../kotlin/org/jacodb/ets/base/EtsExpr.kt | 36 ++- .../kotlin/org/jacodb/ets/base/EtsType.kt | 6 +- .../main/kotlin/org/jacodb/ets/dto/Convert.kt | 58 ++-- .../main/kotlin/org/jacodb/ets/dto/Types.kt | 4 +- .../main/kotlin/org/jacodb/ets/dto/Values.kt | 41 ++- .../kotlin/org/jacodb/ets/graph/EtsCfg.kt | 6 + .../kotlin/org/jacodb/ets/model/EtsMethod.kt | 5 +- .../org/jacodb/ets/utils/GetOperands.kt | 8 + .../kotlin/org/jacodb/ets/test/EtsFileTest.kt | 2 +- .../jacodb/ets/test/EtsTaintAnalysisTest.kt | 8 +- ...ity.ts.abc.json => TaintAnalysis.abc.json} | 4 +- .../etsir/samples/DataFlowSecurity.ts.json | 23 +- .../etsir/samples/MethodCollision.ts.json | 35 +- .../etsir/samples/TypeMismatch.ts.json | 13 +- .../etsir/samples/cases/case1.ts.json | 16 +- .../etsir/samples/cases/case2.ts.json | 28 +- .../etsir/samples/cases/case3.ts.json | 37 ++- .../etsir/samples/catch/TryCatch.ts.json | 6 +- .../samples/catch/TryCatchFinally.ts.json | 14 +- .../samples/catch/TryCatchMultiple.ts.json | 12 +- .../samples/catch/TryCatchNested.ts.json | 7 +- .../etsir/samples/catch/TryFinally.ts.json | 14 +- .../samples/classes/AbstractClass.ts.json | 9 + .../samples/classes/AccessModifiers.ts.json | 7 + .../samples/classes/ConstructorClass.ts.json | 6 + .../samples/classes/GenericClass.ts.json | 9 + .../samples/classes/InheritanceClass.ts.json | 11 + .../classes/InterfaceImplementation.ts.json | 7 + .../etsir/samples/classes/SimpleClass.ts.json | 7 + .../samples/classes/SingletonClass.ts.json | 19 +- .../etsir/samples/classes/StaticClass.ts.json | 7 + .../etsir/samples/initializers.ts.json | 8 + .../samples/loop/BreadthFirstSearch.ts.json | 62 ++-- .../samples/loop/DepthFirstSearch.ts.json | 89 +++--- .../samples/loop/DijkstrasAlgorithm.ts.json | 90 +++--- .../etsir/samples/loop/DoWhileLoop.ts.json | 12 +- .../etsir/samples/loop/ForInLoop.ts.json | 24 +- .../samples/loop/MatrixMultiplication.ts.json | 65 ++-- .../etsir/samples/loop/NestedLoops.ts.json | 38 ++- .../etsir/samples/loop/WhileLoop.ts.json | 16 +- .../resources/etsir/samples/object.ts.json | 17 + .../etsir/samples/save/basic.ts.json | 302 ++++++++++-------- .../etsir/samples/save/enums.ts.json | 51 +-- .../resources/etsir/samples/taint.ts.json | 23 +- .../resources/samples/DataFlowSecurity.ts | 29 -- .../samples/{taint.ts => TaintAnalysis.ts} | 0 .../FieldInitializers.ts} | 0 .../samples/classes/NestedInitializer.ts | 7 + .../src/test/resources/samples/lang/in.ts | 8 + .../test/resources/samples/lang/instanceof.ts | 5 + .../resources/samples/{ => lang}/object.ts | 0 52 files changed, 745 insertions(+), 568 deletions(-) rename jacodb-ets/src/test/resources/decompiled/{DataFlowSecurity.ts.abc.json => TaintAnalysis.abc.json} (99%) delete mode 100644 jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts rename jacodb-ets/src/test/resources/samples/{taint.ts => TaintAnalysis.ts} (100%) rename jacodb-ets/src/test/resources/samples/{initializers.ts => classes/FieldInitializers.ts} (100%) create mode 100644 jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts create mode 100644 jacodb-ets/src/test/resources/samples/lang/in.ts create mode 100644 jacodb-ets/src/test/resources/samples/lang/instanceof.ts rename jacodb-ets/src/test/resources/samples/{ => lang}/object.ts (100%) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 47f1cb48d..0059e3cb5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -64,7 +64,7 @@ jobs: DEST_DIR="arkanalyzer" MAX_RETRIES=10 RETRY_DELAY=3 # Delay between retries in seconds - BRANCH="neo/2024-08-06" + BRANCH="neo/2024-08-07" for ((i=1; i<=MAX_RETRIES; i++)); do git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt index f87e872c4..c17cb586f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt @@ -29,6 +29,8 @@ interface EtsExpr : EtsEntity { // Unary fun visit(expr: EtsDeleteExpr): R + fun visit(expr: EtsAwaitExpr): R + fun visit(expr: EtsYieldExpr): R fun visit(expr: EtsTypeOfExpr): R fun visit(expr: EtsVoidExpr): R fun visit(expr: EtsNotExpr): R @@ -88,6 +90,8 @@ interface EtsExpr : EtsEntity { override fun visit(expr: EtsInstanceOfExpr): R = defaultVisit(expr) override fun visit(expr: EtsDeleteExpr): R = defaultVisit(expr) + override fun visit(expr: EtsAwaitExpr): R = defaultVisit(expr) + override fun visit(expr: EtsYieldExpr): R = defaultVisit(expr) override fun visit(expr: EtsTypeOfExpr): R = defaultVisit(expr) override fun visit(expr: EtsVoidExpr): R = defaultVisit(expr) override fun visit(expr: EtsNotExpr): R = defaultVisit(expr) @@ -202,7 +206,7 @@ data class EtsCastExpr( data class EtsInstanceOfExpr( val arg: EtsEntity, - val checkType: String, // TODO: what should it be? + val checkType: EtsType, ) : EtsExpr { override val type: EtsType get() = EtsBooleanType @@ -235,6 +239,36 @@ data class EtsDeleteExpr( } } +data class EtsAwaitExpr( + override val arg: EtsEntity, +) : EtsUnaryExpr { + override val type: EtsType + get() = arg.type + + override fun toString(): String { + return "await $arg" + } + + override fun accept(visitor: EtsExpr.Visitor): R { + return visitor.visit(this) + } +} + +data class EtsYieldExpr( + override val arg: EtsEntity, +) : EtsUnaryExpr { + override val type: EtsType + get() = arg.type + + override fun toString(): String { + return "yield $arg" + } + + override fun accept(visitor: EtsExpr.Visitor): R { + return visitor.visit(this) + } +} + data class EtsTypeOfExpr( override val arg: EtsEntity, ) : EtsUnaryExpr { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt index 4bd1696ca..b5e567c47 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt @@ -41,7 +41,7 @@ interface EtsType : CommonType, CommonTypeName { fun visit(type: EtsNeverType): R fun visit(type: EtsLiteralType): R fun visit(type: EtsClassType): R - fun visit(type: EtsCallableType): R + fun visit(type: EtsFunctionType): R fun visit(type: EtsArrayType): R fun visit(type: EtsArrayObjectType): R fun visit(type: EtsUnclearRefType): R @@ -60,7 +60,7 @@ interface EtsType : CommonType, CommonTypeName { override fun visit(type: EtsNeverType): R = defaultVisit(type) override fun visit(type: EtsLiteralType): R = defaultVisit(type) override fun visit(type: EtsClassType): R = defaultVisit(type) - override fun visit(type: EtsCallableType): R = defaultVisit(type) + override fun visit(type: EtsFunctionType): R = defaultVisit(type) override fun visit(type: EtsArrayType): R = defaultVisit(type) override fun visit(type: EtsArrayObjectType): R = defaultVisit(type) override fun visit(type: EtsUnclearRefType): R = defaultVisit(type) @@ -227,7 +227,7 @@ data class EtsClassType( } } -data class EtsCallableType( +data class EtsFunctionType( val method: EtsMethodSignature, ) : EtsRefType { override val typeName: String diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index 861ba6d13..9e501323d 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -23,6 +23,7 @@ import org.jacodb.ets.base.EtsArrayAccess import org.jacodb.ets.base.EtsArrayLiteral import org.jacodb.ets.base.EtsArrayType import org.jacodb.ets.base.EtsAssignStmt +import org.jacodb.ets.base.EtsAwaitExpr import org.jacodb.ets.base.EtsBitAndExpr import org.jacodb.ets.base.EtsBitNotExpr import org.jacodb.ets.base.EtsBitOrExpr @@ -31,7 +32,7 @@ import org.jacodb.ets.base.EtsBooleanConstant import org.jacodb.ets.base.EtsBooleanType import org.jacodb.ets.base.EtsCallExpr import org.jacodb.ets.base.EtsCallStmt -import org.jacodb.ets.base.EtsCallableType +import org.jacodb.ets.base.EtsFunctionType import org.jacodb.ets.base.EtsCastExpr import org.jacodb.ets.base.EtsClassType import org.jacodb.ets.base.EtsCommaExpr @@ -102,6 +103,7 @@ import org.jacodb.ets.base.EtsUnknownType import org.jacodb.ets.base.EtsUnsignedRightShiftExpr import org.jacodb.ets.base.EtsValue import org.jacodb.ets.base.EtsVoidType +import org.jacodb.ets.base.EtsYieldExpr import org.jacodb.ets.base.Ops import org.jacodb.ets.graph.EtsCfg import org.jacodb.ets.model.EtsClass @@ -143,15 +145,12 @@ class EtsMethodBuilder( fun build(cfgDto: CfgDto): EtsMethod { require(!built) { "Method has already been built" } val cfg = convertToEtsCfg(cfgDto) - etsMethod.cfg = cfg + etsMethod._cfg = cfg built = true return etsMethod } private fun ensureOneAddress(entity: EtsEntity): EtsValue { - // TODO: think about whether 'CastExpr' should be considered "one-address". This would require changing the return type of this function to `EtsEntity`. - // if (entity is EtsCastExpr) return entity - if (entity is EtsExpr || entity is EtsFieldRef || entity is EtsArrayAccess) { val newLocal = newTempLocal(entity.type) currentStmts += EtsAssignStmt( @@ -161,7 +160,9 @@ class EtsMethodBuilder( ) return newLocal } else { - check(entity is EtsValue) + check(entity is EtsValue) { + "Expected EtsValue, but got $entity" + } return entity } } @@ -185,8 +186,14 @@ class EtsMethodBuilder( } is AssignStmtDto -> { - val lhv = convertToEtsEntity(stmt.left) as EtsValue - val rhv = ensureOneAddress(convertToEtsEntity(stmt.right)) + val lhv = convertToEtsEntity(stmt.left) as EtsValue // safe cast + val rhv = convertToEtsEntity(stmt.right).let { + if (it is EtsCastExpr || it is EtsNewExpr) { + it + } else { + ensureOneAddress(it) + } + } EtsAssignStmt( location = loc(), lhv = lhv, @@ -256,11 +263,7 @@ class EtsMethodBuilder( is UnknownValueDto -> object : EtsEntity { override val type: EtsType = EtsUnknownType - // TODO: change to this `toString()` implementation when `value.value` field is restored. - // override fun toString(): String = "Unknown(${value.value})" - // Note: `value` field was removed from `UnknownValueDto` due to circular references in ArkIR, - // which forbid their serialization. - override fun toString(): String = "Unknown" + override fun toString(): String = "Unknown(${value.value})" override fun accept(visitor: EtsEntity.Visitor): R { if (visitor is EtsEntity.Visitor.Default) { @@ -278,7 +281,7 @@ class EtsMethodBuilder( is ConstantDto -> convertToEtsConstant(value) is NewExprDto -> EtsNewExpr( - type = convertToEtsType(value.classType as ClassTypeDto) // safe cast + type = convertToEtsType(value.classType) // TODO: safe cast to ClassType ) is NewArrayExprDto -> EtsNewArrayExpr( @@ -290,13 +293,21 @@ class EtsMethodBuilder( arg = convertToEtsEntity(value.arg) ) + is AwaitExprDto -> EtsAwaitExpr( + arg = convertToEtsEntity(value.arg) + ) + + is YieldExprDto -> EtsYieldExpr( + arg = convertToEtsEntity(value.arg) + ) + is TypeOfExprDto -> EtsTypeOfExpr( arg = convertToEtsEntity(value.arg) ) is InstanceOfExprDto -> EtsInstanceOfExpr( arg = convertToEtsEntity(value.arg), - checkType = value.checkType, + checkType = convertToEtsType(value.checkType), ) is LengthExprDto -> EtsLengthExpr( @@ -361,12 +372,12 @@ class EtsMethodBuilder( // introduce a corresponding DTO for it. // Currently, `x instanceof T` is represented as `BinopExpr(Local("x"), Local("T"))`, // so we just *unsafely* extract the type name from the "pseudo-local" here: - "instanceof" -> EtsInstanceOfExpr(left, (right as EtsLocal).name) + // "instanceof" -> EtsInstanceOfExpr(left, (right as EtsLocal).name) // TODO: Currently, ArkIR treats "in" operation just as BinopExpr. // Ideally, it would be represented as a separate `ArkInExpr`, // or at least as `ArkConditionExpr`, since it inherently has a boolean type. - Ops.IN -> EtsInExpr(left, right) // Note: `type` is ignored here! + // Ops.IN -> EtsInExpr(left, right) // Note: `type` is ignored here! else -> error("Unknown binop: ${value.op}") } @@ -385,16 +396,13 @@ class EtsMethodBuilder( Ops.LT_EQ -> EtsLtEqExpr(left, right) Ops.GT -> EtsGtExpr(left, right) Ops.GT_EQ -> EtsGtEqExpr(left, right) - - // TODO: see above - // Ops.IN -> EtsInExpr(left, right) - + Ops.IN -> EtsInExpr(left, right) else -> error("Unknown relop: ${value.op}") } } is InstanceCallExprDto -> EtsInstanceCallExpr( - instance = convertToEtsEntity(value.instance) as EtsLocal, // safe cast + instance = convertToEtsEntity(value.instance as LocalDto) as EtsLocal, // safe cast method = convertToEtsMethodSignature(value.method), args = value.args.map { ensureOneAddress(convertToEtsEntity(it)) @@ -409,7 +417,7 @@ class EtsMethodBuilder( ) is ThisRefDto -> EtsThis( - type = convertToEtsType(value.type) as EtsClassType // safe cast + type = convertToEtsType(value.type as ClassTypeDto) as EtsClassType // safe cast ) is ParameterRefDto -> EtsParameterRef( @@ -433,7 +441,7 @@ class EtsMethodBuilder( val field = convertToEtsFieldSignature(fieldRef.field) return when (fieldRef) { is InstanceFieldRefDto -> EtsInstanceFieldRef( - instance = convertToEtsEntity(fieldRef.instance) as EtsLocal, // safe cast + instance = convertToEtsEntity(fieldRef.instance as LocalDto) as EtsLocal, // safe cast field = field, ) @@ -574,7 +582,7 @@ fun convertToEtsType(type: TypeDto): EtsType { dimensions = type.dimensions, ) - is CallableTypeDto -> EtsCallableType( + is FunctionTypeDto -> EtsFunctionType( method = convertToEtsMethodSignature(type.signature) ) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt index 871e280d7..16ff8041d 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt @@ -162,8 +162,8 @@ data class ClassTypeDto( } @Serializable -@SerialName("CallableType") -data class CallableTypeDto( +@SerialName("FunctionType") +data class FunctionTypeDto( val signature: MethodSignatureDto, ) : TypeDto { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt index f8a8ccc71..4d501d1bb 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt @@ -20,6 +20,7 @@ import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonClassDiscriminator +import kotlinx.serialization.json.JsonElement @Serializable @OptIn(ExperimentalSerializationApi::class) @@ -30,12 +31,14 @@ sealed interface ValueDto { @Serializable @SerialName("UNKNOWN_VALUE") -object UnknownValueDto : ValueDto { +data class UnknownValueDto( + val value: JsonElement, +) : ValueDto { override val type: TypeDto get() = UnknownTypeDto override fun toString(): String { - return "UNKNOWN" + return "UNKNOWN($value)" } } @@ -135,7 +138,7 @@ sealed interface ExprDto : ValueDto @Serializable @SerialName("NewExpr") data class NewExprDto( - val classType: TypeDto, // ClassTypeDto + val classType: TypeDto, // ClassType ) : ExprDto { override val type: TypeDto get() = classType as ClassTypeDto // safe cast @@ -172,6 +175,32 @@ data class DeleteExprDto( } } +@Serializable +@SerialName("AwaitExpr") +data class AwaitExprDto( + val arg: ValueDto, +) : ExprDto { + override val type: TypeDto + get() = arg.type + + override fun toString(): String { + return "await $arg" + } +} + +@Serializable +@SerialName("YieldExpr") +data class YieldExprDto( + val arg: ValueDto, +) : ExprDto { + override val type: TypeDto + get() = arg.type + + override fun toString(): String { + return "yield $arg" + } +} + @Serializable @SerialName("TypeOfExpr") data class TypeOfExprDto( @@ -189,7 +218,7 @@ data class TypeOfExprDto( @SerialName("InstanceOfExpr") data class InstanceOfExprDto( val arg: ValueDto, - val checkType: String, + val checkType: TypeDto, ) : ExprDto { override val type: TypeDto get() = BooleanTypeDto @@ -319,7 +348,7 @@ sealed interface CallExprDto : ExprDto { @Serializable @SerialName("InstanceCallExpr") data class InstanceCallExprDto( - val instance: LocalDto, + val instance: ValueDto, // Local override val method: MethodSignatureDto, override val args: List, ) : CallExprDto { @@ -386,7 +415,7 @@ sealed interface FieldRefDto : RefDto { @Serializable @SerialName("InstanceFieldRef") data class InstanceFieldRefDto( - val instance: LocalDto, + val instance: ValueDto, // Local override val field: FieldSignatureDto, ) : FieldRefDto { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt index abf14b2f9..7803e107f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt @@ -59,6 +59,12 @@ class EtsCfg( override fun predecessors(node: EtsStmt): Set { return predecessorMap[node]!! } + + companion object { + fun empty(): EtsCfg { + return EtsCfg(emptyList(), emptyMap()) + } + } } fun EtsCfg.findDominators(): GraphDominators { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt index c05eba31c..44880a64f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt @@ -64,7 +64,10 @@ class EtsMethodImpl( override val localsCount: Int = signature.parameters.size + 1, override val modifiers: List = emptyList(), ) : EtsMethod { - override lateinit var cfg: EtsCfg + internal var _cfg: EtsCfg? = null + + override val cfg: EtsCfg + get() = _cfg ?: EtsCfg.empty() override fun toString(): String { return signature.toString() diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt index d29520c4c..73a54ae30 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt @@ -21,6 +21,7 @@ import org.jacodb.ets.base.EtsAndExpr import org.jacodb.ets.base.EtsArrayAccess import org.jacodb.ets.base.EtsArrayLiteral import org.jacodb.ets.base.EtsAssignStmt +import org.jacodb.ets.base.EtsAwaitExpr import org.jacodb.ets.base.EtsBitAndExpr import org.jacodb.ets.base.EtsBitNotExpr import org.jacodb.ets.base.EtsBitOrExpr @@ -83,6 +84,7 @@ import org.jacodb.ets.base.EtsUnaryPlusExpr import org.jacodb.ets.base.EtsUndefinedConstant import org.jacodb.ets.base.EtsUnsignedRightShiftExpr import org.jacodb.ets.base.EtsVoidExpr +import org.jacodb.ets.base.EtsYieldExpr fun EtsStmt.getOperands(): Sequence { return accept(StmtGetOperands) @@ -179,6 +181,12 @@ private object EntityGetOperands : EtsEntity.Visitor> { override fun visit(expr: EtsDeleteExpr): Sequence = sequenceOf(expr.arg) + override fun visit(expr: EtsAwaitExpr): Sequence = + sequenceOf(expr.arg) + + override fun visit(expr: EtsYieldExpr): Sequence = + sequenceOf(expr.arg) + override fun visit(expr: EtsTypeOfExpr): Sequence = sequenceOf(expr.arg) diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt index 7b48910db..f6c69df71 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt @@ -60,7 +60,7 @@ class EtsFileTest { cls.methods.forEach { method -> when (method.name) { "add" -> { - assertEquals(11, method.cfg.instructions.size) + assertEquals(10, method.cfg.instructions.size) } "main" -> { diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt index c9bb2ed03..2e8cafaf6 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt @@ -39,6 +39,7 @@ import org.jacodb.taint.configuration.TaintMethodSink import org.jacodb.taint.configuration.TaintMethodSource import org.jacodb.taint.configuration.TaintPassThrough import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import kotlin.time.Duration.Companion.seconds @@ -56,7 +57,7 @@ class EtsTaintAnalysisTest { } private fun loadDecompiled(name: String): EtsFile { - return loadEtsFileFromResource("$DECOMPILED_PATH/$name.ts.abc.json") + return loadEtsFileFromResource("$DECOMPILED_PATH/$name.abc.json") } val getConfigForMethod: ForwardTaintFlowFunctions.(EtsMethod) -> List? = @@ -124,13 +125,14 @@ class EtsTaintAnalysisTest { @Test fun `test taint analysis`() { - val etsFile = loadFromProject("taint") + val etsFile = loadFromProject("TaintAnalysis") runTaintAnalysis(etsFile) } + @Disabled("Need to update the EtsIR-ABC json file") @Test fun `test taint analysis on decompiled file`() { - val etsFile = loadDecompiled("DataFlowSecurity") + val etsFile = loadDecompiled("TaintAnalysis") runTaintAnalysis(etsFile) } } diff --git a/jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json b/jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json similarity index 99% rename from jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json rename to jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json index 2ef5e709f..f7a05bc22 100644 --- a/jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json +++ b/jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json @@ -1,5 +1,5 @@ { - "name": "samples/DataFlowSecurity.ts", + "name": "samples/TaintAnalysis", "namespaces": [], "classes": [ { @@ -1050,4 +1050,4 @@ "modifiers": [] } ] -} \ No newline at end of file +} diff --git a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json index 9b9026b67..757ef56ec 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json @@ -338,7 +338,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -363,10 +363,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -385,9 +382,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -506,7 +501,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -531,10 +526,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -546,9 +538,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -577,6 +567,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json index 978dadbc2..e8b4d8ba7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json @@ -212,7 +212,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "TypeOfExpr", "arg": { @@ -243,10 +243,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -293,9 +290,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -324,6 +319,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -537,6 +533,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -608,6 +605,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -664,6 +662,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "a", "type": { "_": "ClassType", @@ -697,7 +696,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp2", @@ -791,6 +790,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "a", "type": { "_": "ClassType", @@ -861,6 +861,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -899,6 +900,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "c", "type": { "_": "ClassType", @@ -933,6 +935,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1205,6 +1208,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1234,7 +1238,7 @@ } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "===", "left": { "_": "Local", @@ -1249,6 +1253,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -1314,6 +1321,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1578,6 +1586,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1607,7 +1616,7 @@ } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "===", "left": { "_": "Local", @@ -1622,6 +1631,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -1687,6 +1699,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json index 8aac2f9e7..1ee5f8b65 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json @@ -212,7 +212,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "TypeOfExpr", "arg": { @@ -243,10 +243,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -293,9 +290,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -324,6 +319,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -488,6 +484,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json index 446ba8dc8..8e5c48761 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json @@ -382,16 +382,13 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -416,9 +413,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -437,15 +432,14 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json index 6be7670f1..0e651c4a5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json @@ -235,6 +235,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -475,6 +476,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -691,6 +693,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1000,6 +1003,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1023,7 +1027,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp0", @@ -1050,10 +1054,7 @@ "successors": [ 2 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -1070,9 +1071,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -1091,9 +1090,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1107,6 +1104,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1138,6 +1136,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1169,6 +1168,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "data", "type": { "_": "UnclearReferenceType", @@ -1215,6 +1215,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -1271,6 +1272,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -1389,6 +1391,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1505,6 +1508,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1536,6 +1540,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1617,6 +1622,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json index db4eaf090..6f0ac287d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json @@ -124,7 +124,7 @@ { "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -181,7 +181,7 @@ { "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -253,7 +253,7 @@ "_": "Local", "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -279,7 +279,7 @@ "_": "ParameterRef", "index": 2, "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -483,6 +483,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -676,7 +677,7 @@ { "name": "AnonymousMethod-publishEventWithData-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "CommonSecurity" @@ -745,6 +746,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -799,7 +801,7 @@ "_": "Local", "name": "AnonymousMethod-publishEventWithData-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "CommonSecurity" @@ -1004,6 +1006,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1024,7 +1027,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp0", @@ -1051,15 +1054,14 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1091,10 +1093,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1, - 3 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -1106,9 +1105,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1122,6 +1119,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1206,6 +1204,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1290,6 +1289,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1374,6 +1374,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "err", "type": { "_": "UnknownType" @@ -1423,6 +1424,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1501,6 +1503,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json index a5dff3578..d37d8057b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json @@ -168,6 +168,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -215,15 +216,14 @@ { "id": 1, "successors": [], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json index e8db79607..4bc336957 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json @@ -168,6 +168,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -217,9 +218,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [] }, { @@ -227,9 +226,7 @@ "successors": [ 3 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -264,15 +261,14 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json index 865b3fe89..74d6d199d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json @@ -212,6 +212,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -261,9 +262,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -309,6 +308,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -356,15 +356,14 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -396,6 +395,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json index 57528459c..3b64bfb99 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json @@ -203,6 +203,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -250,15 +251,14 @@ { "id": 1, "successors": [], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -290,6 +290,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json index f4859ec29..1573fe4fe 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json @@ -156,6 +156,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -205,9 +206,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [] }, { @@ -215,9 +214,7 @@ "successors": [ 3 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -241,15 +238,14 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json index 122a34b7b..18334a4ac 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json @@ -123,6 +123,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -194,6 +195,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "rectangle", "type": { "_": "ClassType", @@ -220,6 +222,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -432,6 +435,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -666,6 +670,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -762,6 +767,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -793,6 +799,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -912,6 +919,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -943,6 +951,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json index 9acfc8f11..cd3631785 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json @@ -123,6 +123,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -201,6 +202,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "user", "type": { "_": "ClassType", @@ -225,6 +227,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -501,6 +504,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -597,6 +601,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -628,6 +633,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -659,6 +665,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json index ae14f6f24..6a086583d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json @@ -123,6 +123,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -187,6 +188,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "constructorObj", "type": { "_": "ClassType", @@ -213,6 +215,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -430,6 +433,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -492,6 +496,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -599,6 +604,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json index 4277ddcf2..dba309813 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json @@ -147,6 +147,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -211,6 +212,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "stringObj", "type": { "_": "ClassType", @@ -237,6 +239,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -290,6 +293,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -354,6 +358,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "numberObj", "type": { "_": "ClassType", @@ -380,6 +385,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -605,6 +611,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -669,6 +676,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -778,6 +786,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json index c611e2141..f97f61133 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json @@ -129,6 +129,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -200,6 +201,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "childObj", "type": { "_": "ClassType", @@ -226,6 +228,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -264,6 +267,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "childObj", "type": { "_": "ClassType", @@ -290,6 +294,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -506,6 +511,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -568,6 +574,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -675,6 +682,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -905,6 +913,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1009,6 +1018,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1116,6 +1126,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json index b59052e5b..3cd0fc1d2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json @@ -123,6 +123,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -187,6 +188,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "circle", "type": { "_": "ClassType", @@ -213,6 +215,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -466,6 +469,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -528,6 +532,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -659,6 +664,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "Math", "type": { "_": "UnknownType" @@ -687,6 +693,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json index 26c5a58de..8d07d55ec 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json @@ -123,6 +123,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -172,6 +173,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "simpleObj", "type": { "_": "ClassType", @@ -213,6 +215,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "simpleObj", "type": { "_": "ClassType", @@ -239,6 +242,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -494,6 +498,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -601,6 +606,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -682,6 +688,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json index d41517f4f..7c3df21bd 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json @@ -90,6 +90,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -113,6 +114,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -341,6 +343,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -466,6 +469,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -607,6 +611,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -648,7 +653,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp1", @@ -673,10 +678,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -690,6 +692,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "Logger", "type": { "_": "UnknownType" @@ -723,9 +726,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -754,6 +755,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -780,6 +782,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "Logger", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json index 668cbe5ea..913786f0f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json @@ -89,6 +89,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "StaticClass", "type": { "_": "UnknownType" @@ -119,6 +120,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "StaticClass", "type": { "_": "UnknownType" @@ -142,6 +144,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -303,6 +306,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -384,6 +388,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -485,6 +490,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -615,6 +621,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json index a00b476e5..15e105a20 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json @@ -166,6 +166,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -247,6 +248,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -347,6 +349,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -370,6 +373,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -476,6 +480,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "Foo", "type": { "_": "UnknownType" @@ -504,6 +509,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -606,6 +612,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -637,6 +644,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json index 3ccfa4781..524121725 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json @@ -127,6 +127,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -214,6 +215,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -644,9 +646,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [] }, { @@ -655,11 +655,7 @@ 3, 4 ], - "predecessors": [ - 1, - 4, - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -673,6 +669,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -697,7 +694,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "<=", + "op": ">", "left": { "_": "Local", "name": "$temp2", @@ -722,9 +719,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -748,9 +743,7 @@ 2, 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -764,6 +757,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -798,6 +792,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -853,7 +848,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp4", @@ -880,15 +875,14 @@ "successors": [ 6 ], - "predecessors": [ - 4 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -931,6 +925,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "UnclearReferenceType", @@ -963,6 +958,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "neighbours", "type": { "_": "UnknownType" @@ -992,11 +988,7 @@ 2, 7 ], - "predecessors": [ - 5, - 7, - 8 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1013,6 +1005,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp5", "type": { "_": "ClassType", @@ -1049,6 +1042,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -1100,9 +1094,7 @@ 6, 8 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1116,6 +1108,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -1170,6 +1163,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "visited", "type": { "_": "ArrayType", @@ -1225,7 +1219,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp10", @@ -1252,15 +1246,14 @@ "successors": [ 6 ], - "predecessors": [ - 7 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "queue", "type": { "_": "ArrayType", @@ -1633,6 +1626,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1729,6 +1723,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1825,6 +1820,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1921,6 +1917,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1983,6 +1980,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2045,6 +2043,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2130,6 +2129,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json index b3754dab7..d0f9de350 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json @@ -127,6 +127,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -207,6 +208,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -537,7 +539,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp0", @@ -573,10 +575,7 @@ "successors": [ 2 ], - "predecessors": [ - 0, - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -779,12 +778,7 @@ 3, 4 ], - "predecessors": [ - 1, - 4, - 6, - 7 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -798,6 +792,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -823,7 +818,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp4", @@ -848,9 +843,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -874,9 +867,7 @@ 2, 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -890,6 +881,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -917,7 +909,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "node", @@ -945,9 +937,7 @@ 6, 8 ], - "predecessors": [ - 4 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -961,6 +951,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -982,6 +973,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "result", "type": { "_": "ArrayType", @@ -1024,6 +1016,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1044,7 +1037,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp6", @@ -1072,10 +1065,7 @@ 2, 7 ], - "predecessors": [ - 5, - 8 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1089,6 +1079,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1109,7 +1100,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp8", @@ -1136,9 +1127,7 @@ "successors": [ 2 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1152,6 +1141,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1173,6 +1163,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -1211,9 +1202,7 @@ "successors": [ 6 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1227,6 +1216,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "node", "type": { "_": "UnknownType" @@ -1248,6 +1238,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "stack", "type": { "_": "ArrayType", @@ -1286,9 +1277,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1470,6 +1459,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1551,6 +1541,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1652,6 +1643,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1733,6 +1725,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -1883,6 +1876,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1936,6 +1930,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -1962,6 +1957,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2018,6 +2014,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -2044,6 +2041,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2128,6 +2126,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2229,6 +2228,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2310,6 +2310,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2411,6 +2412,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2492,6 +2494,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -2642,6 +2645,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2695,6 +2699,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -2721,6 +2726,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2777,6 +2783,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -2803,6 +2810,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2887,6 +2895,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -3037,6 +3046,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -3090,6 +3100,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -3116,6 +3127,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -3172,6 +3184,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -3198,6 +3211,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -3282,6 +3296,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json index a17b2fcc1..3c62c8ca9 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json @@ -1498,6 +1498,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1952,6 +1953,7 @@ "size": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -1993,6 +1995,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ArrayType", @@ -2078,6 +2081,7 @@ "size": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2119,6 +2123,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ArrayType", @@ -2156,9 +2161,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2185,10 +2188,7 @@ 3, 4 ], - "predecessors": [ - 1, - 7 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2202,6 +2202,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2258,7 +2259,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -2283,9 +2284,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -2308,9 +2307,7 @@ "successors": [ 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2375,10 +2372,7 @@ 6, 11 ], - "predecessors": [ - 4, - 12 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2392,6 +2386,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2420,7 +2415,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "v", @@ -2447,9 +2442,7 @@ "successors": [ 7 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2510,10 +2503,7 @@ 2, 8 ], - "predecessors": [ - 6, - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2527,6 +2517,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "graph", "type": { "_": "ArrayType", @@ -2555,7 +2546,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "v", @@ -2583,9 +2574,7 @@ 9, 10 ], - "predecessors": [ - 7 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2732,7 +2721,7 @@ } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "!==", "left": { "_": "Local", @@ -2747,6 +2736,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -2964,7 +2956,7 @@ } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "<", "left": { "_": "Local", @@ -2979,6 +2971,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -3014,7 +3009,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp23", @@ -3041,10 +3036,7 @@ "successors": [ 7 ], - "predecessors": [ - 8, - 10 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3109,9 +3101,7 @@ "successors": [ 9 ], - "predecessors": [ - 8 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3297,9 +3287,7 @@ 12, 13 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3400,7 +3388,7 @@ } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "<=", "left": { "_": "Local", @@ -3415,6 +3403,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -3450,7 +3441,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp9", @@ -3477,10 +3468,7 @@ "successors": [ 5 ], - "predecessors": [ - 11, - 13 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3517,9 +3505,7 @@ "successors": [ 12 ], - "predecessors": [ - 11 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json index 78dc0bb37..01a4f8c27 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json @@ -117,10 +117,7 @@ 1, 2 ], - "predecessors": [ - 0, - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -183,6 +180,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -241,7 +239,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "count", @@ -266,9 +264,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json index 2c5a5a73f..e33ef2eb0 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json @@ -179,6 +179,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -238,6 +239,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "person", "type": { "_": "ClassType", @@ -270,10 +272,7 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -290,6 +289,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -326,6 +326,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -374,9 +375,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -388,9 +387,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -404,6 +401,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -524,6 +522,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "person", "type": { "_": "ClassType", @@ -577,6 +576,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -713,6 +713,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -744,6 +745,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -775,6 +777,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -856,6 +859,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json index 74bf11642..e35bd8de6 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json @@ -1204,6 +1204,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1399,7 +1400,7 @@ { "name": "AnonymousMethod-multiplyMatrices-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -1600,6 +1601,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "A", "type": { "_": "ArrayType", @@ -1682,6 +1684,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ArrayType", @@ -1714,6 +1717,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "B", "type": { "_": "ArrayType", @@ -1796,6 +1800,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ArrayType", @@ -1843,6 +1848,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -1876,6 +1882,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "Array", "type": { "_": "UnknownType" @@ -1906,7 +1913,7 @@ "_": "Local", "name": "AnonymousMethod-multiplyMatrices-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -1926,7 +1933,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "===", + "op": "!==", "left": { "_": "Local", "name": "colsA", @@ -1953,10 +1960,7 @@ "successors": [ 2 ], - "predecessors": [ - 0, - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1983,16 +1987,13 @@ 3, 4 ], - "predecessors": [ - 1, - 5 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -2017,9 +2018,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -2038,9 +2037,7 @@ "successors": [ 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2067,16 +2064,13 @@ 2, 6 ], - "predecessors": [ - 4, - 7 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "j", @@ -2103,9 +2097,7 @@ "successors": [ 7 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2132,16 +2124,13 @@ 5, 8 ], - "predecessors": [ - 6, - 8 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -2168,9 +2157,7 @@ "successors": [ 7 ], - "predecessors": [ - 7 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2184,6 +2171,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "result", "type": { "_": "UnknownType" @@ -2393,6 +2381,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp4", "type": { "_": "UnknownType" @@ -2414,6 +2403,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp4", "type": { "_": "UnknownType" @@ -2529,9 +2519,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2560,6 +2548,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp3", "type": { "_": "ClassType", @@ -2745,6 +2734,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2826,6 +2816,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json index ec427fe56..415e87ebb 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json @@ -582,9 +582,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -601,6 +599,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "colors", "type": { "_": "ArrayType", @@ -634,10 +633,7 @@ 3, 4 ], - "predecessors": [ - 1, - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -654,6 +650,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp3", "type": { "_": "ClassType", @@ -690,6 +687,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -738,15 +736,14 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -794,9 +791,7 @@ "successors": [ 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -810,6 +805,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -867,6 +863,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "sizes", "type": { "_": "ArrayType", @@ -900,10 +897,7 @@ 2, 6 ], - "predecessors": [ - 4, - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -920,6 +914,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -956,6 +951,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp8", "type": { "_": "ClassType", @@ -1006,9 +1002,7 @@ "successors": [ 5 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1022,6 +1016,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp8", "type": { "_": "ClassType", @@ -1091,6 +1086,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp11", "type": { "_": "ClassType", @@ -1117,6 +1113,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "combinations", "type": { "_": "ArrayType", @@ -1295,6 +1292,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json index e0c11f0c0..d956e5b75 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json @@ -117,16 +117,13 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "counter", @@ -151,9 +148,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -165,9 +160,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -230,6 +223,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json index 03c070e1d..533725e89 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/object.ts.json @@ -256,6 +256,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -327,6 +328,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -376,6 +378,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -410,6 +413,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -443,6 +447,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -467,6 +472,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -498,6 +504,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -536,6 +543,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "obj", "type": { "_": "ClassType", @@ -560,6 +568,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -684,6 +693,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -715,6 +725,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -796,6 +807,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -942,6 +954,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -973,6 +986,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1073,6 +1087,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1274,6 +1289,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -1362,6 +1378,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json index 174c2918f..6ed227019 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json @@ -186,6 +186,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -309,6 +310,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -580,6 +582,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -657,16 +660,13 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -691,9 +691,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -705,9 +703,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -721,6 +717,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "myPerson", "type": { "_": "ClassType", @@ -773,6 +770,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -1342,9 +1340,7 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1371,10 +1367,7 @@ 3, 4 ], - "predecessors": [ - 1, - 14 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1388,6 +1381,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "sampleData", "type": { "_": "ArrayType", @@ -1412,7 +1406,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -1437,9 +1431,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -1452,9 +1444,7 @@ 5, 23 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1522,7 +1512,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "$temp3", @@ -1549,9 +1539,7 @@ "successors": [ 6 ], - "predecessors": [ - 4 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1631,6 +1619,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -1667,10 +1656,7 @@ 21, 22 ], - "predecessors": [ - 5, - 23 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1894,15 +1880,14 @@ "successors": [ 8 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -1936,12 +1921,7 @@ "successors": [ 9 ], - "predecessors": [ - 7, - 20, - 21, - 22 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1968,10 +1948,7 @@ 10, 19 ], - "predecessors": [ - 8, - 19 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2011,7 +1988,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "count", @@ -2038,9 +2015,7 @@ "successors": [ 11 ], - "predecessors": [ - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2067,16 +2042,13 @@ 12, 16 ], - "predecessors": [ - 10, - 18 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "j", @@ -2103,9 +2075,7 @@ "successors": [ 13 ], - "predecessors": [ - 11 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2132,16 +2102,13 @@ 14, 15 ], - "predecessors": [ - 12, - 15 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -2168,10 +2135,7 @@ "successors": [ 2 ], - "predecessors": [ - 13, - 15 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2209,9 +2173,7 @@ 13, 14 ], - "predecessors": [ - 13 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2274,6 +2236,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2333,6 +2296,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2363,7 +2327,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "k", @@ -2419,15 +2383,13 @@ 17, 18 ], - "predecessors": [ - 11 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "j", @@ -2454,9 +2416,7 @@ "successors": [ 18 ], - "predecessors": [ - 16 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2519,6 +2479,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2552,10 +2513,7 @@ "successors": [ 11 ], - "predecessors": [ - 16, - 17 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2592,9 +2550,7 @@ "successors": [ 9 ], - "predecessors": [ - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2657,6 +2613,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2718,9 +2675,7 @@ "successors": [ 8 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2800,6 +2755,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2833,9 +2789,7 @@ "successors": [ 8 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2915,6 +2869,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -2948,9 +2903,7 @@ "successors": [ 8 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3030,6 +2983,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -3063,9 +3017,7 @@ "successors": [ 6 ], - "predecessors": [ - 4 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3145,6 +3097,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -3338,6 +3291,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -3417,6 +3371,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -3488,6 +3443,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp2", "type": { "_": "ClassType", @@ -3568,6 +3524,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "notPerson", "type": { "_": "ClassType", @@ -3592,6 +3549,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "notPerson", "type": { "_": "ClassType", @@ -3618,6 +3576,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "Person", "type": { "_": "UnknownType" @@ -3788,16 +3747,13 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -3822,9 +3778,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -3843,9 +3797,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -4095,6 +4047,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -4268,6 +4221,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -4328,6 +4282,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "x", "type": { "_": "ClassType", @@ -4361,6 +4316,7 @@ "arg": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "x", "type": { "_": "ClassType", @@ -4423,6 +4379,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -4573,6 +4530,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -4604,6 +4562,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -4626,7 +4585,7 @@ "_": "Local", "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "Person" @@ -4750,6 +4709,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -4821,13 +4781,15 @@ "enclosingClass": { "name": "Person" }, - "name": "AnonymousMethod-@instance_init-0", + "name": "getAge", "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [], + "modifiers": [ + "PublicKeyword" + ], "typeParameters": [], "body": { "locals": [ @@ -4888,6 +4850,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -4908,35 +4871,14 @@ } }, { - "_": "AssignStmt", - "left": { + "_": "ReturnStmt", + "arg": { "_": "Local", "name": "$temp0", "type": { "_": "UnknownType" } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } } - }, - { - "_": "ReturnVoidStmt" } ] } @@ -4949,15 +4891,13 @@ "enclosingClass": { "name": "Person" }, - "name": "getAge", + "name": "AnonymousMethod-@instance_init-0", "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { "locals": [ @@ -5018,6 +4958,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5038,14 +4979,35 @@ } }, { - "_": "ReturnStmt", - "arg": { + "_": "AssignStmt", + "left": { "_": "Local", "name": "$temp0", "type": { "_": "UnknownType" } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -5120,6 +5082,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -5367,6 +5330,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -5468,6 +5432,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5490,7 +5455,7 @@ "_": "Local", "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "Adder" @@ -5622,6 +5587,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -5797,6 +5763,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5951,6 +5918,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5972,6 +5940,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -5996,6 +5965,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6018,7 +5988,7 @@ "_": "Local", "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "ExtendedAdder" @@ -6202,6 +6172,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6308,6 +6279,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -6583,6 +6555,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -6747,6 +6720,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6778,6 +6752,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6831,6 +6806,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -6865,6 +6841,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -6900,6 +6877,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7053,6 +7031,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7153,6 +7132,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7255,6 +7235,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7360,6 +7341,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -7456,6 +7438,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7487,6 +7470,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -7518,6 +7502,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "logger", "type": { "_": "UnknownType" @@ -7738,6 +7723,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -7800,6 +7786,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8010,6 +7997,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8041,6 +8029,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8122,6 +8111,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8248,6 +8238,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8301,6 +8292,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -8327,6 +8319,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8411,6 +8404,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8544,6 +8538,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -8570,6 +8565,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8654,6 +8650,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -8857,6 +8854,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8892,6 +8890,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -8923,6 +8922,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9004,6 +9004,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9137,6 +9138,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -9163,6 +9165,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9247,6 +9250,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9404,6 +9408,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", @@ -9430,6 +9435,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9486,6 +9492,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp1", "type": { "_": "ClassType", @@ -9512,6 +9519,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -9596,6 +9604,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9810,6 +9819,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -9874,6 +9884,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10014,6 +10025,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10045,6 +10057,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10076,6 +10089,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10157,6 +10171,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" @@ -10284,6 +10299,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10410,6 +10426,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -10495,6 +10512,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json index c9ec77b5b..9ea70d8af 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json @@ -246,6 +246,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -274,6 +275,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -302,6 +304,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "SceneBuildStage", "type": { "_": "UnknownType" @@ -484,6 +487,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "ViewTreeNodeType", "type": { "_": "UnknownType" @@ -512,6 +516,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "ViewTreeNodeType", "type": { "_": "UnknownType" @@ -555,6 +560,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp4", "type": { "_": "ClassType", @@ -609,6 +615,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "Object", "type": { "_": "UnknownType" @@ -650,6 +657,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp5", "type": { "_": "UnknownType" @@ -679,10 +687,7 @@ 2, 5 ], - "predecessors": [ - 0, - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -699,6 +704,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp6", "type": { "_": "ClassType", @@ -735,6 +741,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -786,9 +793,7 @@ 3, 4 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -802,6 +807,7 @@ "right": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -854,7 +860,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp12", @@ -879,10 +885,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2, - 4 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -898,6 +901,7 @@ "arg": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -926,15 +930,14 @@ "successors": [ 3 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "console", "type": { "_": "UnknownType" @@ -968,9 +971,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -984,6 +985,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp7", "type": { "_": "ClassType", @@ -1103,6 +1105,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "obj", "type": { "_": "UnclearReferenceType", @@ -1267,6 +1270,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1309,6 +1313,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1351,6 +1356,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1410,6 +1416,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1431,6 +1438,7 @@ "right": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "StringType" @@ -1684,6 +1692,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1715,6 +1724,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1746,6 +1756,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1777,6 +1788,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -1808,6 +1820,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2050,6 +2063,7 @@ "left": { "_": "InstanceFieldRef", "instance": { + "_": "Local", "name": "this", "type": { "_": "ClassType", @@ -2131,6 +2145,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "this", "type": { "_": "UnknownType" diff --git a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json index 9c67f751c..a9ac50ed9 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json @@ -426,7 +426,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -459,10 +459,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -489,9 +486,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -642,7 +637,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -675,10 +670,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -690,9 +682,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -721,6 +711,7 @@ "expr": { "_": "InstanceCallExpr", "instance": { + "_": "Local", "name": "$temp0", "type": { "_": "ClassType", diff --git a/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts b/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts deleted file mode 100644 index ba726bcd3..000000000 --- a/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts +++ /dev/null @@ -1,29 +0,0 @@ -function source(): number { - return null -} - -function pass(data: boolean) { - return data -} - -function validate(data) { - if (data == null) return "OK" - return data -} - -function sink(data) { - if (data == null) throw new Error("Error!") -} - -function bad() { - let data = source() - // @ts-ignore - data = pass(data) - sink(data) -} - -function good() { - let data = source() - data = validate(data) - sink(data) -} diff --git a/jacodb-ets/src/test/resources/samples/taint.ts b/jacodb-ets/src/test/resources/samples/TaintAnalysis.ts similarity index 100% rename from jacodb-ets/src/test/resources/samples/taint.ts rename to jacodb-ets/src/test/resources/samples/TaintAnalysis.ts diff --git a/jacodb-ets/src/test/resources/samples/initializers.ts b/jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts similarity index 100% rename from jacodb-ets/src/test/resources/samples/initializers.ts rename to jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts diff --git a/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts b/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts new file mode 100644 index 000000000..e8f4ee2c2 --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts @@ -0,0 +1,7 @@ +class Bar {} + +class Foo { + bar: Bar = new Bar(); +} + +let foo = new Foo(); diff --git a/jacodb-ets/src/test/resources/samples/lang/in.ts b/jacodb-ets/src/test/resources/samples/lang/in.ts new file mode 100644 index 000000000..7d1793cfc --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/lang/in.ts @@ -0,0 +1,8 @@ +class Cat { + constructor(public name: string) { + } +} + +let cat = new Cat("Barsik"); +let catHasName = "name" in cat; // true +let catHasMeow = "meow" in cat; // false diff --git a/jacodb-ets/src/test/resources/samples/lang/instanceof.ts b/jacodb-ets/src/test/resources/samples/lang/instanceof.ts new file mode 100644 index 000000000..0f3a0427f --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/lang/instanceof.ts @@ -0,0 +1,5 @@ +class Cat { +} + +let x = new Cat(); +console.log(x instanceof Cat); // true diff --git a/jacodb-ets/src/test/resources/samples/object.ts b/jacodb-ets/src/test/resources/samples/lang/object.ts similarity index 100% rename from jacodb-ets/src/test/resources/samples/object.ts rename to jacodb-ets/src/test/resources/samples/lang/object.ts From 1f8bbaec0cfabc9d376aa6d6117f7b6befd6d621 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Thu, 8 Aug 2024 13:00:30 +0300 Subject: [PATCH 7/9] Update resources --- .../{taint.ts.json => TaintAnalysis.ts.json} | 2 +- .../FieldInitializers.ts.json} | 2 +- .../NestedInitializer.ts.json} | 863 ++++++------------ .../resources/etsir/samples/lang/in.ts.json | 457 ++++++++++ .../etsir/samples/lang/instanceof.ts.json | 407 +++++++++ .../etsir/samples/{ => lang}/object.ts.json | 2 +- 6 files changed, 1147 insertions(+), 586 deletions(-) rename jacodb-ets/src/test/resources/etsir/samples/{taint.ts.json => TaintAnalysis.ts.json} (99%) rename jacodb-ets/src/test/resources/etsir/samples/{initializers.ts.json => classes/FieldInitializers.ts.json} (99%) rename jacodb-ets/src/test/resources/etsir/samples/{DataFlowSecurity.ts.json => classes/NestedInitializer.ts.json} (52%) create mode 100644 jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json create mode 100644 jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json rename jacodb-ets/src/test/resources/etsir/samples/{ => lang}/object.ts.json (99%) diff --git a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json similarity index 99% rename from jacodb-ets/src/test/resources/etsir/samples/taint.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json index a9ac50ed9..14629f710 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json @@ -1,5 +1,5 @@ { - "name": "taint.ts", + "name": "TaintAnalysis.ts", "namespaces": [], "classes": [ { diff --git a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json similarity index 99% rename from jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json index 15e105a20..013407036 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/initializers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json @@ -1,5 +1,5 @@ { - "name": "initializers.ts", + "name": "classes/FieldInitializers.ts", "namespaces": [], "classes": [ { diff --git a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json similarity index 52% rename from jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json index 757ef56ec..cc1a10325 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json @@ -1,5 +1,5 @@ { - "name": "DataFlowSecurity.ts", + "name": "classes/NestedInitializer.ts", "namespaces": [], "classes": [ { @@ -35,6 +35,24 @@ "name": "_DEFAULT_ARK_CLASS" } } + }, + { + "name": "foo", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } } ], "cfg": { @@ -66,6 +84,78 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "foo", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, { "_": "ReturnVoidStmt" } @@ -74,32 +164,34 @@ ] } } - }, + } + ] + }, + { + "signature": { + "name": "Bar" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ { "signature": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" }, - "name": "source", + "name": "@instance_init", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -113,10 +205,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } + "_": "UnknownType" } }, "right": { @@ -124,20 +213,13 @@ "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" } } } }, { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" - } - } + "_": "ReturnVoidStmt" } ] } @@ -148,18 +230,10 @@ { "signature": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" }, - "name": "pass", - "parameters": [ - { - "name": "data", - "type": { - "_": "BooleanType" - }, - "isOptional": false - } - ], + "name": "@static_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -167,23 +241,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "BooleanType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -195,29 +253,59 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "data", + "name": "this", "type": { - "_": "BooleanType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "BooleanType" + "_": "ClassType", + "signature": { + "name": "Bar" + } } } }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } + "_": "UnknownType" } }, "right": { @@ -225,42 +313,80 @@ "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" } } } }, { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "data", - "type": { - "_": "BooleanType" - } + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] } + }, + { + "_": "ReturnVoidStmt" } ] } ] } } - }, + } + ] + }, + { + "signature": { + "name": "Foo" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ { "signature": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Foo" }, - "name": "validate", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnknownType" - }, - "isOptional": false - } - ], + "name": "bar", + "type": { + "_": "UnclearReferenceType", + "name": "Bar" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -270,45 +396,38 @@ "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" } } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } } ], "cfg": { "blocks": [ { "id": 0, - "successors": [ - 1, - 2 - ], + "successors": [], "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "data", + "name": "this", "type": { "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Foo" + } } } }, @@ -316,299 +435,89 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" } } }, "right": { - "_": "ThisRef", - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Bar" } } } }, { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": "==", - "left": { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", - "name": "data", + "name": "$temp0", "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" + "_": "ClassType", + "signature": { + "name": "Bar" + } } }, - "type": { - "_": "BooleanType" - } - } - } - ] - }, - { - "id": 1, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - } - ] - }, - { - "id": 2, - "successors": [ - 1 - ], - "predecessors": [], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "OK", - "type": { - "_": "StringType" - } - } - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "sink", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnknownType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [ - 1, - 2 - ], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": "==", - "left": { - "_": "Local", - "name": "data", - "type": { + "method": { + "enclosingClass": { + "name": "Bar" + }, + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, - "right": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" - } - }, - "type": { - "_": "BooleanType" - } + "args": [] } - } - ] - }, - { - "id": 1, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "ReturnVoidStmt" - } - ] - }, - { - "id": 2, - "successors": [ - 1 - ], - "predecessors": [], - "stmts": [ + }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - }, - "right": { - "_": "NewExpr", - "classType": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", + "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "$temp0", + "name": "this", "type": { "_": "ClassType", "signature": { - "name": "Error" + "name": "Foo" } } }, - "method": { + "field": { "enclosingClass": { - "name": "Error" + "name": "Foo" }, - "name": "constructor", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Constant", - "value": "Error!", - "type": { - "_": "StringType" - } + "name": "bar", + "type": { + "_": "UnclearReferenceType", + "name": "Bar" } - ] - } - }, - { - "_": "ThrowStmt", - "arg": { + } + }, + "right": { "_": "Local", "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Error" + "name": "Bar" } } } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -619,9 +528,9 @@ { "signature": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Foo" }, - "name": "bad", + "name": "@static_init", "parameters": [], "returnType": { "_": "UnknownType" @@ -630,41 +539,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "source", - "type": { - "_": "UnknownType" - } - }, - { - "name": "pass", - "type": { - "_": "UnknownType" - } - }, - { - "name": "sink", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -678,10 +553,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } + "_": "UnknownType" } }, "right": { @@ -689,90 +561,9 @@ "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "source", - "parameters": [], - "returnType": { - "_": "UnknownType" + "name": "Foo" } - }, - "args": [] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "pass", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "sink", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] } }, { @@ -787,9 +578,9 @@ { "signature": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Foo" }, - "name": "good", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" @@ -798,41 +589,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "source", - "type": { - "_": "UnknownType" - } - }, - { - "name": "validate", - "type": { - "_": "UnknownType" - } - }, - { - "name": "sink", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -846,10 +603,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } + "_": "UnknownType" } }, "right": { @@ -857,90 +611,33 @@ "type": { "_": "ClassType", "signature": { - "name": "_DEFAULT_ARK_CLASS" + "name": "Foo" } } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "source", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "validate", - "parameters": [], - "returnType": { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { "_": "UnknownType" } }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "" + "name": "Foo" }, - "name": "sink", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] + "args": [] } }, { diff --git a/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json new file mode 100644 index 000000000..3b55d41de --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json @@ -0,0 +1,457 @@ +{ + "name": "lang/in.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "cat", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "catHasName", + "type": { + "_": "UnknownType" + } + }, + { + "name": "catHasMeow", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "Barsik", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "cat", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "catHasName", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "undefined", + "type": { + "_": "UndefinedType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "catHasMeow", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "undefined", + "type": { + "_": "UndefinedType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Cat" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [ + { + "name": "name", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "name", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json new file mode 100644 index 000000000..399955335 --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json @@ -0,0 +1,407 @@ +{ + "name": "lang/instanceof.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "InstanceOfExpr", + "arg": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "checkType": { + "_": "UnclearReferenceType", + "name": "Cat" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Cat" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json similarity index 99% rename from jacodb-ets/src/test/resources/etsir/samples/object.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json index 533725e89..49c342744 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json @@ -1,5 +1,5 @@ { - "name": "object.ts", + "name": "lang/object.ts", "namespaces": [], "classes": [ { From d934d34b63eb76a77ce26c383b77871d34fb60ce Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Thu, 8 Aug 2024 13:00:42 +0300 Subject: [PATCH 8/9] Cleanup --- jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt | 4 ++-- .../src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt | 1 - .../src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index 9e501323d..acad74720 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -32,7 +32,6 @@ import org.jacodb.ets.base.EtsBooleanConstant import org.jacodb.ets.base.EtsBooleanType import org.jacodb.ets.base.EtsCallExpr import org.jacodb.ets.base.EtsCallStmt -import org.jacodb.ets.base.EtsFunctionType import org.jacodb.ets.base.EtsCastExpr import org.jacodb.ets.base.EtsClassType import org.jacodb.ets.base.EtsCommaExpr @@ -44,6 +43,7 @@ import org.jacodb.ets.base.EtsEqExpr import org.jacodb.ets.base.EtsExpExpr import org.jacodb.ets.base.EtsExpr import org.jacodb.ets.base.EtsFieldRef +import org.jacodb.ets.base.EtsFunctionType import org.jacodb.ets.base.EtsGotoStmt import org.jacodb.ets.base.EtsGtEqExpr import org.jacodb.ets.base.EtsGtExpr @@ -294,7 +294,7 @@ class EtsMethodBuilder( ) is AwaitExprDto -> EtsAwaitExpr( - arg = convertToEtsEntity(value.arg) + arg = convertToEtsEntity(value.arg) ) is YieldExprDto -> EtsYieldExpr( diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt index 8ce78b736..e00dda059 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt @@ -24,7 +24,6 @@ import org.jacodb.ets.dto.MethodDto import org.jacodb.ets.dto.NopStmtDto import org.jacodb.ets.dto.StmtDto import org.jacodb.ets.dto.SwitchStmtDto -import java.io.BufferedWriter import java.io.File import java.nio.file.Path import kotlin.io.path.createDirectories diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt index 7344e9134..f1f2b0520 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt @@ -20,7 +20,6 @@ import org.jacodb.ets.base.EtsStmt import org.jacodb.ets.model.EtsClass import org.jacodb.ets.model.EtsFile import org.jacodb.ets.model.EtsMethod -import java.io.BufferedWriter import java.io.File import java.nio.file.Path import kotlin.io.path.createDirectories From 7c135ea81c3645ee6062f8bb10673b9f112c5672 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Thu, 8 Aug 2024 13:02:47 +0300 Subject: [PATCH 9/9] Fix path --- jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt index f6c69df71..5da8bddb5 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt @@ -72,8 +72,8 @@ class EtsFileTest { } @Test - fun `test sample initializers`() { - val etsFile = load("etsir/samples/initializers") + fun `test sample FieldInitializers`() { + val etsFile = load("etsir/samples/classes/FieldInitializers") val cls = etsFile.classes.single { it.name == "Foo" }