@@ -39,9 +39,12 @@ class InterProceduralUnitGraph(graph: ExceptionalUnitGraph) {
39
39
private val edgesCache = mutableMapOf<ExceptionalUnitGraph , List <Edge >>()
40
40
41
41
val stmts: MutableSet <Stmt > = graph.stmts.toMutableSet()
42
- val registeredEdges: MutableSet <Edge > = graph.edges.toMutableSet()
42
+ private val registeredEdges: MutableSet <Edge > = graph.edges.toMutableSet()
43
43
// this field is required for visualization
44
- val allEdges: MutableSet <Edge > = graph.edges.toMutableSet()
44
+ private val allExplicitEdges: MutableSet <Edge > = graph.edges.toMutableSet()
45
+
46
+ val allEdges: Set <Edge > get() = allExplicitEdges + implicitEdges
47
+
45
48
/* *
46
49
* Used in [org.utbot.engine.selectors.nurs.InheritorsSelector] for a fast search of Virtual invoke successors.
47
50
*/
@@ -128,11 +131,9 @@ class InterProceduralUnitGraph(graph: ExceptionalUnitGraph) {
128
131
outgoingEdgesCount + = graph.outgoingEdgesCount
129
132
stmts + = joinedStmts
130
133
131
- allEdges + = graph.edges
134
+ allExplicitEdges + = graph.edges
132
135
allEdgesCount + = graph.outgoingEdgesCount
133
- allEdgesCount.computeIfPresent(stmt) { _, value ->
134
- value + 1
135
- }
136
+ allEdgesCount.computeIfPresent(stmt) { _, value -> value + 1 }
136
137
137
138
if (registerEdges) {
138
139
registeredMethods + = method
@@ -153,7 +154,7 @@ class InterProceduralUnitGraph(graph: ExceptionalUnitGraph) {
153
154
}
154
155
155
156
registeredEdges + = invokeEdge
156
- allEdges + = invokeEdge
157
+ allExplicitEdges + = invokeEdge
157
158
158
159
outgoingEdgesCount.computeIfPresent(stmt) { _, value ->
159
160
value + 1
@@ -207,7 +208,7 @@ class InterProceduralUnitGraph(graph: ExceptionalUnitGraph) {
207
208
}
208
209
209
210
// We don't want to cover all the exceptions in not overridden library classes
210
- if (declaringClass.isLibraryClass && ! declaringClass.isOverridden ) {
211
+ if (declaringClass.isLibraryNonOverriddenClass ) {
211
212
return emptySet()
212
213
}
213
214
@@ -257,6 +258,7 @@ class InterProceduralUnitGraph(graph: ExceptionalUnitGraph) {
257
258
/* *
258
259
* attach new statistics to graph before any modifying operations
259
260
*/
261
+ @Suppress(" UNREACHABLE_CODE" )
260
262
fun attach (statistics : TraverseGraphStatistics ) {
261
263
if (! attachAllowed) {
262
264
throw error(" Cannot attach new statistics. Graph have modified." )
0 commit comments