On Thu, 2 Dec 2021 14:24:06 GMT, Roman Kennke <rken...@openjdk.org> wrote:

>> src/java.base/share/classes/java/io/ObjectStreamClass.java line 2133:
>> 
>>> 2131:             if (oldReflector != null) {
>>> 2132:                 reflector = oldReflector;
>>> 2133:             }
>> 
>> Map.computeIfAbsent(key, () -> new FieldReflector(matchFields, localDesc));
>> might be more compact.
>
> That would be nicer, indeed. Problem is that matchFields throws an 
> InvalidClassException, and that would have to get passed through the lambda.
> Also, that problem is pre-existing and not related to the change.

Yes, I did computeIfAbsent() originally just to find out handling check 
exception/wrapping/unwrapping would make the code much more complex.

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

PR: https://git.openjdk.java.net/jdk/pull/6375

Reply via email to