On Thu, 15 Jan 2026 19:38:18 GMT, Christopher Schnick <[email protected]> wrote:

>> I meant classname@hashcode, like "java.lang.Object@36f6e879" may not be what 
>> you expect from `.get()`.  A `null` value is the original behavior.
>
> I am confused. Are you commenting on the right part of the diff? I don't see 
> anything related to strings in this part

Ah, I think I know what you mean now.

Since this is about the handling of generics, the original catch block should 
never be reached in my understanding. The generic T type is erased, meaning 
this method should always return the value, regardless of whether the type 
matches or not.

If you do assign the return value of this method to a String, and the returned 
value is not of type string, it will always throw a ClassCastException. But 
that should also happen for the old method with the catch block.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2032#discussion_r2695723976

Reply via email to