You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2009/01/17 09:25:59 UTC

[jira] Closed: (CLI-170) TypeHandler prints messages to stderr

     [ https://issues.apache.org/jira/browse/CLI-170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed CLI-170.
-----------------------------

    Resolution: Fixed

svn ci -m "Applying my patch from CLI-170 - TypeHandler prints messages to stderr. It doesn't change the default behaviour, but it does provide a new method which maybe called to not get the stderr output and instead get a checked exception thrown. "

Sending        src/java/org/apache/commons/cli/CommandLine.java
Sending        src/java/org/apache/commons/cli/TypeHandler.java
Transmitting file data ..
Committed revision 735247.

> TypeHandler prints messages to stderr
> -------------------------------------
>
>                 Key: CLI-170
>                 URL: https://issues.apache.org/jira/browse/CLI-170
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: Validation
>    Affects Versions: 1.1
>            Reporter: J. Lewis Muir
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CLI-170.patch, remove-messages-to-stderr.patch
>
>
> Certain methods in {{TypeHandler}} print a message to stderr when they are unable to create the object they are to return.  I don't think this should be.  The documentation for each method clearly states that if it is unable to create the object, it returns {{null}}.  If more information should be reported to the caller, these methods should be changed to throw an exception.  I've removed the printing of these messages from {{TypeHandler}}.
> This fix also makes the unit test output clean.  Right now, certain test cases exercise the "returns {{null}}" behavior of some of the {{TypeHandler}} methods, and this causes various error messages to be written to stderr which makes the test case output look unclean and like something has gone wrong when in fact everything is working correctly.
> Attached is a patch for this fix.  The patch is against [http://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.