> On Dec 24, 2021, at 2:46 PM, [email protected] wrote:
>
>> Are you saying that new would always create a new object but the GC might
>> merge multiple instances of String into a single instance?
>
> About jvm's string optimizations, jvm may make different string
> objects with the same c
Hello,
the simple answer is that
new String(...) == new String(...)
*never* evaluates to true )it might throw, though), whatever
constructors you are using and whatever arguments you pass to to them.
Some garbage collectors *might* de-duplicate the underlying arrays (but
you cannot te
Hi,
if I understand correctly, you are supposing that method changeAmount()
is part of a security sensitive application under attack.
Its implementation first attempts a data validation by invoking
isUserIdAllowedOrThrowException(), then transforms validated data in a
lossy way (narrowing, t