Caused by: java.lang.AbstractMethodError: abstract method


#1

Hey guys,

I have this code here:

fun main() {
File(TentDatabase.getPathRepository(context)).walkBottomUp()
.filter { it.isFile }
.forEach { parseFiles(it) } //I think here is the problem
}

fun parseFiles(file: File) {
val extension = file.path.substringAfterLast(’.’, “”)
Log.i(“DB”, “name - $extension”)
}

WhenI try to run this code I get the exception:

 Caused by: java.lang.AbstractMethodError: abstract method "void org.secfirst.umbrella.data.internal.TentDao.parseFiles(java.io.File)"

How do I pass a function as a parameter? I just want to execute parseFiles(file) for each iteration.


#2

It seems that it picks up the wrong parseFiles function (the one in your DAO). Rename this one to parseFile and that should solve the problem (btw intellij’s go to definition should be able to help you here)