Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

use isStride1 to avoid convertSizeT if section.getStride() is empty #1073

Merged
merged 1 commit into from
Apr 3, 2018
Merged

use isStride1 to avoid convertSizeT if section.getStride() is empty #1073

merged 1 commit into from
Apr 3, 2018

Conversation

skynet2982
Copy link

Fixes #1072

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2018

CLA assistant check
All committers have signed the CLA.

@cwardgar cwardgar self-requested a review April 3, 2018 14:33
Copy link
Contributor

@cwardgar cwardgar left a comment

Choose a reason for hiding this comment

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

In general, I don't like merging changes without a test case to cover them. However, this one is small and I can't imagine how it would bite us.

convertSizeT() will only be called when stride1 == false, and that can only be the case when secStride != null && secStride.length > 0. Therefore, calling convertSizeT() is now safe, and should never result in a null return.

@cwardgar
Copy link
Contributor

cwardgar commented Apr 3, 2018

@DennisHeimbigner Do you agree with my analysis? You are the code owner, so please merge this if you do.

Copy link
Contributor

@DennisHeimbigner DennisHeimbigner left a comment

Choose a reason for hiding this comment

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

Assuming that
values.getDataAsByteBuffer(ByteOrder.nativeOrder());
works as expected, this should be ok since enum
basetypes are all integer types.

@cwardgar cwardgar merged commit bb6d8eb into Unidata:5.0.0 Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants