Use simple for loop for api registration on node

This commit is contained in:
Matthew Nesbit 2016-05-16 14:42:04 +01:00
parent f26178f602
commit e8e909a5ff

View File

@ -107,10 +107,8 @@ class Node(dir: Path, val p2pAddr: HostAndPort, configuration: NodeConfiguration
resourceConfig.register(ResponseFilter())
resourceConfig.register(api)
clientAPIs.forEach {
customAPIClass ->
val customAPI = customAPIClass.getConstructor(api.APIServer::class.java)
.newInstance(api)
for(customAPIClass in clientAPIs) {
val customAPI = customAPIClass.getConstructor(api.APIServer::class.java).newInstance(api)
resourceConfig.register(customAPI)
}