diff --git a/CCDD.jar b/CCDD.jar index 4e693417..7e415166 100644 Binary files a/CCDD.jar and b/CCDD.jar differ diff --git a/README.md b/README.md index dfed1960..1a400aa1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Below is a brief description of what has changed in version 2.1.11 * Corrected storing of the table export path in the backing store for JSON and CSV files * Removed exporting the prototype along with the instance table information for JSON and CSV files. This caused issues when attempting to import the file directly into the table since the prototype's information (being first in the file) would be used * Corrected an error in the database verification that incorrectly indicated non-existent variables in the __values table. The array definition variable path was not properly identified +* Corrected an exception condition when detecting duplicate message IDs and the ID is blank *** Version 2.1.10 has been released ** diff --git a/ccdd.build.number b/ccdd.build.number index 26360927..c8e89fa6 100644 --- a/ccdd.build.number +++ b/ccdd.build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Tue Jul 02 08:12:27 CDT 2024 +#Wed Jul 03 10:55:21 CDT 2024 build.number=12 diff --git a/src/CCDD/CcddClassesComponent.java b/src/CCDD/CcddClassesComponent.java index 97e5d696..9f6d1305 100644 --- a/src/CCDD/CcddClassesComponent.java +++ b/src/CCDD/CcddClassesComponent.java @@ -1945,10 +1945,18 @@ public int compare(final String[] item1, final String[] item2) break; case HEXADECIMAL: - // Compare the two hexadecimal values as integers, converted to - // base 10 - result = Integer.decode(item1[compareColumn[index]]) - .compareTo(Integer.decode(item2[compareColumn[index]])); + // Compare the two values as text if either value is a blank + if (item1[compareColumn[index]].isEmpty() || item2[compareColumn[index]].isEmpty()) + { + result = item1[compareColumn[index]].compareToIgnoreCase(item2[compareColumn[index]]); + } + else + { + // Compare the two hexadecimal values as integers, converted to + // base 10 + result = Integer.decode(item1[compareColumn[index]]) + .compareTo(Integer.decode(item2[compareColumn[index]])); + } } index++; } while (result == 0 diff --git a/src/CCDD/CcddMessageIDHandler.java b/src/CCDD/CcddMessageIDHandler.java index 18d2b3e6..dc4413ef 100644 --- a/src/CCDD/CcddMessageIDHandler.java +++ b/src/CCDD/CcddMessageIDHandler.java @@ -557,7 +557,7 @@ protected List getMessageOwnersNamesAndIDs(MessageIDSortOrder sortOrde // Check if the list of messages does not include the second sub-message. This // indicates that the parent has no 'real' sub-messages - if (!tlmMsgs.contains((Object) (parentMsg + "_1"))) + if (!tlmMsgs.contains(parentMsg + "_1")) { // Store the parent message name in place of the default sub-message name tlmMsg[1] = parentMsg; @@ -606,9 +606,15 @@ private void updateUsageAndDuplicates(String ownerType, String[] ownerAndID, boolean isGetDuplicates) { - // Convert the message ID from a hexadecimal string to an integer. Remove the protection - // flag if present so that the ID can be converted to an integer - int msgID = Integer.decode(ownerAndID[1].replaceFirst("\\s*" + PROTECTED_MSG_ID_IDENT, "")); + int msgID = -1; + + // Check if the message ID is not a blank + if (!ownerAndID[1].isEmpty()) + { + // Convert the message ID from a hexadecimal string to an integer. Remove the + // protection flag if present so that the ID can be converted to an integer + msgID = Integer.decode(ownerAndID[1].replaceFirst("\\s*" + PROTECTED_MSG_ID_IDENT, "")); + } // Check if the list of duplicate message IDs is to be created if (isGetDuplicates) @@ -616,7 +622,7 @@ private void updateUsageAndDuplicates(String ownerType, // Prepend the owner type to the owner name and reformat the message ID to remove extra // leading zeroes ownerAndID[0] = ownerType + ": " + ownerAndID[0].replaceFirst(".*:", ""); - ownerAndID[1] = "0x" + Integer.toHexString(msgID); + ownerAndID[1] = msgID == -1 ? "" : "0x" + Integer.toHexString(msgID); } // Check the message ID isn't already in the list @@ -638,13 +644,13 @@ private void updateUsageAndDuplicates(String ownerType, else if (isGetDuplicates) { // Get the index of the owner and ID pair with a matching message ID, if one exists - int index = duplicates.indexOf((Object) ownerAndID[1]); + int index = duplicates.indexOf(ownerAndID[1]); // Check if this ID isn't already in the list if (index == -1) { // Get the index of the ID in the list of potential duplicates - int pdIndex = potentialDuplicates.indexOf((Object) ownerAndID[1]); + int pdIndex = potentialDuplicates.indexOf(ownerAndID[1]); if (pdIndex != -1) {