Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-5289 - Fixed dispose bug in column filter dialog

dragonmacher5375b6ea3aa2
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterData.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterData.java
index 4796483f72..3f35ec7138 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterData.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterData.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -171,7 +171,7 @@ public class ColumnFilterData<T> implements Comparable<ColumnFilterData<T>> {
//@formatter:off
return "{\n" +
"\tname: " + name + ",\n" +
- "\tmodelColumn" + modelIndex + ",\n" +
+ "\tmodelColumn: " + modelIndex + ",\n" +
"\tviewColumn: " + viewIndex + ",\n" +
"\tconstraints: " +
CollectionUtils.collect(applicableConstraints, c -> c.asString()) +"\n" +
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java
index 9c94cd40d3..3394f9c184 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -317,8 +317,12 @@ public class ColumnFilterDialog<R> extends ReusableDialogComponentProvider
}
@Override
- protected void dialogClosed() {
+ public void dispose() {
dialogModel.dispose();
+ }
+
+ @Override
+ protected void dialogClosed() {
if (closeCallback != null) {
closeCallback.call();
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterCondition.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterCondition.java
index 2b69f5cb5d..cda6ca16ec 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterCondition.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterCondition.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -165,7 +165,8 @@ public class DialogFilterCondition<T> {
//@formatter:off
return "{\n" +
"\tname: " + constraintName + ",\n" +
- "\tparent: " + parent + "\n" +
+ "\teditor: " + editor + "\n" +
+// "\tparent: " + parent + "\n" + // stack overflow when DialogFilterConditionSet.toString() is called
"}";
//@formatter:on
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterConditionSet.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterConditionSet.java
index febde3d6fe..2af1564c98 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterConditionSet.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/DialogFilterConditionSet.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -170,7 +170,7 @@ public class DialogFilterConditionSet<T> {
public String toString() {
//@formatter:off
return "{\n" +
- "\tfilterRow: " + filterRow + ",\n" +
+// "\tfilterRow: " + filterRow + ",\n" + // stack overflow when DialogFilterRow.toString() is called
"\tdata: " + columnFilterData + ",\n" +
"\tconditions: " + conditionSet +"\n" +
"}";
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/MappedColumnConstraintEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/MappedColumnConstraintEditor.java
index f82716780d..7eff24f857 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/MappedColumnConstraintEditor.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/MappedColumnConstraintEditor.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,6 +21,7 @@ import javax.swing.event.ChangeListener;
import docking.widgets.table.constraint.ColumnConstraint;
import docking.widgets.table.constraint.MappedColumnConstraint;
+import generic.json.Json;
/**
* A constraint editor that supports object type conversions, wrapping the editor for the
@@ -105,4 +106,9 @@ public class MappedColumnConstraintEditor<T, M> implements ColumnConstraintEdito
public void removeChangeListener(ChangeListener constraintEditorChangeListener) {
delegateEditor.addChangeListener(constraintEditorChangeListener);
}
+
+ @Override
+ public String toString() {
+ return Json.toString(this);
+ }
}