The referenced value. Gets the value or sets the new value. If new value is not null, it must be frozen or permanent object.
What is a permanent object? I have not seen that language used elsewhere before
k
Kris Wong
01/15/2020, 10:41 PM
I suspect it's an object declared with the
object
keyword, but not certain
s
Sam Schilling
01/15/2020, 10:41 PM
Ah, that would make sense
Sam Schilling
01/15/2020, 11:03 PM
May also refer to literal values?
Copy code
val a = false
AtomicReference(a) // throws InvalidMutabilityException
AtomicReference(false) // does not throw exception
Sam Schilling
01/15/2020, 11:07 PM
Regardless it would be nice to get some clarification from JB on this.
o
olonho
01/16/2020, 2:02 AM
Permanent object is compile-time instantiated object, String literals, some boxed integers and few other objects, such as stateless singletons fall into this category.