RFR: JDK-8294529 : IGV: Highlight the current graphs in the Outline [v2]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Fri Sep 30 08:11:23 UTC 2022


On Thu, 29 Sep 2022 16:27:53 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

>> # Problem
>> IGV marks the graph(s) of the current active `EditorTopComponent` as selected. Here is an example of a difference graph between the `Inremental Boxing Inline` and `Before CountedLoop` graphs:
>> <img width="280" alt="before1" src="https://user-images.githubusercontent.com/71546117/192809113-20c73d39-4627-435b-8a0d-4b36f76541b2.png">
>> 
>> The selection can be changed when the user selects another graph (without opening in). This is needed for example to selected graphs that the user wants to delete:
>> <img width="262" alt="before2" src="https://user-images.githubusercontent.com/71546117/192809411-b2203f81-5103-4b07-82aa-d4ccd9b9ae5d.png">
>> 
>> # Proposed Solution
>> Change the font of the open graph to `bold` and make the icon darker. Do the same for the folder where the graph is located. Now the user can select different graphs and still see which graphs are currently opened in the active `EditorTopComponent`. 
>> <img width="313" alt="new_highlighting" src="https://user-images.githubusercontent.com/71546117/192809686-73b01459-93a2-48d3-b30d-5ed19c05ec45.png">
>> 
>> # Implementation Details
>> Introduce a new `selected` variable in `FolderNode` and `GraphNode`. Whenever the currently viewed graphs change, the function `changed(InputGraphProvider lastProvider)` in `OutlineTopComponent` is called. Here we set the `FolderNode` and `GraphNode` to be (un)selected. This fires a `fireDisplayNameChange` and a `fireIconChange` which updates the text/icons.
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   escapeHTML in  getHtmlDisplayName()

Thanks for addressing my comment, HTML escaping seems to work well now. I just found a NPE issue when testing this PR manually:
1. Open https://github.com/openjdk/jdk/files/9653179/hello.zip
2. Open a graph in `virtual void java.lang.Object.<init>()`
3. Right click on another graph in the same group and select `Difference to current graph`
4. We get the following NPE, and the highlighting disappears: 

[INFO] java.lang.NullPointerException
[INFO] [catch] at com.sun.hotspot.igv.coordinator.OutlineTopComponent.lambda$changed$2(OutlineTopComponent.java:262)
[INFO] 	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
[INFO] 	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
[INFO] 	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
[INFO] 	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
[INFO] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
[INFO] 	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
[INFO] 	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
[INFO] 	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
[INFO] 	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I am not sure whether this is a regression introduced in this PR or a previous issue (in which case it should be reported and addressed separately).

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

Changes requested by rcastanedalo (Reviewer).

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


More information about the hotspot-compiler-dev mailing list