From 895525da2255a6bf9316e19024199dacc48a1730 Mon Sep 17 00:00:00 2001 From: Gcolon021 <34667267+Gcolon021@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:57:24 -0500 Subject: [PATCH] Fix conditional logic for string length checks (#59) Corrected the conditional checks for 'parentDisplay', 'parentName', and 'description' in the MetadataResultSetUtil class. This ensures that non-empty strings are returned appropriately, enhancing the accuracy of metadata retrieval. --- .../dictionary/legacysearch/MetadataResultSetUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java index bc8eea2..8d3b367 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java @@ -96,14 +96,14 @@ private static String bytesToHex(byte[] hash) { } private String getParentDisplay(ResultSet rs) throws SQLException { - return StringUtils.hasLength("parentDisplay") ? "" : rs.getString("parentDisplay"); + return StringUtils.hasLength("parentDisplay") ? rs.getString("parentDisplay") : ""; } private String getParentName(ResultSet rs) throws SQLException { - return StringUtils.hasLength(rs.getString("parentName")) ? "All Variables" : rs.getString("parentName"); + return StringUtils.hasLength(rs.getString("parentName")) ? rs.getString("parentName") : "All Variables"; } private String getDescription(ResultSet rs) throws SQLException { - return StringUtils.hasLength(rs.getString("description")) ? "" : rs.getString("description"); + return StringUtils.hasLength(rs.getString("description")) ? rs.getString("description") : ""; } }