Skip to content

Commit 497331f

Browse files
committed
Fix cyclic referencing of gxClassR
(cherry picked from commit 87c7b43)
1 parent 90c7e9f commit 497331f

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

wrappercommon/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@
6161
<artifactId>gson</artifactId>
6262
<version>2.12.1</version>
6363
</dependency>
64-
<dependency>
65-
<groupId>com.genexus</groupId>
66-
<artifactId>gxclassR</artifactId>
67-
<version>104.6-trunk.20240524121701-SNAPSHOT</version>
68-
<scope>compile</scope>
69-
</dependency>
7064
<dependency>
7165
<groupId>org.apache.logging.log4j</groupId>
7266
<artifactId>log4j-layout-template-json</artifactId>

wrappercommon/src/main/java/com/genexus/diagnostics/core/provider/Log4J2Logger.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.genexus.diagnostics.core.provider;
22

3-
import com.genexus.GxUserType;
43
import com.genexus.diagnostics.LogLevel;
54
import com.genexus.diagnostics.core.ILogger;
65
import com.google.gson.Gson;
@@ -257,10 +256,8 @@ private void writeTextFormat(String message, int logLevel, Object data, boolean
257256

258257
if (data == null || (data instanceof String && "null".equals(data.toString()))) {
259258
mapMessage.put(dataKey, (Object) null);
260-
} else if (data instanceof GxUserType) { // SDT
261-
mapMessage.put(dataKey, jsonStringToMap(fromObjectToString(data)));
262259
} else if (data instanceof String && isJson((String) data)) { // JSON Strings
263-
mapMessage.put(dataKey, jsonStringToMap(fromObjectToString(data)));
260+
mapMessage.put(dataKey, jsonStringToMap((String)data));
264261
} else {
265262
mapMessage.put(dataKey, data);
266263
}
@@ -280,10 +277,8 @@ private void writeJsonFormat(String message, int logLevel, Object data, boolean
280277

281278
if (data == null || (data instanceof String && "null".equals(data.toString()))) {
282279
mapMessage.with(dataKey, (Object) null);
283-
} else if (data instanceof GxUserType) { // SDT
284-
mapMessage.with(dataKey, jsonStringToMap(fromObjectToString(data)));
285280
} else if (data instanceof String && isJson((String) data)) { // JSON Strings
286-
mapMessage.with(dataKey, jsonStringToMap(fromObjectToString(data)));
281+
mapMessage.with(dataKey, jsonStringToMap((String)data));
287282
} else {
288283
mapMessage.with(dataKey, data);
289284
}
@@ -320,8 +315,6 @@ private static String fromObjectToString(Object value) {
320315
res = value.toString();
321316
} else if (value instanceof Map || value instanceof List) {
322317
res = new Gson().toJson(value);
323-
} else if (value instanceof GxUserType) {
324-
res = ((GxUserType) value).toJSonString();
325318
} else {
326319
// Any other object → serialize as JSON
327320
res = new Gson().toJson(value);
@@ -338,15 +331,6 @@ private static boolean isJson(String input) {
338331
}
339332
}
340333

341-
private static String getStackTrace() {
342-
StringBuilder stackTrace;
343-
stackTrace = new StringBuilder();
344-
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
345-
stackTrace.append(ste).append(System.lineSeparator());
346-
}
347-
return stackTrace.toString();
348-
}
349-
350334
private static List<String> getStackTraceAsList() {
351335
List<String> stackTraceLines = new ArrayList<>();
352336
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
@@ -355,10 +339,6 @@ private static List<String> getStackTraceAsList() {
355339
return stackTraceLines;
356340
}
357341

358-
private static String stackTraceListToString(List<String> stackTraceLines) {
359-
return String.join(System.lineSeparator(), stackTraceLines);
360-
}
361-
362342
// Convert a JSON String to Map<String, Object>
363343
private static Map<String, Object> jsonStringToMap(String jsonString) {
364344
Gson gson = new Gson();

0 commit comments

Comments
 (0)