Skip to content

Commit 0fa6a00

Browse files
committed
TruffleObjectsView - make sure the objectsView is initialized when setting aggregation & configuring the appropriate view
1 parent d3688d6 commit 0fa6a00

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

visualvm/heapviewer.truffle/src/org/graalvm/visualvm/heapviewer/truffle/ui/TruffleObjectsView.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ protected static enum Aggregation {
105105

106106
private ProfilerToolbar toolbar;
107107
private final PluggableTreeTableView objectsView;
108+
private JComponent component;
108109

109110
private Preset preset = Preset.ALL_OBJECTS;
110111
private Aggregation aggregation = Aggregation.TYPES;
@@ -153,11 +154,12 @@ protected HeapViewerNode[] computeData(RootNode root, Heap heap, String viewID,
153154
}
154155
}
155156
protected JComponent createComponent() {
156-
JComponent comp = super.createComponent();
157-
158-
setFilterComponent(FilterUtils.createFilterPanel(this));
157+
if (component == null) {
158+
component = super.createComponent();
159+
setFilterComponent(FilterUtils.createFilterPanel(this));
160+
}
159161

160-
return comp;
162+
return component;
161163
}
162164
};
163165
}
@@ -331,6 +333,7 @@ synchronized void setAggregation(Aggregation aggregation) {
331333

332334
if (objectsInvolved) {
333335
// TODO: having Count visible for Instances aggregation resets the column width!
336+
objectsView.getComponent(); // Make sure objectsView is initialized before accessing its columns
334337
boolean countVisible = objectsView.isColumnVisible(DataType.COUNT);
335338
if (Aggregation.OBJECTS.equals(aggregation)) {
336339
countVisible1 = countVisible;

0 commit comments

Comments
 (0)