RFR: JDK-8290011: IGV: Remove dead code and cleanup [v20]

Christian Hagedorn chagedorn at openjdk.org
Tue Oct 18 15:40:57 UTC 2022


On Mon, 19 Sep 2022 07:53:04 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

>> src/utils/IdealGraphVisualizer/Data/src/main/java/com/sun/hotspot/igv/data/InputNode.java line 34:
>> 
>>> 32: public class InputNode extends Properties.Entity {
>>> 33: 
>>> 34:     private int id;
>> 
>> While cleaning this class up anyways: Feels like a node id should probably not change anymore once it's set. Can this be turned into a `final` field? Looks like `setId()` is only called from this class and once from another class when creating a new input node anyways.
>
> I think it is called in `Difference.java` as well: `n2.setId(curIndex);` , right?

Yes, that's true. You could change that code to pass the index to the `InputNode` constructor:



            // Find new ID for node of b, does not change the id property
            while (graph.getNode(curIndex) != null) {
                curIndex++;
            }
            InputNode n2 = new InputNode(n, curIndex);


But I leave it up to you if you also want to refactor that or not - it's not directly related to your changes :-)

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

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


More information about the hotspot-compiler-dev mailing list