|Summary:||Replace clone() with copy constructor|
|Product:||POI||Reporter:||Andreas Beeker <kiwiwings>|
|Component:||POI Overall||Assignee:||POI Developers List <dev>|
Description Andreas Beeker 2019-12-14 23:04:02 UTC
Sonar complains about a lot of clone() implementations - mainly in HSSF, DDF. see also https://www.artima.com/intv/bloch.html#part13 I'll replace them with a copy constructor + copy() method and delegate clone() to copy() where necessary.
Comment 2 Andreas Beeker 2019-12-22 21:48:54 UTC
The patch applied via r1871911 is quite a big one. I've implemented the copy constructor and copy() method for the HSSF classes which implemented Cloneable. Originally I thought about the Duplication interface having a type parameter to force the implementation for a specific type, but rolled back the generics as this makes the class definitions hard to read and user code would be flagged as using the raw classes. Furthermore I've cleaned up the javadocs and removed the reference to the authors and the Microsoft Excel 97 Developer's Kit - compared to the constantly updated [MS-XLS] this is probably quite out-dated. I've kept the clone() methods to be removed in 5.0.0 - I'd prefer to remove those soon than later ...