Fix after review

This commit is contained in:
Ilya Chernikov
2016-12-14 17:18:47 +01:00
parent f036422ee9
commit d78fc50e90
3 changed files with 6 additions and 7 deletions
@@ -53,11 +53,12 @@ open class GenericReplCompiledEvaluator(baseClasspath: Iterable<File>,
fun classNameFromPath(path: String) = JvmClassName.byInternalName(path.replaceFirst("\\.class$".toRegex(), ""))
fun processCompiledClasses() {
val expectedClassName = "Line${codeLine.no}"
compiledClasses.filter { it.path.endsWith(".class") }
.forEach {
val className = classNameFromPath(it.path)
if (className.fqNameForClassNameWithoutDollars.shortName().asString() == "Line${codeLine.no}") {
mainLineClassName = className.fqNameForClassNameWithoutDollars.asString()
if (className.internalName == expectedClassName || className.internalName.endsWith("/$expectedClassName")) {
mainLineClassName = className.internalName.replace('/', '.')
}
classLoader.addClass(className, it.bytes)
}