From 5b5e0fba408e9fa41219d5e03f270ec53b4d6b75 Mon Sep 17 00:00:00 2001 From: Kamil Jarmusik Date: Thu, 2 Nov 2023 17:59:05 +0100 Subject: [PATCH] #2752 Excluding synchronized fields in the toString implementation - * Excluded fields in: HttpImageDataSourceRT, SingleExecutorSingleWaiter, PointValueService.BatchWriteBehind; --- .../mango/rt/dataSource/http/HttpImageDataSourceRT.java | 8 +++----- .../rt/dataSource/persistent/PersistentDataSourceRT.java | 6 ++---- .../serotonin/mango/rt/maint/work/ProcessWorkItem.java | 2 +- .../serotonin/timer/sync/SingleExecutorSingleWaiter.java | 4 +--- src/org/scada_lts/mango/service/PointValueService.java | 3 +-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/com/serotonin/mango/rt/dataSource/http/HttpImageDataSourceRT.java b/src/com/serotonin/mango/rt/dataSource/http/HttpImageDataSourceRT.java index 29c60d87c7..89468b4d9b 100644 --- a/src/com/serotonin/mango/rt/dataSource/http/HttpImageDataSourceRT.java +++ b/src/com/serotonin/mango/rt/dataSource/http/HttpImageDataSourceRT.java @@ -223,12 +223,10 @@ public int getPriority() { @Override public String toString() { - return "ImageRetriever{" + - "monitor=" + monitor + - ", " + (dp == null ? null : LoggingUtils.dataPointInfo(dp.getVO())) + + return "ImageRetriever{dp='" + (dp == null ? null : LoggingUtils.dataPointInfo(dp.getVO())) + '\'' + ", time=" + time + - ", retrievalFailure=" + retrievalFailure + - ", saveFailure=" + saveFailure + + ", retrievalFailure='" + (retrievalFailure == null ? null : retrievalFailure.getLocalizedMessage(Common.getBundle())) + '\'' + + ", saveFailure='" + (saveFailure == null ? null : saveFailure.getLocalizedMessage(Common.getBundle())) + '\'' + '}'; } @Override diff --git a/src/com/serotonin/mango/rt/dataSource/persistent/PersistentDataSourceRT.java b/src/com/serotonin/mango/rt/dataSource/persistent/PersistentDataSourceRT.java index fc17a9ab38..7b1ff0d15b 100644 --- a/src/com/serotonin/mango/rt/dataSource/persistent/PersistentDataSourceRT.java +++ b/src/com/serotonin/mango/rt/dataSource/persistent/PersistentDataSourceRT.java @@ -666,8 +666,7 @@ public String getDetails() { @Override public String toString() { - return "RangeCountHandler{" + - "details='" + details + '\'' + + return "RangeCountHandler{details='" + details + '\'' + ", requestId=" + requestId + ", index=" + index + ", from=" + from + @@ -688,8 +687,7 @@ public String getDetails() { @Override public String toString() { - return "ConnectionHandler{" + - ", version=" + version + + return "ConnectionHandler{version=" + version + ", indexedXids=" + indexedXids + ", details='" + details + '\'' + ", connectionTime=" + connectionTime + diff --git a/src/com/serotonin/mango/rt/maint/work/ProcessWorkItem.java b/src/com/serotonin/mango/rt/maint/work/ProcessWorkItem.java index 64a06aad98..65ca3e91d1 100644 --- a/src/com/serotonin/mango/rt/maint/work/ProcessWorkItem.java +++ b/src/com/serotonin/mango/rt/maint/work/ProcessWorkItem.java @@ -273,7 +273,7 @@ public String toString() { return "ProcessWorkItem{" + "command='" + command + '\'' + ", details='" + details + '\'' + - "} " + super.toString(); + "}"; } @Override diff --git a/src/com/serotonin/timer/sync/SingleExecutorSingleWaiter.java b/src/com/serotonin/timer/sync/SingleExecutorSingleWaiter.java index 1e5fa62e2f..77b6c5146b 100644 --- a/src/com/serotonin/timer/sync/SingleExecutorSingleWaiter.java +++ b/src/com/serotonin/timer/sync/SingleExecutorSingleWaiter.java @@ -90,9 +90,7 @@ public int getPriority() { @Override public String toString() { - return "TaskWrapper{" + - "command=" + command + - ", details='" + details + '\'' + + return "TaskWrapper{details='" + details + '\'' + '}'; } diff --git a/src/org/scada_lts/mango/service/PointValueService.java b/src/org/scada_lts/mango/service/PointValueService.java index c437228715..276854d2d7 100644 --- a/src/org/scada_lts/mango/service/PointValueService.java +++ b/src/org/scada_lts/mango/service/PointValueService.java @@ -66,7 +66,6 @@ import com.serotonin.util.queue.ObjectQueue; import static com.serotonin.mango.util.LoggingScriptUtils.infoErrorExecutionScript; -import static com.serotonin.mango.util.LoggingUtils.entryInfo; /** * Base on the PointValueDao @@ -625,7 +624,7 @@ public int getPriority() { @Override public String toString() { - return "BatchWriteBehind{entries size: " + ENTRIES.size() + ", instances size: " + instances.size() + '}'; + return "BatchWriteBehind{instances size: " + instances.size() + '}'; } @Override