@@ -79,7 +79,7 @@ class BindingWorker(
79
79
invalidatingListener = null
80
80
}
81
81
82
- private fun ModelSynchronizer.executeSync () {
82
+ private fun ModelSynchronizer.synchronizeAndStoreInstance () {
83
83
try {
84
84
activeSynchronizer = this
85
85
synchronize()
@@ -94,10 +94,17 @@ class BindingWorker(
94
94
val current = synchronizer.getCurrentSyncStack()
95
95
val previous = previousSyncStack
96
96
previousSyncStack = current
97
+
98
+ // The user should just have enough details to understand where the sync is spending its time.
97
99
val firstChange = current.zip(previous).indexOfFirst { it.first != it.second }
98
- val busyPath = current.take(firstChange + 1 )
99
- return busyPath.joinToString(" > " ) {
100
- it.getName() ? : it.tryGetConcept()?.getShortName() ? : it.getNodeReference().serialize()
100
+ val path = current.take(firstChange + 1 ).drop(1 )
101
+
102
+ return path.joinToString(" > " ) { node ->
103
+ runCatching { node.getName() }.getOrNull()?.takeIf { it.isNotEmpty() }
104
+ ? : runCatching { node.tryGetConcept()?.getShortName() }.getOrNull()?.takeIf { it.isNotEmpty() }
105
+ ? : runCatching { node.getNodeReference().serialize() }.getOrNull()
106
+ ? : runCatching { node.toString() }.getOrNull()
107
+ ? : (node::class .java.simpleName + " @" + System .identityHashCode(node))
101
108
}
102
109
}
103
110
@@ -279,7 +286,7 @@ class BindingWorker(
279
286
if (! continueOnError()) throw it
280
287
getMPSListener().synchronizationErrorHappened()
281
288
},
282
- ).executeSync ()
289
+ ).synchronizeAndStoreInstance ()
283
290
}
284
291
}
285
292
}
@@ -340,7 +347,7 @@ class BindingWorker(
340
347
sourceMask = MPSProjectSyncMask (listOf (mpsProject), true ),
341
348
targetMask = MPSProjectSyncMask (listOf (mpsProject), false ),
342
349
onException = { if (! continueOnError()) throw it },
343
- ).executeSync ()
350
+ ).synchronizeAndStoreInstance ()
344
351
}
345
352
}
346
353
}
0 commit comments