Re: 回复:Adding appendHex method to StringBuilder

2023-10-09 Thread Roger Riggs
10月2日(星期一) 20:46 收件人:Mark Reinhold ; Claes Redestad 抄 送:core-libs-dev@openjdk.org 主 题:回复:Adding appendHex method to StringBuilder Using String Template FMT has better performance and better code readability. But String Template does not yet support for/while/if/switch

Re: Adding appendHex method to StringBuilder

2023-10-02 Thread Mark Reinhold
2023/10/2 10:01:10 -0400, shaojin.we...@alibaba-inc.com: > StringTemplate is great and I wish I can submit PR to improve it. But > I still think StringBuilder.appendHex is a basic API, not a formatted > API. Just like Integer.toHexString and Long.toHexString, they are very > commonly used and shoul

回复:Adding appendHex method to StringBuilder

2023-10-02 Thread 温绍锦(高铁)
. -- 发件人:温绍锦(高铁) 发送时间:2023年10月2日(星期一) 20:46 收件人:Mark Reinhold ; Claes Redestad 抄 送:core-libs-dev@openjdk.org 主 题:回复:Adding appendHex method to StringBuilder Using String Template FMT has better performance and better code readability. But String Template does not yet support for

Re: Adding appendHex method to StringBuilder

2023-10-02 Thread Claes Redestad
ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x00ff)); } } return digestString.toString(); } } ``` - wenshao ------ 发件人:Mark Rei

回复:Adding appendHex method to StringBuilder

2023-10-02 Thread 温绍锦(高铁)
- 发件人:Mark Reinhold 发送时间:2023年10月2日(星期一) 20:19 收件人:Claes Redestad 抄 送:温绍锦(高铁) ; core-libs-dev@openjdk.org 主 题:Re: Adding appendHex method to StringBuilder 2023/10/2 7:22:55 -0400, claes.redes...@oracle.com: > I think this goes a

Re: Adding appendHex method to StringBuilder

2023-10-02 Thread Mark Reinhold
2023/10/2 7:22:55 -0400, claes.redes...@oracle.com: > I think this goes against the grain: StringBuilder is a simple builder > for non-localized unformatted output. For formatted output there’s > Formatter, String.format and, with JEP 430[1], FMT."..." to help output > string data in more advanced,

Re: Adding appendHex method to StringBuilder

2023-10-02 Thread Claes Redestad
I think this goes against the grain: StringBuilder is a simple builder for non-localized unformatted output. For formatted output there’s Formatter, String.format and, with JEP 430[1], FMT.”…” to help output string data in more advanced, formatted and localized ways. The latter has traditionally

回复:Adding appendHex method to StringBuilder

2023-09-30 Thread 温绍锦(高铁)
(); } } ``` -- 发件人:Bernd 发送时间:2023年10月1日(星期日) 00:50 收件人:温绍锦(高铁) ; core-libs-dev 主 题:Re: Adding appendHex method to StringBuilder Or maybe make it more generic and allow to specify the base as well, that’s more along the line of existing toString() methods of numbers. besides convinience, I

Re: Adding appendHex method to StringBuilder

2023-09-30 Thread Bernd
benchmarks?GrussBernd-- http://bernd.eckenfels.net  Von: core-libs-dev im Auftrag von 温绍锦(高铁) Gesendet: Samstag, September 30, 2023 2:07 PMAn: core-libs-dev Betreff: Adding appendHex method to StringBuilder There are many combinations of `append(Integer.toHexString(i))` and `append

Adding appendHex method to StringBuilder

2023-09-30 Thread 温绍锦(高铁)
There are many combinations of `append(Integer.toHexString(i))` and `append(Long.toHexString(i))` in the JDK code. I request to add method `appendHex(int)` and `appendHex(int)` to StringBuilder and StringBuffer. This can reduce duplicate code within the JDK and will also be useful to users. I su