Skip to content

Commit 2e9d422

Browse files
committed
Update SearchElement and ContentSearchElement ToStringStyles
This commit is kept separate to show changes, but I intend for it to be squashed into the first commit of the PR before merging. This removes the special String handling I had previously added which wraps them in quotes. During a sidebar discussion I discovered that, 1. These objects are not searchable in the Events GUI. 2. These objects are stored as a property of the alert in the database as the toString value, rather than in serialized object form. In light of that, if anyone is either exporting these to another system or using the Client API to search the event details, I think it would be easier to do a text search without the quotes, and this also matches how the values were previously stored so that the searches don't need to be written with optional quotes to catch events before and after this patch. Signed-off-by: Tony Germano <tony@germano.name>
1 parent 4939c56 commit 2e9d422

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

server/src/com/mirth/connect/model/ContentSearchElementToStringStyle.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
public class ContentSearchElementToStringStyle extends SearchElementToStringStyle {
1111
public ContentSearchElementToStringStyle() {
1212
super();
13-
setFieldSeparator(", ");
1413
setArraySeparator(", ");
1514
setArrayStart("[");
1615
setArrayEnd("]");

server/src/com/mirth/connect/model/SearchElementToStringStyle.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,9 @@
99
public class SearchElementToStringStyle extends ToStringStyle {
1010
public SearchElementToStringStyle() {
1111
super();
12-
this.setUseShortClassName(true);
13-
this.setUseIdentityHashCode(false);
14-
}
15-
16-
@Override
17-
protected void appendDetail(StringBuffer buffer, String fieldname, Object value) {
18-
if (value instanceof String) {
19-
buffer.append("\"" + value + "\"");
20-
} else {
21-
super.appendDetail(buffer, fieldname, value);
22-
}
12+
setUseShortClassName(true);
13+
setUseIdentityHashCode(false);
14+
setFieldSeparator(", ");
2315
}
2416

2517
public static SearchElementToStringStyle instance() {

0 commit comments

Comments
 (0)