Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a warning msg when the lenghts of Table_Character gro… #18

Closed
wants to merge 1 commit into from

Conversation

hhlee445
Copy link
Contributor

@hhlee445 hhlee445 commented Dec 19, 2019

Added a warning msg when the lenghts of Table_Character groups and the specified group_length mismatch.

Resolves NASA-PDS/validate#63

…ups and the specified group_length mismatch.
@@ -141,12 +141,19 @@ private void expandGroupField(GroupFieldBinary group, int outerOffset) {
int actualGroupLength = getGroupExtent(group);

if (groupLength < actualGroupLength) {
System.err.println("WARNING: GroupFieldBinary attribute group_length is smaller than size of contained fields: "
System.err.println("\nWARNING: GroupFieldBinary attribute group_length is smaller than size of contained fields: "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhlee445 it actually looks like PDS4 JParser was handling this incorrectly before. the group length from the label and the group length from the product itself must always be ==:

if (groupLength < actualGroupLength) {
    throw ParseException("Group Length mismatch: 
					+ (groupLength * group.getRepetitions().intValueExact())
					+ "!="
					+ (actualGroupLength * group.getRepetitions().intValueExact()));
}

This will then need to be caught somewhere in validate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, in the PR, since it is in a separate repo, can we be sure to cross-ref to the other repo so we know how it is being closed out?

@jordanpadams jordanpadams changed the title issue_63: Added a warning msg when the lenghts of Table_Character gro… Added a warning msg when the lenghts of Table_Character gro… Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate Table_Character groups and their specified lengths match the specified group_length
2 participants