mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add type to assertion message
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user