1+ @file:Suppress(" unused" )
2+
13package org.vorpal.research.kfg.ir
24
35import org.objectweb.asm.tree.ClassNode
@@ -10,6 +12,7 @@ import org.vorpal.research.kfg.type.Type
1012import org.vorpal.research.kfg.type.TypeFactory
1113import org.vorpal.research.kthelper.assert.ktassert
1214
15+ @Suppress(" MemberVisibilityCanBePrivate" )
1316abstract class Class : Node {
1417 protected data class MethodKey (val name : String , val desc : MethodDescriptor ) {
1518 constructor (tf: TypeFactory , name: String , desc: String ) : this (name, MethodDescriptor .fromDesc(tf, desc))
@@ -107,6 +110,7 @@ abstract class Class : Node {
107110
108111 internal fun init () {
109112 this .innerClassesMap.putAll(cn.innerClasses.map { it.name to Modifiers (it.access) }.toMutableSet())
113+ this .outerClassName = cn.outerClass
110114 for (fieldNode in cn.fields) {
111115 val field = Field (cm, this , fieldNode)
112116 innerFields[field.name to field.type] = field
@@ -172,6 +176,10 @@ abstract class Class : Node {
172176 fun removeField (field : Field ) = innerFields.remove(field.name to field.type)
173177 fun removeMethod (method : Method ) = innerMethods.remove(method.name to method.desc)
174178
179+ fun addInnerClass (klass : Class , modifiers : Modifiers ) {
180+ innerClassesMap[klass.fullName] = modifiers
181+ }
182+
175183 override fun toString () = fullName
176184 override fun hashCode () = fullName.hashCode()
177185 override fun equals (other : Any? ): Boolean {
0 commit comments