Skip to content

Commit b0c92c0

Browse files
committed
Fixing the previous commit so the right variable is used. There's no reason to share the options class between methods, so deleting the setUp()
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x@745755 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4745ade commit b0c92c0

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/test/org/apache/commons/cli/bug/BugCLI162Test.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@
3232

3333
public class BugCLI162Test extends TestCase {
3434

35-
private Options options;
36-
37-
public void setUp() {
38-
options = new Options();
39-
options.addOption("h", "help", false, "This is a looooong description");
40-
}
41-
4235
public void testInfiniteLoop() {
36+
Options options = new Options();
37+
options.addOption("h", "help", false, "This is a looooong description");
4338
HelpFormatter formatter = new HelpFormatter();
4439
formatter.setWidth(20);
4540
formatter.printHelp("app", options); // used to hang & crash
@@ -229,7 +224,7 @@ public void testPrintHelpLongLines() throws ParseException, IOException {
229224
"Converts the JDBC file in the first argument to an SMFD file specified in the second argument.");
230225
option.setArgs(2);
231226
commandLineOptions.addOption(option);
232-
new HelpFormatter().printHelp(this.getClass().getName(), options);
227+
new HelpFormatter().printHelp(this.getClass().getName(), commandLineOptions);
233228
}
234229

235230
}

0 commit comments

Comments
 (0)