Skip to content

Commit

Permalink
Minor update to version 2.1.11.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin McCluney committed Jul 3, 2024
1 parent c152309 commit ce93023
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
Binary file modified CCDD.jar
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 **

Expand Down
2 changes: 1 addition & 1 deletion ccdd.build.number
Original file line number Diff line number Diff line change
@@ -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
16 changes: 12 additions & 4 deletions src/CCDD/CcddClassesComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 13 additions & 7 deletions src/CCDD/CcddMessageIDHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ protected List<String[]> 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;
Expand Down Expand Up @@ -606,17 +606,23 @@ 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)
{
// 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
Expand All @@ -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)
{
Expand Down

0 comments on commit ce93023

Please sign in to comment.