Dear Wiki user, You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.
The following page has been changed by EmmanuelBourg: http://wiki.apache.org/commons/CLI The comment on the change is: Updated the URL of the project ------------------------------------------------------------------------------ = About the Commons CLI Library = This wiki site is used for discussion of topics associated with the - commons-cli project whose home page is http://jakarta.apache.org/commons/cli + commons-cli project whose home page is http://commons.apache.org/cli ---- @@ -79, +79 @@ The above code will not work in all cases, hence I discarded it. The problem is that the Activator.CreateInstance method's second parameter requires either a null value for a parameterless constructor, or a parameter array to pass to the constructor of the type you are attempting to create. As seen in OptionTest.java (and now OptionTest.cs), the DefaultOption class that extends Option does not implement a parameterless constructor, and in fact does not even override all of Option's constructors, just one. So, while using the CreateInstance method *would* result in the proper object type once cloned, it is cumbersome (although possible) to know the right constructor parameters to pass to the CreateInstance method. Even if you do figure out the parameters needed, you still have the task of cloning the new Option's properties, some of which are not publicly scoped. - Instead, I am serializing the object to be cloned and deserialzing it into a new copy. Like so: + Instead, I am serializing the object to be cloned and deserializing it into a new copy. Like so: {{{ BinaryFormatter bf = new BinaryFormatter(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org