Bug 51593

Summary: Code Cleanup -unused imports, variables, StringBuffer to StringBuilder conversion in toString()
Product: POI Reporter: kalyan <kalyan.opensource>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Diff file of all changes from Eclipse IDE.
Actual Java files Modified zipped.

Description kalyan 2011-07-31 19:54:56 UTC
- The following variables may not be needed in the method stack ( though method call in the same line may be needed in few cases)
    In EscherChildRecordAnchor.java, Variable: bytesRemaining @ Line 40
    HSSFWorkbook.java, Variable: font @ Line 1064
    EncryptionInfo.java Variable: hSize @ Line 61. (This method call also may not be needed as it is not updating any instance data)
    HSSFName.java Variable: oldName @ Line 153. (This method call also may not be needed as it is not updating any instance data)
    PolygonShape.java Variable: shape @ Line 132.
    EcmaDecryptor.java Variable: size @ Line 128.

- All the toString() implementations can now be updated to StringBuilder from StringBuffer.

Currently refactored package:org.apache.poi.hssf.record.chart.* ; There are other packages as well for which a new bug shall be raised later.

- SSTRecord.java Line 295. The same null check is being done two times.
Comment 1 kalyan 2011-07-31 20:18:55 UTC
Created attachment 27334 [details]
Diff file of all changes from Eclipse IDE.

Diff file of all changes from Eclipse IDE.
Comment 2 kalyan 2011-07-31 20:20:18 UTC
Created attachment 27335 [details]
Actual Java files Modified zipped.
Comment 3 kalyan 2011-07-31 20:22:12 UTC
- In EscherChildRecordAnchor.java, Variable: bytesRemaining @ Line 40
- HSSFWorkbook.java, Variable: font @ Line 1064
- EncryptionInfo.java Variable: hSize @ Line 61.
- HSSFName.java Variable: oldName @ Line 153.
- PolygonShape.java Variable: shape @ Line 132.
- EcmaDecryptor.java Variable: size @ Line 128.
- All the toString() implementations can now be updated to StringBuilder from StringBuffer in the package "org.apache.poi.hssf.record.chart"
- SSTRecord.java Line 295. The same null check is being done two times. removed once.

Once the files are committed, the status needs to changed to fixed.
Comment 4 Andreas Beeker 2020-04-21 21:02:20 UTC
The patch is quite aged and I'm constantly fixing sonar issues and issues reported by IntelliJ - so I'm closing this now for being obsolete.