RFR: JDK-8294565: IGV: ClassCastException when clicking on an edge in the graph

Andrey Turbanov aturbanov at openjdk.org
Sun Oct 23 12:55:05 UTC 2022


On Wed, 19 Oct 2022 11:13:35 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

> IGV crashed when the user clicked on any edge in the graph because the `select` method of the `SelectProvider` in `LineWidget.java` was faulty. 
> 
> # Implementation
> - `ActionFactory.createSelectAction` was changed to `CustomSelectAction` since it also supports to invert the selection with `Ctrl/CMD`
> - The `select` method gets called when the user clicks on an edge. `LineWidget` represents a single connection going out of a node and connecting to one or more nodes (one-to-many). `LineWidget` has a list of `Connection`'s that each represent a single link between two nodes (one-to-one). For each `connection` we collect the from/to `Vertex` (superclass for a node) and put them into a set that we then use to select the nodes that are connected to the user-clicked `LineWidget`.

src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/widgets/LineWidget.java line 130:

> 128: 
> 129:             @Override
> 130:             public boolean isAimingAllowed(Widget widget, Point localLocation, boolean invertSelection)  {

Suggestion:

            public boolean isAimingAllowed(Widget widget, Point localLocation, boolean invertSelection) {

src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/widgets/LineWidget.java line 135:

> 133: 
> 134:             @Override
> 135:             public boolean isSelectionAllowed(Widget widget, Point localLocation, boolean invertSelection)  {

Suggestion:

            public boolean isSelectionAllowed(Widget widget, Point localLocation, boolean invertSelection) {

src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/widgets/LineWidget.java line 140:

> 138: 
> 139:             @Override
> 140:             public void select(Widget widget, Point localLocation, boolean invertSelection)  {

Suggestion:

            public void select(Widget widget, Point localLocation, boolean invertSelection) {

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

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


More information about the hotspot-compiler-dev mailing list