{"action":"closed","issue":{"url":"https://api.github.com/repos/remkop/picocli/issues/148","repository_url":"https://api.github.com/repos/remkop/picocli","labels_url":"https://api.github.com/repos/remkop/picocli/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/remkop/picocli/issues/148/comments","events_url":"https://api.github.com/repos/remkop/picocli/issues/148/events","html_url":"https://github.com/remkop/picocli/issues/148","id":242551153,"number":148,"title":"Long string in default value causes infinite loop within usage printer","user":{"login":"smartboyathome","id":335269,"avatar_url":"https://avatars0.githubusercontent.com/u/335269?v=4","gravatar_id":"","url":"https://api.github.com/users/smartboyathome","html_url":"https://github.com/smartboyathome","followers_url":"https://api.github.com/users/smartboyathome/followers","following_url":"https://api.github.com/users/smartboyathome/following{/other_user}","gists_url":"https://api.github.com/users/smartboyathome/gists{/gist_id}","starred_url":"https://api.github.com/users/smartboyathome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartboyathome/subscriptions","organizations_url":"https://api.github.com/users/smartboyathome/orgs","repos_url":"https://api.github.com/users/smartboyathome/repos","events_url":"https://api.github.com/users/smartboyathome/events{/privacy}","received_events_url":"https://api.github.com/users/smartboyathome/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-13T00:14:15Z","updated_at":"2017-07-21T23:10:40Z","closed_at":"2017-07-21T23:10:40Z","body":"In using picocli version 0.9.7 as part of a Groovy script I am writing, I have uncovered an infinite loop in the usage() printer. Specifically, I have a command line so:\r\n\r\n    @Command(showDefaultValues = true)\r\n    class MainCommand {\r\n        @Option(names = \"--config-dir\", description = \"The path to the directory holding the configs\")\r\n        File configDir = Paths.get(getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParent().getParent().resolve(\"configs\").toFile()\r\n    }\r\n\r\nThis results in a long path like so: `C:\\Users\\USERNAME\\Development\\MY_SOFTWARE\\my-software-config\\configs`\r\n\r\nThis value, after running through break iterator, results in the value of variable text within method `CommandLine.Help.TextTable.copy(BreakIterator line, Text text, Text destination, int offset)` being `\\Users\\USERNAME\\Development\\MY_SOFTWARE\\my-software-config\\configs`, which is unable to be wrapped when used by `CommandLine.Help.TextTable.putValue(int row, int col, Text value)` line 3013. This inability to wrap causes the wrap iterator inside that function to go into an infinite loop.\r\n\r\nNow, my workaround is to stop outputting the default value, but I imagine this could bite others as well, but that makes my script less clear."}}
{"actor":{"display_login":"remkop"}}