diff src/main/java/org/monetdb/mcl/net/MapiSocket.java @ 904:2d880f90be2a

Try to use reasonable defaults for ClientInfo
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Fri, 14 Jun 2024 16:50:27 +0200 (10 months ago)
parents 778959b2e0a4
children a52bc2dcdb8c
line wrap: on
line diff
--- a/src/main/java/org/monetdb/mcl/net/MapiSocket.java
+++ b/src/main/java/org/monetdb/mcl/net/MapiSocket.java
@@ -502,8 +502,12 @@ public final class MapiSocket {
 		if (parts.length > 9 && target.isClientInfo()) {
 			clientInfo = new ClientInfo();
 			try {
-				clientInfo.set("ApplicationName", target.getClientApplication());
-				clientInfo.set("ClientRemark", target.getClientRemark());
+				String clientApplication = target.getClientApplication();
+				String clientRemark = target.getClientRemark();
+				if (!clientApplication.isEmpty())
+					clientInfo.set("ApplicationName", clientApplication);
+				if (!clientRemark.isEmpty())
+					clientInfo.set("ClientRemark", clientRemark);
 			} catch (SQLClientInfoException e) {
 				String keys = String.join(", ", e.getFailedProperties().keySet());
 				throw new MCLException("Could not set ClientInfo properties: " + keys, e);