- changed version to alpha04
Errors about labels out of bounds upon opening a file with fewer headers/labels
USE CASE: WHAT DO YOU WANT TO DO?
Open a second file with fewer labels(/headers?) and not get errors.
STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)
- Open test_dataset3.txt
- Open small_133x133.cdt
- Hover the cursor over the matrix
CURRENT BEHAVIOR
Continuous errors scroll across the console. E.g.:
error: tried to retrieve header for index 390 but max is 133
null
null
error: tried to retrieve header for index 390 but max is 133
null
null
error: tried to retrieve header for index 390 but max is 133
null
null
error: tried to retrieve header for index 390 but max is 133
null
null
paintComposite. Temporary band change? [no]
Saving window dimensions & position.
EXPECTED BEHAVIOR
No console errors.
DEVELOPERS ONLY SECTION
SUGGESTED CHANGE (Pseudocode optional)
Reset the max when a new file is opened.
FILES AFFECTED (where the changes will be implemented) - developers only
unknown
LEVEL OF EFFORT - developers only
minor
COMMENTS
Comments (11)
-
-
reporter Turns out that there's a TODO that, if it had been done, would have prevented this issue:
/* TODO: Check whether any of the string data has changed if the * user changes labels OR when such a change is made, set the * lastDrawn* etc. variables to initial values again. */
-
reporter - changed status to resolved
Resolved issue 341. Label index is now checked against the size of the array before accessing it.
When the user opened a file with fewer labels than the previously opened file and the longest label in the previous file was at an index out of range from the previous file, a null pointer exception was thrown. I added a check of the index and the string at that index to make sure things haven't changed before relying on that index.
Funnily enough, there was a TODO in the code to implement this check and re-initialize the appropriate values.
→ <<cset 6a3d286fbc23>>
-
reporter Resolved in branch issue341...
-
reporter Issue
#368was marked as a duplicate of this issue. -
reporter Resolved issue 341. Label index is now checked against the size of the array before accessing it.
When the user opened a file with fewer labels than the previously opened file and the longest label in the previous file was at an index out of range from the previous file, a null pointer exception was thrown. I added a check of the index and the string at that index to make sure things haven't changed before relying on that index.
Funnily enough, there was a TODO in the code to implement this check and re-initialize the appropriate values.
→ <<cset 6a3d286fbc23>>
-
reporter Merged in issue341-continuous_exceptions (pull request #56)
Resolved issue 341. Label index is now checked against the size of the array before accessing it.
→ <<cset 9aa8c2ee7e9c>>
-
reporter - changed status to closed
Merged to master.
-
reporter - changed component to Coding Convention Adherence
-
reporter - removed milestone
Removing milestone: Coding Convention Adherence (automated comment)
-
reporter - changed version to beta2
- Log in to comment