[ 
https://issues.apache.org/jira/browse/CLI-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674473#action_12674473
 ] 

Henri Yandell commented on CLI-162:
-----------------------------------

svn ci -m "Applying my second attempt at a patch to CLI-162. This fixes Gary's 
reported bug (one of which was an example of CLI-162, and one a bug in my first 
attempt to patch). Open question is whether to output text that is too long, or 
try and break it up to fit the screen width. "

Sending        src/java/org/apache/commons/cli/HelpFormatter.java
Sending        src/test/org/apache/commons/cli/bug/BugCLI162Test.java
Transmitting file data ..
Committed revision 745388.

> infinite loop in the wrapping code of HelpFormatter
> ---------------------------------------------------
>
>                 Key: CLI-162
>                 URL: https://issues.apache.org/jira/browse/CLI-162
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: Help formatter
>    Affects Versions: 1.1
>            Reporter: Emmanuel Bourg
>             Fix For: 1.2
>
>         Attachments: CLI-162-take2.patch
>
>
> If there is not enough space to display a word on a single line, 
> HelpFormatter goes into a infinite loops until the JVM crashes with an 
> OutOfMemoryError.
> Test case:
> {code}
> Options options = new Options();
> options.addOption("h", "help", false, "This is a looooong description");
> HelpFormatter formatter = new HelpFormatter();
> formatter.setWidth(20);
> formatter.printHelp("app", options); // hang & crash
> {code}
> An helpful exception indicating the insufficient width would be more 
> appropriate than an OutOfMemoryError.

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

Reply via email to