Shortening types eagerly means critical information about in-scope types and subsequent type usage is not available. We have been using Datatype to store information about what types will be generated, to avoid this problem, but this duplicated information may go out-of-sync with reality. Instead, append fully-qualified types into the source, then revisit type usages later once the whole picture is known.
"Fun" fact: if you return null from your merge algorithm in Collectors.toMap, it doesn't store a null. It discards the key...and then puts it back on the very next instance. So it's there, gone, there, gone...
Shortening types eagerly means critical information about in-scope types and subsequent type usage is not available. We have been using Datatype to store information about what types will be generated, to avoid this problem, but this duplicated information may go out-of-sync with reality. Instead, append fully-qualified types into the source, then revisit type usages later once the whole picture is known.