Issue Details (XML | Word | Printable)

Key: CLI-56
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Rob Oxspring
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons CLI

[cli] clone() method doesn't fully clone contents

Created: 20/Apr/04 07:24 AM   Updated: 15/Mar/07 04:49 PM
Return to search
Component/s: CLI-1.x
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: Other

Bugzilla Id: 28482


 Description  « Hide
Broken out from #19749.

I'm a little weary of fixing this in case it was done this way on purpose... if
anyone cloning options would care to reasure me it would be appreciated. Also
need to decide if cli2 Options should be Cloneable

Rob



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sebb added a comment - 03/Oct/04 04:48 PM
The clone() method in CLI Option v 1.0 fails to clone the values array; this
means one can't pick up the values from options like "-D property=value"

Not sure whether the clone() method is really required - do options need to be
cloneable? Might be better to provide a copy constructor instead, and avoid all
the problems with clone.


Henri Yandell added a comment - 08/Mar/06 02:40 PM
clone() showed up in a commit from jkeyes, whose comment doesn't indicate any
reason for the addition:

http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli/Option.java?rev=129799&r1=129796&r2=129799


Henri Yandell added a comment - 08/Mar/06 02:41 PM
Removed clone() from Option - thus resolving this bug.