MGNLUI-3428, we introduced info.magnolia.ui.contentapp.DefinitionCloner to workaround problems we found when cloning definitions.
Really though, those definitions should never have been cloned in the first place. The use-case is to slightly "customize" a given configured definition and reuse it in a slightly different context (e.g reuse a workbench config in a choose dialog)
Not only does this cause unnecessary complexity (e.g doesn't play well with proxies), it's also just really unnecessary and unportable. Many usages explicitly cast to the Configured* implementation of their definition, to be able to call setter methods. This will thus obviously never work with any other implementation of the interfaces.
Instead, we should introduce simple decorators for our definition interfaces. Let them delegate all getters to a delegatee. And in place of cloning, we could do something along these lines:
(and of course using a non-anonymous class to do this would provide greater debuggability)
This goes hand-in-hand with tasks related to "use interfaces everywhere" and "builders for definitions".