add type to assertion message

This commit is contained in:
Vladimir Krivosheev
2016-02-17 13:06:02 +01:00
parent d499f6c818
commit 7bbd6f20d2
3 changed files with 3 additions and 3 deletions
@@ -203,7 +203,7 @@ class StateMap private constructor(private val names: Array<String>, private val
}
val currentState = states.get(index)
LOG.assertTrue(currentState is Element)
LOG.assertTrue(currentState is Element, currentState?.let { it.javaClass.name } ?: "null")
states.set(index, if (state == null) null else archiveState(state).toByteArray())
}
}
@@ -56,7 +56,7 @@ class StateGetter<S : Any, T : Any>(private val component: PersistentStateCompon
try {
stateAfterLoad = component.state
}
catch(e: Throwable) {
catch (e: Throwable) {
LOG.error("Cannot get state after load", e)
stateAfterLoad = null
}
@@ -226,7 +226,7 @@ fun save(states: StateMap, rootElementName: String, newLiveStates: Map<String, E
return rootElement
}
fun Element.normalizeRootName(): Element {
internal fun Element.normalizeRootName(): Element {
if (parent != null) {
LOG.warn("State element must not have parent ${JDOMUtil.writeElement(this)}")
detach()