Skip to content

Commit

Permalink
8290011: IGV: Remove dead code and cleanup
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn
  • Loading branch information
tobiasholenstein committed Oct 19, 2022
1 parent d37ce4c commit e27bea0
Show file tree
Hide file tree
Showing 133 changed files with 1,154 additions and 4,189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {
List<InputNode> nodeList = selector.selectMultiple(matcher);
if (nodeList.size() > 0) {
nodes = new LinkedHashSet<>();
for (InputNode n : nodeList) {
nodes.add(n);
}
nodes.addAll(nodeList);
displayName += " (" + nodes.size() + " nodes)";
}

Expand All @@ -88,12 +86,12 @@ public Image getOpenedIcon(int i) {

@Override
public Action[] getActions(boolean b) {
return new Action[]{(Action) SelectBytecodesAction.findObject(SelectBytecodesAction.class, true)};
return new Action[]{SelectBytecodesAction.findObject(SelectBytecodesAction.class, true)};
}

@Override
public Action getPreferredAction() {
return (Action) SelectBytecodesAction.findObject(SelectBytecodesAction.class, true);
return SelectBytecodesAction.findObject(SelectBytecodesAction.class, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
import com.sun.hotspot.igv.data.services.InputGraphProvider;
import com.sun.hotspot.igv.util.LookupHistory;
import java.awt.BorderLayout;
import java.io.Serializable;
import org.openide.ErrorManager;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.ExplorerUtils;
import org.openide.explorer.view.BeanTreeView;
import org.openide.util.*;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;

Expand Down Expand Up @@ -62,7 +61,7 @@ private BytecodeViewTopComponent() {

treeView = new BeanTreeView();
treeView.setRootVisible(false);
this.add(BorderLayout.CENTER, treeView);
add(BorderLayout.CENTER, treeView);
associateLookup(ExplorerUtils.createLookup(manager, getActionMap()));
}

Expand Down Expand Up @@ -109,11 +108,6 @@ public void componentClosed() {
LookupHistory.removeListener(InputGraphProvider.class, this);
}

@Override
public Object writeReplace() {
return new ResolvableHelper();
}

@Override
protected String preferredID() {
return PREFERRED_ID;
Expand Down Expand Up @@ -156,15 +150,6 @@ public void changed(InputGraphProvider lastProvider) {
manager.setRootContext(rootNode);
}

static final class ResolvableHelper implements Serializable {

private static final long serialVersionUID = 1L;

public Object readResolve() {
return BytecodeViewTopComponent.getDefault();
}
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static class MethodNodeChildren extends Children.Keys<InputBytecode> {

private InputMethod method;
private InputGraph graph;
private String bciString;
private final String bciString;

public MethodNodeChildren(InputMethod method, InputGraph graph, String bciString) {
this.method = method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class SelectBytecodesCookie implements Node.Cookie {

private Set<InputNode> nodes;
private final Set<InputNode> nodes;

/** Creates a new instance of SelectBytecodesCookie */
public SelectBytecodesCookie(Set<InputNode> nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<folder name="Window">
<file name="BytecodeViewAction.shadow">
<attr name="originalFile" stringvalue="Actions/Window/com-sun-hotspot-igv-bytecodes-BytecodeViewAction.instance"/>
<attr name="position" intvalue="1"/>
</file>
</folder>
</folder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
Expand All @@ -24,9 +24,9 @@
package com.sun.hotspot.igv.controlflow;

import com.sun.hotspot.igv.data.InputBlockEdge;
import com.sun.hotspot.igv.layout.Cluster;
import com.sun.hotspot.igv.layout.Link;
import com.sun.hotspot.igv.layout.Port;
import com.sun.hotspot.igv.layout.Cluster;
import java.awt.BasicStroke;
import java.awt.Point;
import java.awt.Stroke;
Expand All @@ -45,28 +45,22 @@ public class BlockConnectionWidget extends ConnectionWidget implements Link {
private static final Stroke DASHED_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f, new float[]{5, 5}, 0);
private static final Stroke BOLD_DASHED_STROKE = new BasicStroke(2.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f, new float[]{5, 5}, 0);

private BlockWidget from;
private BlockWidget to;
private Port inputSlot;
private Port outputSlot;
private final BlockWidget from;
private final BlockWidget to;
private final Port inputSlot;
private final Port outputSlot;
private List<Point> points;
private InputBlockEdge edge;
private boolean isDashed = false;
private boolean isBold = false;

public BlockConnectionWidget(ControlFlowScene scene, InputBlockEdge edge) {
super(scene);

this.edge = edge;
this.from = (BlockWidget) scene.findWidget(edge.getFrom());
this.to = (BlockWidget) scene.findWidget(edge.getTo());
inputSlot = to.getInputSlot();
outputSlot = from.getOutputSlot();
points = new ArrayList<Point>();
}

public InputBlockEdge getEdge() {
return edge;
points = new ArrayList<>();
}

public Port getTo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
Expand All @@ -27,11 +27,7 @@
import com.sun.hotspot.igv.layout.Cluster;
import com.sun.hotspot.igv.layout.Port;
import com.sun.hotspot.igv.layout.Vertex;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.*;
import org.netbeans.api.visual.border.BorderFactory;
import org.netbeans.api.visual.model.ObjectState;
import org.netbeans.api.visual.widget.LabelWidget;
Expand All @@ -43,11 +39,10 @@
public class BlockWidget extends LabelWidget implements Vertex {

public static final Dimension MIN_SIZE = new Dimension(20, 20);
private InputBlock block;
private Port inputSlot;
private Port outputSlot;
private final InputBlock block;
private final Port inputSlot;
private final Port outputSlot;
private Cluster cluster;
private boolean root;
private static final Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 12);
private static final Font boldFont = font.deriveFont(Font.BOLD);
public static final Color NORMAL_FOREGROUND_COLOR = Color.BLACK;
Expand Down Expand Up @@ -123,15 +118,7 @@ public Cluster getCluster() {
}

public boolean isRoot() {
return root;
}

public void setCluster(Cluster c) {
cluster = c;
}

public void setRoot(boolean b) {
root = b;
return false;
}

public int compareTo(Vertex o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
Expand Down

1 comment on commit e27bea0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.