On Tue, 12 Oct 2021 05:37:53 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> Cleanup unnecessary toString() calls when conversion will happen implicitly >> anyway > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java > line 1012: > >> 1010: tmpBuf.append(Long.toHexString(startPc + >> visitor.getInstructionSize())); >> 1011: tmpBuf.append(",0x"); >> 1012: tmpBuf.append(Long.toHexString(startPc)); > > Overall these changes look good, although I do wonder what motivated to > `toString()` calls in the first place, especially this example where lines > 1010 and 1012 are similar, but only 1010 used `toString()`. Often reason for such mistakes is pretty trivial: copy-paste error, refactoring stopped in the middle or incorrect merge. Unfortunately this code is from pre-OpenJDK and it's impossible to find original motifaction. ------------- PR: https://git.openjdk.java.net/jdk/pull/5800