Bug 59789 - Improve performance of row shifting on sheets that contain comments
Summary: Improve performance of row shifting on sheets that contain comments
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.15-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-04 02:28 UTC by Javen O'Neal
Modified: 2016-07-04 03:08 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javen O'Neal 2016-07-04 02:28:17 UTC
Found by Findbugs on POI-JDK8

HSSFSheet.java:1565, RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT, Priority: Normal

Return value of org.apache.poi.hssf.model.InternalSheet.getNoteRecords() ignored, but method has no side effect

if (moveComments) {
    _sheet.getNoteRecords()
}
Comment 1 Javen O'Neal 2016-07-04 03:06:31 UTC
HSSFComment shifting was already done inside the main for-loop, but had pretty terrible performance because it searched the drawing patriarch for all comments for ever row in the shift range.

Assuming all NoteRecords are HSSFComments, we can move the comment shifting that's done inside the main for-loop outside so that only one search for HSSFComments in the drawing patriarch is necessary.

Applied in r1751198.