It caches the
JvmDeclaredType
per
Class
.
The mechanism is based on the assumption that the same class loader is used during the lifetime of the type factory.
The cached
type
is not contained in a resource / resource set and contains proxies. If a
client requests a type, the cached instance is EcoreUtil.copied and the copy is delivered.
This class is mainly useful for unit tests where the number of
used resource sets is rather big compared to the number of loaded types,
e.g. the evaluation tests with about 500 test cases will request the
extension types at least 500 times thus caching those types greatly reduces the execution time.
Real world use cases like the command line compiler for Xtend will usually not benefit from cached
types
since only one resource set is involved which maintains an index of resolved
types.