mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
Removed extraAdvertisedServiceIds config
The remaining use for it was the finance CorDapp for permissioning CCY issuers. Instead this is now taken from a custom config in node.conf.
This commit is contained in:
@ -12,6 +12,7 @@ import net.corda.core.internal.uncheckedCast
|
||||
import net.corda.core.utilities.NetworkHostAndPort
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.lang.reflect.Field
|
||||
import java.lang.reflect.Modifier.isStatic
|
||||
import java.lang.reflect.ParameterizedType
|
||||
import java.net.Proxy
|
||||
import java.net.URL
|
||||
@ -142,7 +143,7 @@ fun Any.toConfig(): Config = ConfigValueFactory.fromMap(toConfigMap()).toConfig(
|
||||
private fun Any.toConfigMap(): Map<String, Any> {
|
||||
val values = HashMap<String, Any>()
|
||||
for (field in javaClass.declaredFields) {
|
||||
if (field.isSynthetic) continue
|
||||
if (isStatic(field.modifiers) || field.isSynthetic) continue
|
||||
field.isAccessible = true
|
||||
val value = field.get(this) ?: continue
|
||||
val configValue = if (value is String || value is Boolean || value is Number) {
|
||||
|
@ -181,6 +181,11 @@ class ConfigParsingTest {
|
||||
assertThat(OldData("old").toConfig()).isEqualTo(config("newValue" to "old"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `static field`() {
|
||||
assertThat(DataWithCompanion(3).toConfig()).isEqualTo(config("value" to 3))
|
||||
}
|
||||
|
||||
private inline fun <reified S : SingleData<V>, reified L : ListData<V>, V : Any> testPropertyType(
|
||||
value1: V,
|
||||
value2: V,
|
||||
@ -259,6 +264,12 @@ class ConfigParsingTest {
|
||||
data class OldData(
|
||||
@OldConfig("oldValue")
|
||||
val newValue: String)
|
||||
data class DataWithCompanion(val value: Int) {
|
||||
companion object {
|
||||
@Suppress("unused")
|
||||
val companionValue = 2
|
||||
}
|
||||
}
|
||||
|
||||
enum class TestEnum { Value1, Value2 }
|
||||
}
|
Reference in New Issue
Block a user