@@ -18,6 +18,7 @@ package org.jacodb.impl.cfg
18
18
19
19
import org.jacodb.api.*
20
20
import org.jacodb.api.cfg.*
21
+ import org.jacodb.api.ext.findType
21
22
import org.jacodb.api.ext.jvmName
22
23
import org.jacodb.impl.cfg.util.typeName
23
24
import org.jacodb.impl.softLazy
@@ -76,7 +77,7 @@ abstract class MethodSignatureRef(
76
77
}
77
78
78
79
fun JcType.throwNotFoundException (): Nothing {
79
- throw IllegalStateException (this .methodNotFoundMessage)
80
+ throw MethodNotFoundException (this .methodNotFoundMessage)
80
81
}
81
82
82
83
}
@@ -89,14 +90,14 @@ class TypedStaticMethodRefImpl(
89
90
) : MethodSignatureRef(type, name, argTypes, returnType) {
90
91
91
92
constructor (classpath: JcClasspath , raw: JcRawStaticCallExpr ) : this (
92
- classpath.findTypeOrNull (raw.declaringClass.typeName) as JcClassType ,
93
+ classpath.findType (raw.declaringClass.typeName) as JcClassType ,
93
94
raw.methodName,
94
95
raw.argumentTypes,
95
96
raw.returnType
96
97
)
97
98
98
99
override val method: JcTypedMethod by weakLazy {
99
- type.lookup.staticMethod(name, description) ? : throw IllegalStateException (methodNotFoundMessage )
100
+ type.lookup.staticMethod(name, description) ? : type.throwNotFoundException( )
100
101
}
101
102
}
102
103
@@ -108,7 +109,7 @@ class TypedSpecialMethodRefImpl(
108
109
) : MethodSignatureRef(type, name, argTypes, returnType) {
109
110
110
111
constructor (classpath: JcClasspath , raw: JcRawSpecialCallExpr ) : this (
111
- classpath.findTypeOrNull (raw.declaringClass.typeName) as JcClassType ,
112
+ classpath.findType (raw.declaringClass.typeName) as JcClassType ,
112
113
raw.methodName,
113
114
raw.argumentTypes,
114
115
raw.returnType
@@ -130,7 +131,7 @@ class VirtualMethodRefImpl(
130
131
131
132
companion object {
132
133
private fun JcRawCallExpr.resolvedType (classpath : JcClasspath ): Pair <JcClassType , JcClassType > {
133
- val declared = classpath.findTypeOrNull (declaringClass.typeName) as JcClassType
134
+ val declared = classpath.findType (declaringClass.typeName) as JcClassType
134
135
if (this is JcRawInstanceExpr ) {
135
136
val instance = instance
136
137
if (instance is JcRawLocal ) {
@@ -182,7 +183,7 @@ class TypedMethodRefImpl(
182
183
) : MethodSignatureRef(type, name, argTypes, returnType) {
183
184
184
185
constructor (classpath: JcClasspath , raw: JcRawCallExpr ) : this (
185
- classpath.findTypeOrNull (raw.declaringClass.typeName) as JcClassType ,
186
+ classpath.findType (raw.declaringClass.typeName) as JcClassType ,
186
187
raw.methodName,
187
188
raw.argumentTypes,
188
189
raw.returnType
0 commit comments