Skip to content

Commit 4cf1b71

Browse files
committed
Applying the second patch from CLI-21 - moving the clone method back to public and hiding the exception.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/branches/cli-1.0.x@551819 13f79535-47bb-0310-9956-ffa450edef68
1 parent bfe6bd8 commit 4cf1b71

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/java/org/apache/commons/cli/Option.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,14 @@ public int hashCode()
632632
return result;
633633
}
634634

635-
protected Object clone() throws CloneNotSupportedException {
636-
Option option = (Option) super.clone();
637-
option.values = new ArrayList(values);
638-
return option;
635+
public Object clone() {
636+
try {
637+
Option option = (Option) super.clone();
638+
option.values = new ArrayList(values);
639+
return option;
640+
} catch(CloneNotSupportedException cnse) {
641+
throw new RuntimeException("A CloneNotSupportedException was thrown: " + cnse.getMessage());
642+
}
639643
}
640644

641645
/**

0 commit comments

Comments
 (0)