You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/12/14 23:04:02 UTC

[Bug 64004] New: Replace clone() with copy constructor

https://bz.apache.org/bugzilla/show_bug.cgi?id=64004

            Bug ID: 64004
           Summary: Replace clone() with copy constructor
           Product: POI
           Version: 4.1.x-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: kiwiwings@apache.org
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64004] Replace clone() with copy constructor

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64004

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
EscherRecords fixed via r1871563

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64004] Replace clone() with copy constructor

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64004

--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
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 ...

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64004] Replace clone() with copy constructor

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64004

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64004] Replace clone() with copy constructor

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64004

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Andreas Beeker <ki...@apache.org> ---
With r1871938 also the HWPF classes are patched.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org