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

Andrey Turbanov aturbanov at openjdk.org
Tue Oct 11 08:07:59 UTC 2022


On Tue, 4 Oct 2022 13:39:36 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

>> Cleanup of the code in IGV without changing the functionality.
>> 
>> - removed dead code (unused classes, functions, variables) from the IGV code base
>> - merged (and removed) redundant functions
>> - added explicit position arguments to `layer.xml` - This avoids the position warning during building of IGV
>> - ordered the inputs alphabetically, and used wildcards if >= 5 imports of a particular package
>> - made class variables `final` whenever possible
>> - removed `this.` in `this.funtion()` funciton calls when it was not needed
>> - used lambdas instead of anonymous class if possible
>> - fixed whitespace issues (e.g. double whitespace)
>> - removed not needed copy of `RangeSliderModel tempModel` in `RangeSliderModel.java`
>> - changed `EditorTopComponent` to take `InputGraph` as argument in constructor instead of `Diagram` and moved the creation of the `Diagram` to `DiagramViewModel.java` to increased encapsulation/modularity
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   re-add hideDuplicates.png

src/utils/IdealGraphVisualizer/Data/src/main/java/com/sun/hotspot/igv/data/InputEdge.java line 43:

> 41: 
> 42:     public static final Comparator<InputEdge> OUTGOING_COMPARATOR = (o1, o2) -> {
> 43:             if(o1.getFromIndex() == o2.getFromIndex()) {

Suggestion:

            if (o1.getFromIndex() == o2.getFromIndex()) {

src/utils/IdealGraphVisualizer/Data/src/main/java/com/sun/hotspot/igv/data/InputEdge.java line 50:

> 48: 
> 49:     public static final Comparator<InputEdge> INGOING_COMPARATOR = (o1, o2) -> {
> 50:             if(o1.getToIndex() == o2.getToIndex()) {

Suggestion:

            if (o1.getToIndex() == o2.getToIndex()) {

src/utils/IdealGraphVisualizer/Graph/src/main/java/com/sun/hotspot/igv/graph/Diagram.java line 73:

> 71: 
> 72:         for (InputBlock b : graph.getBlocks()) {
> 73:             blocks.put(b,  new Block(b, this));

Suggestion:

            blocks.put(b, new Block(b, this));

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

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


More information about the hotspot-compiler-dev mailing list