RFR: 8265433: IGV: add graph tooltips with properties [v3]

Koichi Sakata ksakata at openjdk.org
Mon Aug 8 07:27:12 UTC 2022


On Thu, 4 Aug 2022 12:01:27 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Koichi Sakata has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Escape strings in tooltip
>>  - Undo an unintentional change
>>  - Discard changes for Outline window
>
> src/utils/IdealGraphVisualizer/Util/src/main/java/com/sun/hotspot/igv/util/PropertiesConverter.java line 34:
> 
>> 32:  * @author ksakata
>> 33:  */
>> 34: public class PropertiesConverter {
> 
> This class should escape at least the most common HTML characters. See for example the difference in the `dump_spec` property in the tooltip and in the Properties window:
> 
> ![different-dump_spec](https://user-images.githubusercontent.com/8792647/182841654-e552502d-99a9-44a1-8e19-5686563f1b63.png)
> 
> Luckily, there is already a helper method for escaping HTML: [com.sun.hotspot.igv.util.StringUtils::escapeHTML](https://github.com/openjdk/jdk/blob/ce61eb6ff99eaaece463091b8481e27f84f80684/src/utils/IdealGraphVisualizer/Util/src/main/java/com/sun/hotspot/igv/util/StringUtils.java#L33).

Thank you for pointing this out! I've used that method. Special characters display correctly.
<img width="360" alt="スクリーンショット 2022-08-08 15 45 45" src="https://user-images.githubusercontent.com/60008/183360106-446226b3-5ae0-441c-bd14-78000c95f85f.png">

Unfortunately, apostrophes in the tooltip text were shown in the form of character entity reference. 
<img width="548" alt="スクリーンショット 2022-08-08 14 43 22" src="https://user-images.githubusercontent.com/60008/183359617-f6ba6be3-e2f6-450b-aae2-a8716eac0d69.png">
So I've changed StringUtils class to use numeric entity reference for apostrophe instead of character entity reference. After that, we can see apostrophes properly.
<img width="461" alt="スクリーンショット 2022-08-08 14 53 02" src="https://user-images.githubusercontent.com/60008/183360045-55702560-705d-4deb-bb90-b68b9580cf1b.png">

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

PR: https://git.openjdk.org/jdk/pull/9740


More information about the hotspot-compiler-dev mailing list