Skip to content

Conversation

@winfriedgerlach
Copy link

@winfriedgerlach winfriedgerlach commented Nov 12, 2025

IntData's string length calculation is wrong for certain values. This became apparent when executing code like this:

IntData intData = new IntData();
intData.reset(54321);

char[] buf = new char[intData.length()];
for( int i=0;i<intData.length(); i++ )
            buf[i] = intData.charAt(i);

Because intData.length() is erroneously calculated as 6 instead of 5, this loop will fail with IndexOutOfBoundsException in the last iteration.

Copy link
Contributor

@laurentschoelens laurentschoelens left a comment

Choose a reason for hiding this comment

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

LGTM (even if I dont get why the 20229 in original code)
Maybe add line break in test class at the end of the file
Also add / update copyright informations in header

Thanks

@winfriedgerlach
Copy link
Author

Added/changed copyright information, added line break

Copy link
Contributor

@laurentschoelens laurentschoelens left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants