On Sat, 20 Feb 2021 12:17:32 GMT, Сергей Цыпанов 
<github.com+10835776+stsypa...@openjdk.org> wrote:

> This is a very simple and trivial improvement about getting rid of pointless 
> char wrapping into array

LGTM

src/java.base/share/classes/java/io/ObjectStreamClass.java line 833:

> 831:             String fname = in.readUTF();
> 832:             String signature = ((tcode == 'L') || (tcode == '[')) ?
> 833:                 in.readTypeString() : String.valueOf(tcode);

Since the result of String.valueOf here will be equal to one of the primitive 
signatures strings ("I", "J", ...) (otherwise ObjectStreamField will throw an 
exception) it might make sense to turn this into a switch expression and 
simplify the whole thing. I can't tell how performance sensitive this piece of 
code is, though.

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

Marked as reviewed by redestad (Reviewer).

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

Reply via email to