inferred / FreeBuilder

Automatic generation of the Builder pattern for Java
Apache License 2.0
838 stars 101 forks source link

Perform type shortening lazily #380

Closed alicederyn closed 5 years ago

alicederyn commented 5 years ago

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.

alicederyn commented 5 years ago

"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...