<div class="__aliyun_email_body_block"><div  style="line-height:1.7;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#0070c0;"><div  style="clear:both;">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.<br ></div><div  style="line-height:20.0px;clear:both;"><div  style="clear:both;"><br ></div><div  style="clear:both;">I submitted a PR ( <a  href="https://github.com/openjdk/jdk/pull/15998" target="_blank">https://github.com/openjdk/jdk/pull/15998</a> ), including the code and tests for the new method. I also replaced the code that uses the append + toHexString combination inside the JDK with appendHex.</div><span ><div  style="line-height:20.0px;clear:both;"><span ><br ></span></div>Please review and don't hesitate to critique my approach and patch.</span></div></div></div>