From 726811c9919e25d26e59950d9db61d48cf37bbde Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Thu, 21 Nov 2024 08:34:38 -0500 Subject: [PATCH] Fix conditional logic for string length checks 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") : ""; } }