Skip to content

Commit c541d6f

Browse files
committed
Filter parent class name for inner class and vice versa.
1 parent cb08439 commit c541d6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/kotlin/com/autonomousapps/internal/BytecodeParsers.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ private class BytecodeReader(
146146
.filterNot { it.startsWith("java/") }
147147
// Filter out a "used class" that is exactly the class under analysis
148148
.filterNot { it == classAnalyzer.className }
149+
// Filter out parent class name for inner classes
150+
.filterNot { it.substringBefore('$') == classAnalyzer.className.substringBefore('$') }
149151
// More human-readable
150152
.map { canonicalize(it) }
151153
.toSortedSet()
@@ -160,6 +162,8 @@ private class BytecodeReader(
160162
.filterKeys { !it.startsWith("java/") }
161163
// Filter out a "used class" that is exactly the class under analysis
162164
.filterKeys { it != classAnalyzer.className }
165+
// Filter out parent class name for inner classes
166+
.filterKeys { it.substringBefore('$') != classAnalyzer.className.substringBefore('$') }
163167
}
164168
}
165169

0 commit comments

Comments
 (0)