The original synthetic properties from Java were not cached anywhere and
created anew for every session. However, the enhanced properties are
(along with their originals) saved inside the session's cache, causing
inconsistency with newly created symbols via referential equality.
Depending on the execution, some accesses to lock could cause NPE.
The best solution we've found so far is to make lock volatile, so that
reads between lock and value are consistent between threads.
It requires further work to determine if we can have one volatile field.
When the other thread has already computed the value and cleared the
lock, the other thread could still enter the computeValueWithoutLock()
and see lock == null
When there are no declared constructors in Java class, make
javaConstructor's source element point to the class declaration,
making it possible to navigate from constructor's invocation there.
^KTIJ-22360 Fixed