Making use of latest FastClasspathScanner version and cleanup of CollectSignaturesFlow.kt

This commit is contained in:
Shams Asari
2017-05-12 10:03:28 +01:00
parent 1c87d4f9c5
commit 47c6b9c135
4 changed files with 9 additions and 17 deletions

View File

@ -6,7 +6,6 @@ import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.MoreExecutors
import com.google.common.util.concurrent.SettableFuture
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner
import io.github.lukehutch.fastclasspathscanner.scanner.ClassInfo
import net.corda.core.*
import net.corda.core.crypto.*
import net.corda.core.flows.FlowInitiator
@ -352,12 +351,8 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
}
}
val classpathURLsField = ClassInfo::class.java.getDeclaredField("classpathElementURLs").apply { isAccessible = true }
flowClasses.groupBy {
val classInfo = scanResult.classNameToClassInfo[it.name]
@Suppress("UNCHECKED_CAST")
(classpathURLsField.get(classInfo) as Set<URL>).first()
scanResult.classNameToClassInfo[it.name]!!.classpathElementURLs.first()
}.forEach { url, classes ->
log.info("Found flows in plugin ${url.pluginName()}: ${classes.joinToString { it.name }}")
}